Panasonic MN103001G/F01K User Manual page 83

Panax series microcomputer
Table of Contents

Advertisement

BSCH (Bit search instruction)
[Instruction Format (Macro Name)]
BSCH Dm, Dn
[Assembler Mnemonic]
udf07 Dm, Dn
[Operation]
Bit search is performed within the bit string of the 32 bits contained in Dm from the bit position of the bit number
indicated by the contents of Dn - 1 in the direction that the bit number becomes smaller. The bit number of the first
bit position where a "1" is found is written into Dn.
When the contents of the lower 5 bits of Dn are 0, bit search is performed from bit 31 in the direction that the bit
number becomes smaller.
If search is performed up to the bit position of bit 0 without finding a "1", the C flag is set, Dn is set to 0x00000000,
and instruction execution ends.
When instruction execution starts, the upper 27 bits of Dn are ignored.
Dn before execution
Bit 31
MSB
[Flag Changes]
When search was successful ("1" was found)
Flag
Change
V
*
C
0
N
*
Z
*
When search failed ("1" was not found)
Flag
Change
V
*
C
1
N
*
Z
*
[Programming Cautions]
PSW updating by flag changes is delayed by one instruction.
However, Bcc and Lcc instructions can evaluate flags without waiting for flag reflection to PSW.
The operations of "udf07 imm8, Dn", "udf07 imm16, Dn" and "udf07 imm32, Dn" are not assured. In addition, a
system error interrupt does not occur in these cases.
Search direction
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Search range
Undefined
This indicates that search was successful.
Undefined
Undefined
Undefined
This indicates that search failed.
Undefined
Undefined
Extension Instruction Specifications
Dn after execution
1
Condition
Condition
Bit 0
LSB
3-27

Advertisement

Table of Contents
loading

Table of Contents