Program Flow Control - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

15 Instruction Set Reference
Registers: reg
SB
PX
I0 – I7, M0 – M7, L0 – L7
CNTR
ASTAT, MSTAT, SSTAT
IMASK, ICNTL, IFC
TX0, TX1, RX0, RX1
Table 15.7 Processor Registers: reg & dreg
15.7
Program flow control on the ADSP-2100 family processors is simple but
powerful. Here is an example of one instruction:
IF EQ JUMP my_label;
JUMP, of course, is a familiar construct from many other languages. My_label
is any identifier you wish to use as a label for the destination jumped to.
Instead of the label, an index register in DAG2 may be explicitly used. The
default scope for any label is the source code module in which it is declared.
The assembler directive .ENTRY makes a label visible as an entry point for
routines outside the module. Conversely, the .EXTERNAL directive makes it
possible to use a label declared in another module.
If the counter condition (CE, NOT CE) is to be used, an assignment to CNTR
must be executed to initialize the counter value. JUMP and CALL permit the
additional conditionals "FLAG_IN" and "NOT FLAG_IN" to be used for
branching on the state of the FI pin, but only with direct addressing, not with
DAG2 as the address source.
RTS (return from subroutine) and RTI (return from interrupt) provide for
conditional return from CALL or interrupt vectors respectively.
The IDLE instruction provides a way to wait for interrupts. IDLE causes the
processor to wait in a low-power state until an interrupt occurs. When an
interrupt is serviced, control returns to the instruction following the IDLE
statement. IDLE uses less power than loops created with JUMP.
Table 15.8 gives a summary of all program flow control instructions. The
condition codes are described in Table 15.9.
15 –14
Data Registers: dreg
AX0, AX1, AY0, AY1, AR
MX0, MX1, MY0, MY1, MR0, MR1, MR2
SI, SE, SR0, SR1

PROGRAM FLOW CONTROL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents