UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
75
BTJ
Bit Test and Jump
BTJ p, bit, src, DA
Operation
if src[bit] = p {
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 p flag bit. If the bit in the source is equal to the polarity p, the signed dis-
placement (X) is added to the Program Counter, which 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 20. BTJ Operand Description
Polarity Bit (p)
Bit Position Tested
Operand[3:0]
Decimal Binary
Binary
Hexadecimal
0
0
000
0000
0
0
1
001
0001
1
0
2
010
0010
2
0
3
011
0011
3
0
4
100
0100
4
0
5
101
0101
5
0
6
110
0110
6
0
7
111
0111
7
1
0
000
1000
8
1
1
001
1001
9
1
2
010
1010
A
1
3
011
1011
B
1
4
100
1100
C
1
5
101
1101
D
1
6
110
1110
E
1
7
111
1111
F