Specifications
5-2 Programmer’s Guide Sega
Psy-Q Development System
MACRO, ENDM, MEXIT
Description A macro consists of the source lines and parameter place markers between the
MACRO directive and the ENDM. The label field is the symbolic name by which the
macro is invoked; the operand allows the entry of a string of parameter data names.
When the assembler encounters a directive consisting of the label and optional
parameters, the source lines are pulled into the main program and expanded by
substituting the place markers with the invocation parameters. The expansion of the
macro is stopped immediately if the assembler encounters a MEXIT directive.
Syntax Label MACRO [symbol,..symbol]
...
MEXIT
...
ENDM
See Also MACROS
Remarks
• Note that the invocation parameter string effectively starts at the character after
the macro name, that is, the dot (.) character. Text strings, as well as .b, .w and .l
are permissible parameters - see Parameters below.
• Control structures within macros must be complete. Structures started in the
macro must finish before the ENDM; similarly, a structure started externally must
not be terminated within the macro. To imitate a simple control structure
from another assembler, a short macro might be used - see MACROS below.
Examples remove macro
dc.w -2,0,0
endm
Form macro
if strcmp('\1','0')
dc.w 0
else
dc.w \1-FormBase
endif
endm