EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #283 background imageLoading...
Page #283 background image
LOOPNZ loc16,#16bit
6-126
When any interrupt occurs, the current state of the LOOP bit is saved as ST1
is saved on the stack. The LOOP bit in ST1 is then cleared by the interrupt.
The LOOP bit is a passive status bit. The LOOPNZ instruction changes
LOOP, but LOOP does not affect the instruction.
You can abort the LOOPNZ instruction within an interrupt service routine.
Test the LOOP bit saved on the stack. If it is set, then increment (by 2) the
return address on the stack. Upon return from the interrupt, this incremented
address is loaded into the PC and the instruction following the LOOPNZ is
executed.
Flags and
Modes
N
If bit 15 of the result of the AND operation is 1, set N; otherwise, clear N.
Z
If the result of the AND operation is 0, set Z; otherwise, clear Z.
LOOP
LOOP is repeatedly set while the result of the AND operation is not 0. LOOP
is cleared when the result is 0. If an interrupt occurs before the LOOPNZ in-
struction enters the decode 2 phase of the pipeline, the instruction is flushed
from the pipeline and, thus, does not affect the LOOP bit.
Repeat This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Wait until bit 3 in RegA is cleared before writing to RegB:
LOOPNZ @RegA,#0x0004 ; Loop while (RegA AND 0x0004 != 0)
MOV @RegB,#0x8000 ; RegB = 0x8000

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals