A Local label is a label that is only accessible in a local section like local variables in Pascal or C.

A local section starts at the beginning of a source, after a global label or after a link (see link section). A local section finishes at the end of a source, before a link or before a global label.

A local label is identified by a ‘.’ as the first character.

Link labels

A link label is a label that exists only in the link where it is declared, like a private clause in Object Pascal. A link label is identified by a ‘’ as the first character.

Notes:

1.In projects, using fewer global labels is better because a global label takes longer to compile and because it gives a better program structure. A good habit is to use global labels to cut the program in subroutines, and to use local labels inside these subroutines.

2.The command line editor is able to find labels in a source. See the GOTO selection in the command line TOOL menu.

3.Labels in System RPL should only be used by people who know what they are doing. They are only used for fixed address programs (absolute mode) which is pretty advanced programming.

4.Labels can not be given the same name as constants.

“extable”

“extable” is an external library that contains a list of constants. This list can be used by MASD as a basic list of constants and is especially useful to the System RPL programmer as most entry points are defined there (like TURNMENUOFF for example). In addition, it also contains a set of supported constants and ASM entry points for the ASM programmer. Please read the extable section in this document to find more information about this library.

Constants

Constants are a way for the user to associate a value to an alphanumerical name. This is extremely useful as it makes programs much easier to read and makes them more portable. One of the most popular ways to use constants is to represent memory address for storage of variables.

For example, instead of typing D1=80100 every time it is needed, it is better to declare DC Result 80100 at the beginning of the project and then to type D1=(5)Result when needed (it is more portable, more readable and less likely to cause errors).

You can create a constant in ASM or ARM mode by doing:

DC CstName ExpressionHex or

DEFINE CstName ExpressionHex or

EQU CstName ExpressionHex

In RPL mode, the only valid way to define a constant is:

EQU CstName ExpressionHex

ExpressionHex is either a hexadecimal number or an expression (starting with a char that can not be confused with the start of a hex number (09, AF). An expression starting with a hexadecimal number can be typed with a leading $, an expression starting with a decimal number can be typed with a leading # character. For an expression starting with a constant that starts with a A...9 or A...F character, you should put the constant in brackets.

Notes:

1.A constant cannot be given the same name as a label.

2.The name of a constant follows the same rules as the name of a label.

6-14 The Development Library