dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 204

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Address Generation Unit
6.5.1
Word pointers can be used to access bytes in memory with the MOVE.B and MOVEU.B instructions.
Because word pointers typically select an entire 16-bit word at once, the particular byte to access within
the word is determined by the offset that is specified in the instruction. Even offset values (or an offset of
zero) select the lower byte in a word, while odd offsets select the upper byte.
Example 6-1 demonstrates accessing byte values in memory using the MOVE.B instruction. Note that,
even though word pointers are being used, the offset values are all specified in bytes.
; Load the R0, SP Address Pointers
; MOVE.B -- R0 used as a word pointer, offset is a byte offset
; MOVE.B -- SP always used as a word pointer, offset is a byte offset
6.5.2
Long words are always accessed with word pointers. When a long-word value is read or written to
memory, two adjacent 16-bit word values are accessed: the word specified in the pointer, and the word that
immediately follows in memory. (An exception is when the SP register is used to access long-word values;
see Section 3.5.3, “Accessing Long-Word Values Using Word Pointers,” on page 3-19 for more
information.)
Example 6-2 on page 6-11 demonstrates several long-word accesses. Note the arithmetic performed by the
AGU in calculating the long-word address, specifically the use of the N offset register.
6-10
Accessing Bytes
Accessing Long Words
MOVEU.W
MOVEU.W
MOVE.B
MOVE.B
MOVE.B
MOVE.B
MOVE.B
MOVE.B
MOVE.B
MOVE.B
MOVE.B
MOVE.B
Example 6-1. Accessing Bytes with the MOVE.B Instruction
#$2000,R0
#$4000,SP
x:(r0+0),x0
x:(r0+1),x0
x:(r0+2),x0
x:(r0+3),x0
x:(r0+4),x0
x:(sp),x0
x:(sp-1),x0
x:(sp-2),x0
x:(sp-3),x0
x:(sp-4),x0
DSP56800E Core Reference Manual
; load R0 pointer with the value $2000
; (can be either a byte or word pointer)
; load the stack pointer (SP) with $4000
; (SP must always be a word pointer)
; word address = $2000, selects lower byte
; word address = $2000, selects upper byte
; word address = $2001, selects lower byte
; word address = $2001, selects upper byte
; word address = $2002, selects lower byte
; word address = $4000, selects lower byte
; word address = $3fff, selects upper byte
; word address = $3fff, selects lower byte
; word address = $3ffe, selects upper byte
; word address = $3ffe, selects lower byte
Freescale Semiconductor

Related parts for dsp56800e