Epson S5U1C62000A Manual page 80

Epson cmos 4-bit single chip microcomputer manual
Table of Contents

Advertisement

CHAPTER 5: ASSEMBLER
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
ld
rst
__L0001:
nop5
jp
("__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.
68
:
:
:
a,15
;WAIT
f,0b1101
__L0001
15
EPSON
(S1C60/62 FAMILY ASSEMBLER PACKAGE)
S5U1C62000A MANUAL

Advertisement

Table of Contents
loading

Table of Contents