Fujitsu FR81 Computer Hardware User Manual


 
CM71-00105-1E FUJITSU MICROELECTRONICS LIMITED 375
FR81 Family
CHAPTER 7 DETAILED EXECUTION INSTRUCTIONS
7.147
7.147 SRCH1 (Search First One bit position distance From MSB)
This is a "1" search instruction used for bit searching. Takes a comparison of word
data in Ri from MSB (bit31) and "1", stores the distance in Ri from the first "1" that is
found and bit MSB(bit31).
Assembler Format
SRCH1 Ri
Operation
search_one(Ri) Ri
If "1" bit is not found (in case all word data of Ri is "0" bit), 32 is stored in Ri. In case MSB(bit31) is "1",
zero is stored in Ri and 31 is stored in Ri when LSB (bit0) is "1" and other bits are "0".
The Ri bit pattern before execution of instruction its relation with the values stored in Ri is shown in Table
7.147-1.
Table 7.147-1 Input bit pattern of SRCH1 instruction and its results
Flag Change
N, Z, V, C: Unchanged.
Input (Ri bit pattern before execution of the instruction) Results Remarks
00000000_00000000_00000000_00000000 32 Not found
1xxxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 0 MSB(bit31) was "0"
01xxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 1
001xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 2
0001xxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 3
. . .
00000000_00000000_00000000_00001xxx 28
00000000_00000000_00000000_000001xx 29
00000000_00000000_00000000_0000001x 30
00000000_00000000_00000000_00000001 31 Only LSB(bit0) was "0"
NZVC
----