Branch instructions allow the microprocessor to change the sequence of the program, either unconditionally or under certain conditions.
Branch instructions are classified into the following three categories.
- Jump instructions.
- Call and return instructions.
- Restart instructions.
Jump instructions are classified into two categories: Unconditional and conditional jump instructions.
Unconditional Jump Instructions
Unconditional jump instructions allow the programmer to set up continuous loops.
OPCODE | OPERAND | DESCRIPTION |
---|---|---|
JMP | 16-bit address | Jump to the specified location unconditionally. |
Conditional Jump Instructions
Conditional jump instructions allow the microprocessor to make decisions based on certain conditions indicated by various flags. They check the flag condition and decide to change or not change the sequence of the program.
The flags used by conditional jump instructions are:
- Carry flag.
- Zero flag.
- Sign flag.
- Parity flag.
The complete list of conditional jump instructions in 8085 is described in the following table.
Opcode | Operand | Description |
---|---|---|
JMP | 16-bit address | Jump to the specified location unconditionally. |
JC | 16-bit address | Jump On Carry (if result generates carry and CY = 1) |
JNC | 16-bit address | Jump On No Carry (CY = 0) |
JZ | 16-bit address | Jump On Zero (if result is zero and Z = 1) |
JNZ | 16-bit address | Jump On No Zero (Z = 0) |
JP | 16-bit address | Jump On Plus (if D7 = O, and S = 0) |
JM | 16-bit address | Jump On Minus (if D7 = 1, and S = 1) |
JPE | 16-bit address | Jump On Even Parity (P = 1) |
JPO | 16-bit address | Jump On Odd Parity (P = 0) |
Call and Return Instructions
The Call and Return instructions in 8085 are associated with the subroutine technique.
When the CALL instruction is executed, the 8085 stores the contents of the Program Counter on the top of the stack and transfers the program to the location of the subroutine. The Return instruction inserts the element from the top of the stack two the Program Counter.
These instructions are described in the following table.
Opcode | Operand | Description |
---|---|---|
CALL | 16-bit address | Jumps unconditionally to the memory location specified by the address. |
RET | Return to the calling program after completing the subroutine sequence. |
Restart Instruction
The Restart instruction in 8085 is associated with the interrupt technique. They are executed the same way as Call instruction.
Opcode | Operand | Description |
---|---|---|
RST | 0-7 | Reset the programming sequence. |