Download DSP56309EVM User`s Manual

Transcript
Assembler Significant Characters
C.2.5 % Return Hex Value of Symbol Character
The %<symbol> sequence, when used in macro definitions, is replaced by an ASCII string
representing the hexadecimal value of <symbol>. This operator may be used in
association with the backslash (\) operator. The value of <symbol> must be an integer (not
floating point).
Example C-6. Example of Return Hex Value Symbol Character
Consider the following macro definition:
GEN_LAB
LAB\%VAL
MACRO
STMT
ENDM
LAB,VAL,STMT
If this macro were called as follows,
NUM
SET
GEN_LAB
10
HEX,NUM,’NOP’
The resulting expansion as it would appear in the listing file would be as follows
HEXA
NOP
C.2.6 ^ Macro Local Label Override
The circumflex (^), when used as a unary expression operator in a macro expansion,
causes any local labels in its associated term to be evaluated at normal scope rather than
macro scope. This means that any underscore labels in the expression term following the
circumflex will not be searched for in the macro local label list. The operator has no effect
on normal labels or outside of a macro expansion. The circumflex operator is useful for
passing local labels as macro arguments to be used as referents in the macro.
Note:
The circumflex is also used as the binary exclusive OR operator.
Example C-7. Example of Local Label Override Character
Consider the following macro definition:
LOAD
MACRO
MOVE
ENDM
ADDR
P:^ADDR,R0
If this macro were called as follows,
_LOCAL
LOAD
_LOCAL
the assembler would ordinarily issue an error since _LOCAL is not defined within the
body of the macro. With the override operator the assembler recognizes the _LOCAL
symbol outside the macro expansion and uses that value in the MOVE instruction.
C-4
DSP56309EVM User’s Manual
Motorola