
ADSP-21xx
–16–
REV. B
Program Flow Instructions
DO <addr> [UNTIL term] ;
Do Until Loop
[IF cond] JUMP (Ix) ;
Jump
[IF cond] JUMP <addr>;
[IF cond] CALL (Ix) ;
Call Subroutine
[IF cond] CALL <addr>;
IF [NOT ] FLAG_IN
JUMP <addr>;
Jump/Call on Flag In Pin
IF [NOT ] FLAG_IN
CALL <addr>;
[IF cond] SET|RESET|TOGGLE
FLAG_OUT [, ...] ;
Modify Flag Out Pin
[IF cond] RTS ;
Return from Subroutine
[IF cond] RTI ;
Return from Interrupt Service Routine
IDLE [(n)] ;
Idle
Miscellaneous Instructions
NOP ;
No Operation
MODIFY (Ix , My);
Modify Address Register
[PUSH STS] [, POP CNTR] [, POP PC] [, POP LOOP] ;
Stack Control
ENA|DIS
SEC_REG [, ...] ;
Mode Control
BIT_REV
AV_LATCH
AR_SAT
M_MODE
TIMER
G_MODE
Assembly Code Example
The following example is a code fragment that performs the filter tap update for an adaptive filter based on a least-mean-squared
algorithm. Notice that the computations in the instructions are written like algebraic equations.
MF=MX0* MY1 ( RND), MX0=DM(I2,M1);
{ MF=error * beta}
MR=MX0* MF ( RND), AY0=PM(I6,M5);
DO adapt UNTIL CE;
AR=MR1+AY0, MX0=DM(I2,M1), AY0=PM(I6,M7);
adapt:
PM(I6,M6)= A R, MR=MX0 * MF ( RND);
MODIFY(I2,M3);
{Point to oldest data}
MODIFY(I6,M7);
{Point to start of data}
Notation Conventions
Ix
Index registers for indirect addressing
My
Modify registers for indirect addressing
<data>
Immediate data value
<addr>
Immediate address value
<exp>
Exponent (shift value) in shift immediate instructions (8-bit signed number)
<ALU>
Any ALU instruction (except divide)
<MAC>
Any multiply-accumulate instruction
<SHIFT>
Any shift instruction (except shift immediate)
cond
Condition code for conditional instruction
term
Termination code for DO UNTIL loop
dreg
Data register (of ALU, MAC, or Shifter)
reg
Any register (including dregs)
;
A semicolon terminates the instruction
,
Commas separate multiple operations of a single instruction
[
]
Optional part of instruction
[, ...]
Optional, multiple operations of an instruction
option1 | option2
List of options; choose one.