Assembler/Compiler Tracking of AMODE Bit
5-7C28x Addressing Modes
5.3 Assembler/Compiler Tracking of AMODE Bit
The compiler will always assume the addressing mode is set to AMODE = 0
and therefore will only use addressing modes that are valid for AMODE = 0.
The assembler can be instructed, via the command line options, to default to
either AMODE = 0 or AMODE = 1. The command line options are:
−v28 Assumes AMODE = 0 (C28x addressing modes).
−v28 −m20 Assumes AMODE = 1 (full C2xLP compatible addressing
modes.
Additionally, the assembler allows directives to be embedded within a file to
instruct the assembler to override the default mode and change syntax check-
ing to the new address mode setting:
.c28_amode Tells assembler that any code that follows assumes AMODE =
0 (C28x addressing modes).
.lp_amode Tells assembler that any code that follows assumes AMODE =
1 (full C2xLP compatible addressing modes)
The above directives cannot be nested. The above directives can be used as
follows within an assembly program:
; File assembled using “−v28” option (assume AMODE = 0):
. ; This section of code can only use AMODE = 0
; addressing modes
.
.
.
.
SETC AMODE ; Change to AMODE = 1
.lp_amode ; Tell assembler to check for AMODE = 1 syntax
. ; This section of code can only use AMODE = 1
; addressing modes
.
.
.
.
CLRC AMODE ; Revert back to AMODE = 0
.c28_amode ; Tell assembler to check for AMODE = 1 syntax
. ; This section of code can only use AMODE = 0
; addressing modes
.
.
.
.
; End of file.