CROSS ASSEMBLER ASM62XX

4.6.3Macro-calls

The defined macro-name can be called from any location in the program by using the following format:

[<Label>]_<Macro-name>_ [<Actual-argument>, ...]

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 arguments 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

 

RSTF,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.

S1C62 FAMILY

EPSON

III-17

DEVELOPMENT TOOL REFERENCE MANUAL