Memory Mapped
Memory Mapped
C5X processors can address 64K words of program memory and 96K words of data memory. C5Xx
supports the following six addressing modes:
Direct addressing
Memory-mapped register addressing
Indirect addressing
Immediate addressing
Dedicated-register addressing
Circular addressing
The details of each of these
addressing modes are considered next.
4.2.1 Direct Addressing
The data memory used with C5X
processors is split into 512 pages each of 128 words
memory page pointer (DP) in ST 0 holds the address of
the current data
long. The data
addressing mode of C5X, only lower-order 7 bits of the address are memory page. In the direct
9
upper bits are taken from the DP as
shown in specified in the instruction. The
Fig. 4.1.
DP(9) Instruction Register (16)
9 MSBs
15 7 LSBs
6
DP
Direct Memory Address
Fig. 4.1 16-bit data
memory address bus (DAB)
4.2.2
The RAM
Memory-Mapped Register Addressing
area in
page 0 is used for
These locations can be storing some of the
ARO can either be accessed by registers, interrupt vector addresses and
specifying the actual
denoted by the actual address or by the so on.
symbol ARO). Since these memory location (16h) used register name. (e.g., the
registers memory locations for storing its value or by the
correspondingto page 0 are
can be
referTed to as interchangeably
used with the
register names, the
memory-mapped registers (MMRs).
TMS320C5X Assembly Language Instructions
With memory-mapPed registCr addressing, the
MMRs can be modified
pointer
data page
also be modified. value.
In without 'affecting the cur-
rent addition, any scratch
Ihe pad RAM (DARAM B2) location
mode, except that the memory-mapped
data page0
or
9 MSBs of register addressing mode
the address are operates like the direct address
ents f the DP. This allows the forced to 0 instead of
being loaded with the
thout the overhead of changing the memory-mapped
DP registers of data page 0 to be
modified directiy
emory-mapped register auxiliary register. The following instructions
or
the DP:
addressing mode. Using these instructions does operate in
the
not affect the contents or
LAMM-Load accumulator with memory-mapped
LMMR-Load memory-mapped register register
SAMM-Store accumulator memory-mapped
in
ARO
2345 h ARO
6789 h
ARP
ARP
AR1 325 h
AR1 325 h
Data mem.
Data mem. 8345 h
8345 h
25h 25h
4.3
Fig. 4.4 Memory-mapped register addressing example
Example 4.4 Let thevalue of ARP, AR2 and INDX register be 2, 1250h and 2h,respectively,and
the content of the data memory location 1240h-1260hbe filled with the data 2345h.
Let SXM be 0. The value of ACC and AR2 after thefollowing sequence of LAC
load accumulator with shift) instructions are executed is shown in Fig 4
LACC *,0
LACC +, 1
LACC *, 2
LACC *0+, 4
LACC*0-,3
Instruction executed Contents after execution
Fig. 4.5 Contents of ACC and AR after execution of program in example 4.4
Example 4.5 Assume that the ARs are eight bits long, that ARZ represontsthebase address ofte
valué O0001000,
1000, When
When
memory (0110 0000,) and thatINDx contains the
Multiply Accunulate) instriction
MAC OFFÖOh, BRO 1s repeatedly
execufed eight times, the value ofAR2 is modificd as given in 1aple
Table 4.2 Bit-reversed addresses example 4.5
Value of AR2
Instruction executed
0110 0000 (Oth
value)
MAC OFF00h, "BRO+ AR2 =
(5th
0110 1010 value)
MAC OFFO0h, *BRO+; AR2 =
addressing.
Table 4.3 Instructions that support immediate addressin8
Short Immediate (1-word)
8-bit constant 9-bit constant 13-bit constant
ADD LDP MPY
ADRK
LACL
LAR
RPT
SBRK
SUB
Long immediate (2-word) 16-bit constant
ADD AND APL CPL
LACC LAR MPY OPL
OR RPT RPTZ
SPLK SUB XOR XPL
Example
4.6 ADD #OFFh
In this example, the lower 8 bits are the operand and are added to the ACC by the
CALU.
126.2 Long Immediate Addressing
Long immediate instructions, the operand is contained in the second word of a 2-word instruction.
IThere
n rare
e two
two long immediate addressing modes: one-operand instructions and two-operand instrc
tions.
4.26.3 long Imn. diate Addressing with Single/No Data Memory Access