EasyManuals Logo

Texas Instruments C28 Series Student Guide

Texas Instruments C28 Series
342 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #285 background imageLoading...
Page #285 background image
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

Table of Contents

Other manuals for Texas Instruments C28 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments C28 Series and is the answer not in the manual?

Texas Instruments C28 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelC28 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals