Texas Instruments TMS320C28x Reference Manual page 546

Dsp cpu and instruction set
Table of Contents

Advertisement

XPREAD loc16, *AL
SYNTAX OPTIONS
XPREAD loc16,*AL
Operands
loc16
*AL
Description
Flags and
N
Modes
Z
Repeat
Example
; Copy the contents of Array1 to Array2:
; int16 Array1[N];
; int16 Array2[N];
; for(i=0; i < N; i++)
;
Array2[i] = Array1[i];
MOV
MOVL
RPT
||XPREAD *XAR2++,*AL
0101 0110 0011 1100
0000 0000 LLLL LLLL
Addressing mode (see Chapter 5)
Indirect program-memory addressing using register AL,
can only access high 64K of program space range (0x3F0000 to 0x3FFFFF)
Load the 16-bit data-memory location pointed to by the "loc16" addressing
mode with the 16-bit content of the program-memory location pointed to by
"*AL" addressing mode:
[loc16] = Prog[0x3F:AL];
The C28x forces the upper 6 bits of the program memory address, specified
by the "*AL" addressing mode, to 0x3F when using this form of the XPREAD
instruction. This limits the program memory address to the high 64K of
program address space (0x3F0000 to 0x3FFFFF). On the C28x devices,
memory blocks are mapped to both program and data space (unified
memory), hence the "*AL" addressing mode can be used to access data
space variables that fall within its address range.
If (loc16 = @AX) and bit 15 of AX is 1, then N is set; otherwise N is cleared.
If (loc16 = @AX) and the value of AX is zero, then Z is set; otherwise Z is
cleared.
This instruction is repeatable. If the operation follows a RPT instruction, then
it will be executed N+1 times. When repeated, the "*AL" program-memory
address is copied to an internal shadow register and the address is
post-incremented by 1 during each repetition.
// Located in high 64K of program space
// Located in data space
@AL,#Array1
XAR2,#Array2
#(N−1)
C2xLP Source-Compatible Program Read
OPCODE
; AL
= pointer to Array1
; XAR2 = pointer to Array2
; Repeat next instruction N times
; Array2[i] = Array1[i],
; i++
XPREAD loc16, *AL
OBJMODE
RPT
CYC
1
Y
N+4
6-389

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C28x and is the answer not in the manual?

Table of Contents

Save PDF