Labels, Mnemonics and Assembly Directives
Labels, Mnemonics and Assembly Directives
.def
.def
start
start
count
count
.set
.set
9
9
;create an array x of 10 words
;create an array x of 10 words
x
x
.
.
usect
usect
“
“
mydata
mydata
”, 10
”, 10
.sect
.sect
“code”
“code”
start:
start:
C28OBJ
C28OBJ
;operate in C28x mode
;operate in C28x mode
MOV
MOV
ACC,#1
ACC,#1
next:
next:
MOVL
MOVL
XAR1,#x
XAR1,#x
MOV
MOV
AR2,#count
AR2,#count
loop:
loop:
MOV
MOV
*XAR1++,AL
*XAR1++,AL
BANZ
BANZ
loop,AR2
loop,AR2
--
--
bump:
bump:
ADD
ADD
ACC,#1
ACC,#1
SB
SB
next,UNC
next,UNC
.ref
.ref
start
start
.sect
.sect
“vectors”
“vectors”
;make reset vector address 'start'
;make reset vector address 'start'
reset:
reset:
.long
.long
start
start
Labels and Mnemonics
Labels and Mnemonics
Mnemonics
Mnemonics
Lines of instructions
Lines of instructions
Use upper or lower case
Use upper or lower case
Become components of
Become components of
program memory
program memory
Labels
Labels
Optional for all assembly
Optional for all assembly
instructions and most
instructions and most
assembler directives
assembler directives
Must begin in column 1
Must begin in column 1
The “ : ” is not treated as
The “ : ” is not treated as
part of the label name
part of the label name
Used as pointers to
Used as pointers to
memory or instructions
memory or instructions
.def
.def
start
start
count
count
.set
.set
9
9
; create an array x of 10 words
; create an array x of 10 words
x
x
.
.
usect
usect
“
“
mydata
mydata
”, 10
”, 10
.sect
.sect
“code”
“code”
start:
start:
C28OBJ
C28OBJ
;operate in C28x mode
;operate in C28x mode
MOV
MOV
ACC,#1
ACC,#1
next:
next:
MOVL
MOVL
XAR1,#x
XAR1,#x
MOV
MOV
AR2,#count
AR2,#count
loop:
loop:
MOV
MOV
*XAR1++,AL
*XAR1++,AL
BANZ
BANZ
loop,AR2
loop,AR2
--
--
bump:
bump:
ADD
ADD
ACC,#1
ACC,#1
SB
SB
next,UNC
next,UNC
Assembly Directives
Assembly Directives
.ref
.ref
start
start
.sect
.sect
“vectors”
“vectors”
;make reset vector address 'start'
;make reset vector address 'start'
reset:
reset:
.long
.long
start
start
Directives allow you to:
Directives allow you to:
Define a label as global
Define a label as global
Reserve space in memory
Reserve space in memory
for un
for un
-
-
initialized variables
initialized variables
Initialized memory
Initialized memory
Begin with a period (.) and are
Begin with a period (.) and are
lower case
lower case
Used by the linker to locate
Used by the linker to locate
code and data into specified
code and data into specified
sections
sections
initialized section
initialized section
.sect
.sect
“name”
“name”
used for code or constants
used for code or constants
uninitialized
uninitialized
section
section
label
label
.
.
usect
usect
“name”,5
“name”,5
used for variables
used for variables
Directives
Directives
C28x - Appendix B - Addressing Modes
B - 3
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...