Branch Instructions in 8085

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.

OPCODEOPERANDDESCRIPTION
JMP16-bit addressJump 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.

OpcodeOperandDescription
JMP16-bit addressJump to the specified location unconditionally.
JC16-bit addressJump On Carry (if result generates carry and CY = 1)
JNC16-bit addressJump On No Carry (CY = 0)
JZ16-bit addressJump On Zero (if result is zero and Z = 1)
JNZ16-bit addressJump On No Zero (Z = 0)
JP16-bit addressJump On Plus (if D7 = O, and S = 0)
JM16-bit addressJump On Minus (if D7 = 1, and S = 1)
JPE16-bit addressJump On Even Parity (P = 1)
JPO16-bit addressJump 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.

OpcodeOperandDescription
CALL16-bit addressJumps unconditionally to the memory location specified by the address.
RETReturn 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.

OpcodeOperandDescription
RST0-7Reset the programming sequence.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments