Program Sequencing
3.3
CONDITIONAL INSTRUCTION EXECUTION
The program sequencer evaluates conditions to determine whether to
execute a conditional instruction and when to terminate a loop. The
conditions are based on information from the arithmetic status (ASTAT)
register, mode control 1 (MODE1) register, flag inputs and loop counter.
The arithmetic ASTAT bits are described in the previous chapter,
Computation Units.
Each condition that the ADSP-2106x evaluates has an assembler
mnemonic and a unique code which is used in a conditional instruction's
opcode. For most conditions, the program sequencer can test both true
and false states, e.g., equal to zero and not equal to zero. Table 3.2, on the
following page, defines the 32 condition and termination codes.
The bit test flag (BTF) is bit 18 of the ASTAT register. This flag is set (or
cleared) by the results of the BIT TST and BIT XOR forms of the
System Register Bit Manipulation instruction, which can be used to test the
contents of the ADSP-2106x's system registers. This instruction is
described in Appendix A, Group IV–Miscellaneous instructions. After BTF
is set by this instruction, it can be used as the condition in a conditional
instruction (with the mnemonic TF; see Table 3.2).
The two conditions that do not have complements are LCE/NOT LCE
(loop counter expired/not expired) and TRUE/FOREVER. The
interpretation of these condition codes is determined by context; TRUE
and NOT LCE are used in conditional instructions, FOREVER and LCE in
loop termination. The IF TRUE construct creates an unconditional
instruction (the same effect as leaving out the condition entirely). A DO
FOREVER instruction executes a loop indefinitely, until an interrupt or
reset intervenes.
The LCE condition (loop counter expired) is most commonly used in a
DO UNTIL instruction. Because the LCE condition checks the value of the
loop counter (CURLCNTR), an IF NOT LCE conditional instruction
should not follow a write to CURLCNTR from memory. Otherwise,
because the write occurs after the NOT LCE test, the condition is based on
the old CURLCNTR value.
The bus master condition (BM) indicates whether the ADSP-2106x is the
current bus master in a multiprocessor system. To enable the use of this
condition, bits 17 and 18 of the MODE1 register must both be zeros;
otherwise the condition is always evaluated as false.
www.BDTIC.com/ADI
3
3 – 7
Need help?
Do you have a question about the ADSP-2106x SHARC and is the answer not in the manual?