Assembler Directives and
.MACRO Directive
and prevents the label from being referenced from outside the body of the macro definition. This suffix also contains a number that is used as a counter by the Assembler.
The following example defines the macro PRINT, which calls the printf() function (see printf(3S) in
PRINT .MACRO | DATA_ADDR |
ADDIL | L'DATA_ADDR,%dp |
.CALL |
|
BL | printf,%rp |
LDO | R'DATA_ADDR(%r1),%arg0 |
.ENDM |
|
The next example defines the macro STORE. STORE places the contents of the register REG, the first macro parameter, into the memory address LOC, the second parameter.
STORE | .MACRO | REG,LOC |
| LDIL | |
| STW | |
| .ENDM |
|
100 | Chapter 4 |