3 macro-calls, Macro-calls – Epson S1C62 Family User Manual
Page 47

CROSS ASSEMBLER ASM62XX
S1C62 FAMILY
EPSON
III-17
DEVELOPMENT TOOL REFERENCE MANUAL
4.6.3
Macro-calls
The defined macro-name can be called from any location in the program by using the following format:
[
The MACRO can be called by using the macro-name.
When arguments are required, write actual arguments corresponding to the dummy arguments used in the
macro-definition. Multiple actual arguments must be separated by commas (,).
Actual and dummy arguments correspond sequentially from left to right. If the number of actual argu-
ments is greater than the number of dummy arguments, the excess actual arguments are ignored. If the
number of actual arguments is less than the number of dummy arguments, the excess dummy arguments
are replaced by nulls (00H).
Any label can be written before the macro-name.
Example:
Source file
ORG 0200H
 CTAS EQU 00H
 CTAE EQU 02H
 CAFSET EQU 0101B
 CAFRST EQU 0000B
 CTBS EQU 10H
 CTBE EQU 08H
 CBFSET EQU 0001B
 CBFRST EQU 0100B
 COUNT MACRO FSET,FRST,CTS,CTE
 LOCAL LOOP1
 SET F,FSET
 RST F,FRST
 LD A,0
 LD X,CTS
 LOOP1 ACPX MX,A
 CP XL,CTE
 JP NZ,LOOP1
 ENDM
 COUNTA COUNT CAFSET,CAFRST,CTAS,CTAE
 RET
 COUNTB COUNT CBFSET,CBFRST,CTBS,CTBE
 RET
END
The assembly listing file after assembly is shown on the next page.
