beautypg.com

Btjnz – Zilog Z8F0130 User Manual

Page 121

background image

eZ8

CPU Core

User Manual

UM012820-0810

BTJNZ Instruction

106

BTJNZ

Definition

Bit Test and Jump if Non-Zero.

Syntax

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

For this new eZ8 instruction, the selected bit in the source operand or reg-
ister pointed to by the source operand is compared 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. Multi-
ple bits cannot be tested simultaneously.

Table 22. 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