jcnd (bcnd)


Conditional branch.

[Syntax]

-

jcnd disp22

 

The following can be specified for disp22:

-

Absolute expression having a value of up to 22 bits

-

Relative expression having a PC offset reference of label

[Function]

Compares the flag condition indicated by string cnd (see "Table 5.37 jcnd Instruction List") with the current flag condition. If they are found to be the same, transfers control to the address obtained by adding the value of the absolute expression or relative expression specified by the operand to the current value of the program counter (PC)Note.

Note

For a jcnd instruction other than jbr, the mnemonic "bcnd" can be used, and the "br" machine-language instruction can be used for the jbr instruction (there is no functional difference).

Table 5.37

jcnd Instruction List

Instruction

Flag Condition

Meaning of Flag Condition

jgt

( (S xor OV) or Z) = 0

Greater than (signed)

jge

(S xor OV) = 0

Greater than or equal (signed)

jlt

(S xor OV) = 1

Less than (signed)

jle

( (S xor OV) or Z) = 1

Less than or equal (signed)

jh

(CY or Z) = 0

Higher (Greater than)

jnl

CY = 0

Not lower (Greater than or equal)

jl

CY = 1

Lower (Less than)

jnh

(CY or Z) = 1

Not higher (Less than or equal)

je

Z = 1

Equal

jne

Z = 0

Not equal

jv

OV = 1

Overflow

jnv

OV = 0

No overflow

jn

S = 1

Negative

jp

S = 0

Positive

jc

CY = 1

Carry

jnc

CY = 0

No carry

jz

Z = 1

Zero

jnz

Z = 0

Not zero

jbr

---

Always (Unconditional)

jsa

SAT = 1

Saturated

[Description]

-

If the following is specified for disp22, the assembler generates one bcond machine instructionNote.

(a)

Absolute expression having a value in the range of -256 to +255

(b)

Relative expression having a PC offset reference for a label with a definition in the same section and the same file as this instruction and having a value in the range of -256 to +255

jcnd    disp9
bcnd    disp9

Note

The bcnd machine instruction takes an immediate value in the range of -256 to +255 (0xFFFFFF00 to 0xFF) as the displacement.

-

If the following is specified for disp22, the assembler executes instruction expansion and generates one or more machine-language instructions.

(a)

Absolute expression having a value exceeding the range of -256 to +255 but within the range of -65,536 to +65,535 or a relative expression having a PC offset reference of label with a definition in the same section of the same file as this instruction and having a value exceeding the range of -256 to +255 but within the range of -65,536 to +65,535

jbr      disp17
jr      disp17
jcond    disp17
bcnd    disp17

(b)

Absolute expression having a value exceeding the range of -65,536 to +65,535 but within the range of -2,097,150 to +2,097,153Note 1, a relative expression having a PC offset reference of label with a definition in the same section of the same file as this instruction and having a value exceeding the range of -65536 to +65535, or a relative expression having a PC offset reference of label without a definition in the same file or section as this instruction.

jbr     disp22
jr      disp22
jsa     disp22
    bsa     Label1
    br      Label2
Label1:
    jr      disp22 - 4
Label2:
jcond    disp22
    bncond   LabelNote 2
    jr      disp22 - 2
Label:

Note 1.

The range of -2,097,150 to +2,097,153 applies to instructions other than jbr and jsa. The range for the jbr instruction is from -2,097,152 to +2,097,151, and that for the jsa instruction is from -2,097,148 to +2,097,155.

Note 2.

bncond denotes an instruction that effects control of branches under opposite conditions, for example, bnz for bz or ble for bgt.

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

If an absolute expression having a value exceeding the range of -2,097,150 to +2,097,153 is specified as disp22, the assembler outputs the following message and stops assembling.

E0550230 : illegal operand (range error in displacement)

-

If an absolute expression having an odd-numbered value is specified as disp22, the assembler outputs the following message and stops assembling.

E0550226 : illegal operand (must be even displacement)

-

To generate a bcnd machine instruction with 17-bit absolute expression as disp22, use the jcnd17 instruction instead.