Directives Reference
7-28 Copyright © 2000, 2001 ARM Limited. A ll rights reserved. ARM DUI 0068B
Use
|
as the argument to use the default value of a parameter. An empty string is used
if the argument is omitted.
In a macro that use s several internal labels, it is usefu l to define each in ternal label as
the base label with a different suffix.
Use a dot between a parameter and following text, or a following parameter, if a space
is not required in the expansion. Do not use a dot between preceding text and a
parameter.
Macros define the scope of local variables (see LCLA, LCLL, and LCLS on page7-6).
Macros can be nested (see Nesting directives on page7-26).
Examples
; macro definition
MACRO ; start macro definition
$label xmac $p1,$p2
; code
$label.loop1 ; code
; code
BGE $label.loop1
$label.loop2 ; code
BL $p1
BGT $label.loop2
; code
ADR $p2
; code
MEND ; end macro definition
; macro invocation
abc xmac subr1,de ; invoke macro
; code ; this is what is
abcloop1 ; code ; is produced when
; code ; the xmac macro is
BGE abcloop1 ; expanded
abcloop2 ; code
BL subr1
BGT abcloop2
; code
ADR de
; code