Analog Devices adsp-2100 Manual page 352

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

Advertisement

TEST BIT, SET BIT, CLEAR BIT, TOGGLE BIT
Syntax:
[ IF cond ]
Permissible xops
AX0
MR2
AX1
MR1
AR
MR0
SR1
SR0
Permissible n values (0=LSB)
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
Examples:
AF=TSTBIT 5 OF AR;
AR=TGLBIT 13 OF AX0;
Description:
Test the optional condition and if true, then perform the
specified bit operation. If the condition is not true then perform a no-
operation. Omitting the condition performs the operation unconditionally.
These operations cannot be used in multifunction instructions.
These operations are defined as follows:
TSTBIT is an AND operation with a 1 in the selected bit
SETBIT is an OR operation with a 1 in the selected bit
CLRBIT is an AND operation with a 0 in the selected bit
TGLBIT is an XOR operation with a 1 in the selected bit
The ASTAT status bits are affected by these instructions. The following
instructions could be used, for example, to test a bit and branch accordingly:
AF=TSTBIT 5 OF AR;
IF NE JUMP set;
set*/
Status Generated:
ASTAT:
7
6
SS MV AQ AS
(ADSP-217x, ADSP-218x, ADSP-21msp58/59 only)
AR
=
TSTBIT n OF xop
AF
SETBIT n OF xop
CLRBIT n OF xop
TGLBIT n OF xop
Permissible conds (see Table 15.9)
EQ
LE
AC
NE NEG
NOT AC
GT
POS
MV
GE
AV
NOT MV
LT
NOT AV
NOT CE
/*Jump to "set" if bit 5 of AR is
5
4
3
2
AC AV AN AZ
0
0
(instruction continues on next page)
;
1
0
*
*
ALU
15
15 – 29

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents