These instructions are used to transfer/branch the instructions during an execution. There are two types of branching instructions. The unconditional branch and conditional branch.
The Unconditional Program execution transfer instructions are as follows.
Opcode | Operand | Description |
---|---|---|
CALL | address | Used to call a procedure and save their return address to the stack. |
RET | ---- | Used to return from the procedure to the main program. |
JMP | address | Used to jump to the provided address to proceed to the next instruction. |
LOOP | address | Used to loop a group of instructions until the condition satisfies, i.e., CX = 0 |
Now let us see the Conditional Program execution transfer instructions.
Opcode | Operand | Description |
---|---|---|
JC | address | Used to jump if carry flag CY = 1 |
JNC | address | Used to jump if no carry flag (CY = 0) |
JE/JZ | address | Used to jump if equal/zero flag ZF = 1 |
JNE/JNZ | address | Used to jump if not equal/zero flag ZF = 0 |
JO | address | Used to jump if overflow flag OF = 1 |
JNO | address | Used to jump if no overflow flag OF = 0 |
JP/ JPE | address | Used to jump if parity/parity even PF = 1 |
JNP/ JPO | address | Used to jump if not parity/parity odd PF = 0 |
JS | address | Used to jump if sign flag SF = 1 |
JNS | address | Used to jump if not sign SF = 0 |
JA/ JNBE | address | Used to jump if above/not below/equal instruction satisfies. |
JAE/ JNB | address | Used to jump if above/not below instruction satisfies. |
JBE/ JNA | address | Used to jump if below/equal/ not above instruction satisfies. |
JG/ JNLE | address | Used to jump if greater/not less than/equal instruction satisfies. |
JGE/ JNL | address | Used to jump if greater than/equal/not less than instruction satisfies. |
JL/ JNGE | address | Used to jump if less than/not greater than/equal instruction satisfies. |
JLE/ JNG | address | Used to jump if less than/equal/if not greater than instruction satisfies. |
JCXZ | address | Used to jump to the provided address if CX = 0 |
LOOPE/ LOOPZ | address | Used to loop a group of instructions till it satisfies ZF = 1 & CX = 0 |
LOOPNE/ LOOPNZ | address | Used to loop a group of instructions till it satisfies ZF = 0 & CX = 0 |