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 #291 background imageLoading...
Page #291 background image
Direct Addressing
Direct Addressing
Direct Addressing
Example
Example
Z = X + Y
Z = X + Y
x .
x .
usect
usect
“samp”,3
“samp”,3
.sect “code”
.sect “code”
MOV
MOV
AL,@x
AL,@x
MOVW DP,#x
MOVW DP,#x
ADD
ADD
AL,@y
AL,@y
MOV
MOV
@z, AL
@z, AL
Data Memory
address
address data
data
0001C0
0001C0
0001
0001
x:
x:
0001FD
0001FD
1000
1000
y:
y:
0001FE
0001FE
0500
0500
z:
z:
0001FF
0001FF
64
64
Page7[00]
Page7[00]
...
...
Page7[3D]
Page7[3D]
Page7[3E]
Page7[3E]
Page7[3F]
Page7[3F]
1500
1500
variations:
MOVW DP,#imm ;2W, 16-bit (4 Meg)
MOVZ DP,#imm ;1W, 10-bit (64K)
MOV DP,#imm ;DP(15:10) unchanged
00
00 0000 0000 0001 1111 1111
00 0000 0000 0001 1111 1111
0 0 0 1 F F
0 0 0 1 F F
DP offset
0 0 0 0 1 5 0 0
0 0 0 0 1 5 0 0
0 0 0 0 1 0 0 0
0 0 0 0 1 0 0 0
AccumulatorDP=0007
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
MOV AL,@x
ADD AL,@y
MOV @z,AL
Direct Addressing
Direct Addressing
Caveats
Caveats
Z = X + Y
Z = X + Y
x .
x .
usect
usect
samp
samp
”,3
”,3
.sect “code”
.sect “code”
ADD
ADD
AL,@y
AL,@y
MOV
MOV
@z, AL
@z, AL
Data Memory
address
address
data
data
0001C0
0001C0
0001
0001
x:
x:
0001FF
0001FF
1000
1000
y:
y:
000200
000200
0500
0500
Page7[00]
Page7[00]
...
...
Page7[3F]
Page7[3F]
Page8[00]
Page8[00]
MOVW DP,#x
MOVW DP,#x
0 0 0 0 1 0 0 1
0 0 0 0 1 0 0 1
0 0 0 7
0 0 0 7
0 0 0 0 1 0 0 0
0 0 0 0 1 0 0 0
0 0 0 7
0 0 0 7
Accumulator
DP=0007
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-0 0 0 7
0 0 0 7
MOV
MOV
AL,@x
AL,@x
0000 0000 0000 0001 1111 1111
0000 0000 0000 0001 1111 1111
DP
offset
0000 0000 0000 0010 0000 0000
0000 0000 0000 0010 0000 0000
expecting 1500
expecting 1500
Solution: Group and block variables in ASM file:
x .
x .
usect
usect
“samp”,3
“samp”,3
,1
,1
;
;Force all locations to same data
y .set x+1
y .set x+1
;page (1
;page (1
st
st
hole, else linker error)
hole, else linker error)
z .set x+2
z .set x+2 ;Assign vars within block
(X and Y not on the same page)
C28x - Appendix B - Addressing Modes B - 9

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