UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
78
BTJNZ
Bit Test and Jump if Non-Zero
BTJNZ bit, src, DA
Operation
if src[bit] = 1 {
PC
←
PC + X
}
where the jump offset, X, is calculated by the eZ8 CPU assembler from the Program
Counter (PC) value and the Destination Address (DA).
Description
The selected bit in the source operand or register pointed to by the source operand is com-
pared with the a logical 1. If the selected bit is 1, the signed destination displacement (X)
is added to the Program Counter, that causes a jump. The displacement value can be from
-128 to +127. This instruction tests only a single bit position. Multiple bits cannot be
tested simultaneously.
Figure 21. BTJNZ Operand Description
Bit Position Tested
Operand[3:0]
Decimal Binary
Binary
Hexadecimal
0
000
1000
8
1
001
1001
9
2
010
1010
A
3
011
1011
B
4
100
1100
C
5
101
1101
D
6
110
1110
E
7
111
1111
F