CHAPTER 4: ASSEMBLER
S5U1C63000A MANUAL EPSON 69
(S1C63 FAMILY ASSEMBLER PACKAGE)
Expansion rules
When a defined macro name appears in the source, the assembler inserts a statement string defined in
that location.
If there are actual parameters described in that process, the dummy parameters will be replaced with
the actual parameters in the same order as the latter are arranged.
The internal branch labels are replaced, respectively, with __L0001 ... from top of the source in the
same order as they appear.
Sample expansion:
When the macro WAIT shown above is defined:
Macro invocation
:
WAIT 15
:
After expansion
:
;WAIT 15
ld %a,15
and %f,0b1101
__L0001:
nop
jr __L0001
("__L0001" denotes the case where an internal branch label is expanded for the first time in the source.)
Precautions
• The assembler only permits backward reference of a macro invocation. Therefore the macro definition
must precede the use of it.
• Once a defined macro name is defined, it cannot be canceled. If the same macro name is defined
duplicatedly, a warning message will appear. Until it is redefined, it is expanded with the original
content, and once it is redefined, it is expanded with the new content. Definition should be done with
distinct names, although the program operation will not be affected.
• No other characters than delimiters (space, tab, line feed, and commas) can be added before and after
a dummy parameter in a statement.
• The same character string as that of the define instruction cannot be used as a macro name.
• When the number of dummy parameters differs from that of actual parameters, an error will result.
• The maximum number of parameters and internal branch labels are limited according to the free
memory space.
• "__Lnnnn" used for the internal branch labels should not be employed as other label or symbol.