Utility of constantes

The constantes are used in a different way in RPL and assembly.

Let's begin by assembly.

In assembly, constantes are used both for structure description, variable addresses, as constantes and for sub-program call.

In RPL, constantes are only used as entry point address.

The two types of constantes.

HPDev is able to work with two type of constantes.

Let's talk of value based constantes.

When editing constantes (See Constante editing), you did certainly see a "base" edit zone.

When you fill this edit zone with an expression, the evaluation of constantes will work in a new way.

First, the base vill be computed. this value will be assign to the first constante. The value of this constante will be compute and added to the Base and will be use to assign the value of the second constante. etc...

This options allows you to create easely following constantes. This can be usefull when designing the variable memory structure in an assembly program.

Circular Referances.

If you try to use in a constante a constante that needs you. for example foo1 =foo2 and foo2 =foo1, you will receive an error message on the two constantes saying that the symbol is not defined or not allowed in this expression.

Constante Evaluation

The constantes are computed when building the program or when the user ask for it (Calcul constantes in the compile menu).