beautypg.com

Sbrz (short branch if zero) – Echelon Neuron User Manual

Page 129

background image

SBRZ (Short Branch If Zero)

The SBRZ instruction performs a conditional branch if TOS is zero. The SBRZ

instruction uses the (short) relative addressing mode. The SBRZ instruction

branches forward with an unsigned relative displacement of 1 to 16 bytes if TOS

is zero; otherwise, program operation continues with the next instruction. TOS is

consumed by this instruction. The displacement expression must resolve at link

time to a value in the range 0 to 15 (one less than the actual displacement

because the displacement calculation includes the size of the SBRZ operation

itself).
The Neuron Assembler also supports the use of a label for the displacement

expression; manual calculation of the displacement value is not required.
See also BRZ (Branch If Zero) for a longer conditional branch with the same

condition, and SBRNZ (Short Branch If Not Zero) for a short conditional branch

with the opposite condition.
The SBRZ instruction applies to Series 3100, 5000, and 6000 devices.

Syntax:
The SBRZ instruction requires a single operand to specify the displacement or

label:

SBRZ displacement

SBRZ label

Table 51 describes the attributes of the SBRZ instruction. In the table, the

asterisk (*) specifies the current value of the instruction pointer (IP).

Table 51. SBRZ Instruction

Instruction

Hexadecimal

Opcode

Instruction

Size (Bytes)

CPU Cycles

Required

Affect on

Carry Flag

SBRZ *+1

40

1

3

None

SBRZ *+2

41

1

3

None

SBRZ *+3

42

1

3

None

SBRZ *+4

43

1

3

None

SBRZ *+5

44

1

3

None

SBRZ *+6

45

1

3

None

SBRZ *+7

46

1

3

None

SBRZ *+8

47

1

3

None

SBRZ *+9

48

1

3

None

Neuron Assembly Language Reference

119