dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 71

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Note that, if the stack pointer addressing mode is used, each long value must still be aligned on an even
word address boundary even though the effective address that is used to access the value is odd.
3.5.4
The MOVE.B and MOVEU.B instructions are useful for accessing structures or unions containing bytes as
well as for accessing bytes in a stack frame. These instructions use the address registers (R0–R5, N, SP) as
word pointers and use an offset value to select the upper or lower byte.
Figure 3-13 shows an example of a byte access using a word pointer. The example executes the
MOVE.B A1,X:(R0+3)
immediate offset after the offset has been arithmetically right shifted 1 bit to give the correct word address:
(3>>1) + $1000 = $1001. The least significant bit (LSB) of the immediate offset selects which byte at the
word address is accessed. In this example, the LSB of the immediate offset (3) is set, so the upper byte of
the memory word is accessed. The lowest 8 bits of the A1 register, $CD, are then written to this location.
The lower byte of the memory location $1001 is not modified.
3.5.5
Byte pointers are useful for accessing byte variables or arrays of bytes. Instructions that use addresses as
byte pointers include the MOVE.BP and MOVEU.BP instructions as well as data ALU instructions that
access byte operands from data memory using the “.BP” suffix, such as
When a byte pointer is used, the value in the selected address register is a byte address. The byte address is
specified using the following:
Freescale Semiconductor
The contents of a register:
The result of an AGU calculation:
Accessing Byte Values Using Word Pointers
Accessing Byte Values Using Byte Pointers
instruction. In this case, the address contained in R0, $1000, is added to an
Figure 3-13. Accessing a Byte with a Word Pointer
LSB of Offset
Address
Word
Short Immediate Value “3”
from the Instruction Word
$001001
$001000
Data Types and Addressing Modes
MOVE.BP X:(R2),A
Instruction:
Access Size: Byte
Byte Selected: Upper
15
MOVE.BP X:(R1+$A701),A
C
X Memory
MOVE.B A1,X:(R0+3)
D
X
R0
X
>>1
0
Word Address: $1001
Byte Select: 1 (Upper)
$001000
+
ADD.BP X:$2001,A
Memory Access and Pointers
Byte address: $2003
.
3-21

Related parts for dsp56800e