Table of Contents
Previous topic Next topic
CROSS ASSEMBLER->Assembler Source Code Format->Label Field
The label field starts at the beginning of the line with no preceding spaces.
Labels (or symbols) may be any length consistent with the maximum line length of 255 character.
Allowable characters for labels (or symbols) are:
|Upper case characters||A to Z|
|Lower case characters||a to z|
|Digits||0 to 9||(Except first character)|
|Period||.||(First character only)|
|Dollar||$||(Except first character)|
|Ampersand||@||(Except first character)|
Symbols are case sensitive and so the cross-assembler distinguishes between upper and lower case characters.
Digits, the dollar and the ampersand are not allowed to be the first character of the symbol (otherwise they would be confused with numbers).
The use of symbols beginning with a period and consisting then only of digits (eg .13) is not recommended since the assembler generates symbol names of this format when expanding macros.
Labels beginning with a period followed by an ampersand (ie .@xxxx) are also special. They are regarded by the cross-assembler as being local to the file in which they are located. Thus the names can be reused in other included files without the duplicate label error occurring.
There are a number of other symbols used by the assembler. Use of these as labels could confuse the evaluation of the operand field. They are therefore reserved and there presence in the label field will generate an error. The reserved symbols are:
NARG, R1, R2, R3, R4, R5, R6, R7, A, DPTR, HIGH, LOW, MOD, SHL, SHR, EQ, NE, LT, LE, GT, GE, NOT, AND, OR, XOR
in either upper or lower case.
Symbols being used as a macro names, must not be the same as a microprocessor instruction mnemonic or an assembler directive. A check is carried out by the cross assembler to prevent this.
A symbol can only be defined once unless it was defined using the SET directive.
For some directives, the presence of a symbol in the label field is compulsory. These are:
EQU, SET, MACR
Also some operation directives do not allow a label to be present. These are:
END, ENDC, ENDM, FAIL, IFcc, NAM, OPT, ORG, SPC, TTL, INCLUDE, CLIST, NOCLIST, MC, NOMC, MD, NOMD, MEX, NOMEX, OBJ, NOOBJ, PAGE, NOPAGE, SEQON, NOSEQ, SYM, UNA, NOUNA, LIST, NOLIST, SREC, BIN, LISTF