dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 586

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
REP
Operation:
LC → TEMP; #xx → LC
Repeat next instruction until LC = 1
TEMP → LC
LC → TEMP; S → LC
Repeat next instruction until LC = 1
TEMP → LC
Description: Repeat the single-word instruction that immediately follows the REP instruction for the specified num-
Note:
Note:
Restrictions:
A-242
ber of times. The value that specifies the number of times the given instruction is to be repeated is load-
ed into the 16-bit LC register. The contents of the 16-bit LC register are treated as unsigned (that is,
always positive). The single-word instruction is then executed for the specified number of times, dec-
rementing the LC after each execution until LC equals one. When the REP instruction is in effect, the
repeated instruction is fetched only one time, and it remains in the instruction register for the duration
of the loop count. Thus, the REP instruction is not interruptible. When the REP instruction is entered,
the contents of the LC register are stored in an internal temporary register, and they are restored into
the LC register when the REP loop is exited. If LC is set equal to zero, the instruction is not repeated
and execution continues with the instruction immediately following the instruction that was to be re-
peated. The instruction’s effective address specifies the address of the value that is to be loaded into
the LC.
The REP instruction allows all registers on the DSC core to specify the number of loop iterations ex-
cept for the registers C2, D2, C0, D0, C, D, Y, M01, N3, LA, LA2, LC, LC2, SR, OMR, and HWS. If
immediate short data is instead used to specify the loop count, the 6 LSBs of the LC register are loaded
from the instruction, and the upper 7 MSBs are cleared.
If a full accumulator is specified as a source operand, and if the data out of the accumulator indicates
that extension is in use, the value that is to be loaded into the LC register will be limited to a
16-bit-maximum, positive or negative saturation constant. If positive saturation occurs, the limiter
places $7FFF onto the bus. This value is loaded into the LC register as the maximum unsigned positive
loop count that is allowed. If negative saturation occurs, the limiter places $8000 onto the bus.
Once the REP instruction and the REP loop are in progress, they may not be interrupted until the REP
loop completes.
The REP instruction can repeat any single-word instruction—except the REP instruction itself and any
instruction that changes program flow. The following instructions are not allowed to follow a REP in-
struction:
Also, a REP instruction cannot be the last instruction in a DO loop (at the LA). The assembler will
generate an error if any of the preceding instructions are found immediately following a REP instruc-
tion.
An instruction that is more than 1 program word in length
An instruction that accesses program memory
A REP instruction
Any instruction that changes program flow
A SWI, SWI #x, SWILP, DEBUGEV, DEBUGHLT, WAIT, or STOP instruction
A Tcc, SWAP SHADOWS, or ALIGNSP instruction
DSP56800E Core Reference Manual
Repeat Next Instruction
REP
Assembler Syntax:
REP
#xx
S
Freescale Semiconductor
REP

Related parts for dsp56800e