5.4.2 Usage of macro

A macro is described by registering a pattern with a set sequence and by using this pattern. A macro is defined by the user. A macro is defined as follows. The macro body is enclosed by ".MACRO" and ".ENDM".

ADDINT8 .MACRO  PARA1, PARA2  ;The following two statements constitute the macro body.
        MOV     A, #PARA1
        ADD     A, #PARA2
        .ENDM

 

If the following description is made after the above definition has been made, the macro is replaced by a code that "adds 0x10 and 0x20".

ADDINT8 0x10, 0x20

 

In other words, the macro is expanded into the following codes.

MOV     A, #0x10
ADD     A, #0x20