LCD Type MCU
Macro directives enable a block of source statements to be named, and then that name to be
re-used in the source file to represent the statements. During assembly, the Cross Assembler auto-
matically replaces each occurrence of the macro name with the statements in the macro definition.
A macro can be defined at any place in the source file as long as the definition precedes the first
source line that calls this macro. In the macro definition, the macro to be defined may refer to other
macros which have been previously defined. The Cross Assembler supports a maximum of 7 nest-
[dummy-parameter [, ...]]
The Cross Assembler supports a directive
for the macro definition.
directive defines symbols available only in the defined macro. It must be the first line
directive, if it is present. The
is a temporary name that is re-
placed by a unique name when the macro is expanded. The Cross Assembler creates a new ac-
tual name for
each time the macro is expanded. The actual name has the form
where digit is a hexadecimal number within the range from 0000 to FFFF. A label
should be added to the
directive when labels are used within the
Otherwise, the Cross Assembler will issue an error if this
is referred to more than once in
the source file.
In the following example,
are both dummy parameters, and are replaced by ac-
tual parameters when calling this macro.
are both declared
are replaced by
respectively at the first reference, if no other
ferred. If no
declaration takes place,
will be referred to labels, simi-
lar to the declaration in the source program. At the second reference of this macro, a multiple
define error message is displayed.