![background image](http://html1.mh-extra.com/html/texas-instruments/tms320c28x/tms320c28x_reference-manual_1097071652.webp)
Moving to a C28x Object
F-9
Migration From C27x to C28x
F.2 Moving to a C28x Object
The C28x instruction set is a superset of the C27x instruction set. The syntax
of a number of instructions however has changed slightly due to the modifica-
tions in registers as previously described. (For a summary of syntax changes,
see Section F.3.1
I
nstruction Syntax Changes
). To quickly move to C28x ob-
ject code, the codegen tools allow you to build a C28x object file with a switch
allowing for C27x source syntax:
Figure F
−
7. Building a C28x Object File From Mixed C27x/C28x Source
CL2000
−
V28
−
m27
C27x/C28x
Source Code
(.asm .c .cpp)
C28x Object
(.out)
−
v28
−
m27
Accepts C28x & C27x syntax. Generates C28x object only (assumes OBJMODE == 1)
Prior to running C28x object you must set the mode of the device appropriately (OBJMODE
== 1). To do this, you set the OBJMODE bit in ST1 to 1 after reset. This can be done with
a ”C28OBJ” (or ”SETC OBJMODE”) instruction. Note that before the “C28OBJ” instruction
is executed, the disassembly window in the debugger may display incorrect information.
This is because the debugger will decode memory as C27x opcodes until after you execute
the “C28OBJ” instruction.
When running in this mode, the disassembly window in your debugger will show the C28x
instruction syntax for all instructions. For example, the C27x MOV AR0,@SP instruction
will look like MOVZ AR0,@SP, which is the C28x-equivalent instruction.
Now that you are using a C28x object file, you can add C28x operations to your source
code.
F.2.1 Caution When Changing OJBMODE
On reset, the XARn registers are forced to 0x0000 0000 and
OBJMODE == 0. When operating in C27x compatible mode (OBJMODE ==
0), the upper bits of the XARn registers are protected from writes. Some things
to be aware of when changing OBJMODE:
-
When operating in C28x object mode (OBJMODE == 1) overflow can oc-
cur to the extended portion of XARn registers and program execution is
not specified. This would be an issue for assembly code that is reassem-
bled in C28x mode when you relied on the fact that C27x registers were
a certain size.
-
If the user switches to C28x object mode (OBJMODE == 1), then the upper
bits of XARn registers may be modified. If you then switch back to C27x
Summary of Contents for TMS320C28x
Page 30: ...1 12...
Page 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Page 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Page 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Page 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Page 585: ...This page intentionally left blank 7 32 This page intentionally left blank...