Fujitsu FR81 Computer Hardware User Manual


 
CM71-00105-1E FUJITSU MICROELECTRONICS LIMITED 373
FR81 Family
CHAPTER 7 DETAILED EXECUTION INSTRUCTIONS
7.146
7.146 SRCH0 (Search First Zero bit position distance From MSB)
This is a "0" search instruction used for bit searching. Takes a comparison of word
data in Ri from MSB (bit31) and "0", stores the distance in Ri from the first "0" that is
found and bit MSB (bit31).
Assembler Format
SRCH0 Ri
Operation
search_zero(Ri) Ri
If "0" bit is not found (in case all word data of Ri is "1" bit), 32 is stored in Ri. In case MSB(bit31) is "0",
zero is stored in Ri and 31 is stored in Ri when LSB (bit0) is "0" and other bits are "1".
The Ri bit pattern before execution of instruction its relation with the values stored in Ri is shown in Table
7.146-1.
Table 7.146-1 Input pattern of SRCH0 instruction and its results
Flag Change
N, Z, V, C: Unchanged.
Input (Ri bit pattern before execution of instruction) Result Remarks
11111111_11111111_11111111_11111111 32 Not found
0xxxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 0 MSB(bit31) was "1"
10xxxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 1
110xxxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 2
1110xxxx_xxxxxxxx_xxxxxxxx_xxxxxxxx 3
. . .
11111111_11111111_11111111_11110xxx 28
11111111_11111111_11111111_111110xx 29
11111111_11111111_11111111_1111110x 30
11111111_11111111_11111111_11111110 31 Only LSB(bit0) was "0"
NZVC
----