Scanbit - Intel i960 Jx Developer's Manual

Microprocessor
Table of Contents

Advertisement

6.2.56

scanbit

Mnemonic:
scanbit
Format:
scanbit
Description:
Searches src1 for a set bit (1 bit). When a set bit is found, the bit number of
the most significant set bit is stored in the dst and the condition code is set to
010
. When src value is zero, all 1's are stored in dst and condition code is set
2
to 000
dst = 0xFFFFFFFF;
Action:
AC.cc = 000
for(i = 31; i >= 0; i--)
{
if((src1 & 2**i) != 0)
{
}
}
Faults:
STANDARD
Example:
scanbit g8, g10
Opcode:
scanbit
See Also:
spanbit, setbit
Sets the condition code in the arithmetic controls.
Side Effects:
Scan For Bit
src1,
dst
reg/lit
reg
.
2
;
2
dst = i;
AC.cc = 010
;
2
break;
Refer to
# assume g8 is nonzero
# g10
# significant set bit in g8;
# AC.cc
641H
REG
INSTRUCTION SET REFERENCE
section 6.1.6, "Faults" (pg.
bit number of most-
010
.
2
6
6-5).
6-95

Advertisement

Table of Contents
loading

Table of Contents