2.4.1 Direct Addressing Mode
There are four types of direct addressing modes: data-page pointer (DP) direct, stack
pointer (SP) direct, register-bit direct, and peripheral data-page pointer (PDP) direct.
The DP direct mode uses the main data page specified by the 23-bit extended data-
page pointer (XDP). Figure 2.10 shows a generation of DP direct address. The upper
seven bits of the XDP (DPH) determine the main data page (0±127). The lower 16 bits
of the XDP (DP) define the starting address in the data page selected by the DPH. The
instruction contains the seven-bit offset in the data page (@x) that directly points to the
variable x (Smem). The data-page registers DPH, DP, and XDP can be loaded by the
mov instruction as
mov #k7, DPH ; Load DPH with a 7-bit constant k7
mov #k16, DP ; Load DP with a 16-bit constant k16
These instructions initialize the data pointer DPH and DP, respectively, using the
assembly code syntax, mov #k,dst, given in Table 2.3. The first instruction loads
the high portion of the extended data-page pointer, DPH, with a 7-bit constant k7 to set
up the main data page. The second instruction initializes the starting address of the
data-page pointer. The following is an example that initializes the DPH and DP
pointers:
Example 2.1:
Instruction
mov #0x3, DPH
mov #0x0100, DP
DPH
0
DPH
03
DP
0000
DP
0100
Before instruction
After instruction
The data-page pointer also can be initialized using a 23-bit constant as
amov #k23, XDP ; Load XDP with a 23-bit constant
This instruction initializes the XDP in one instruction. The syntax used in the assembly
code is given in Table 2.3, amov #k23, xdst, where #k23 is a 23-bit address and the
destination xdst is an extended register. The following example initializes the data-
page pointer XDP to data page 1 with starting address 0x4000:
DP (16 bits)
@x (7 bits)
DPH (7 bits)
DP direct address (23 bits)
+
XDP
Figure 2.10 The DP direct addressing mode to variable x
52
INTRODUCTION TO TMS320C55X DIGITAL SIGNAL PROCESSOR