Skip to content
Related Articles

Related Articles

Branching instructions in 8085 microprocessor
  • Difficulty Level : Easy
  • Last Updated : 29 Jul, 2020

Branching instructions refer to the act of switching execution to a different instruction sequence as a result of executing a branch instruction. 

The three types of branching instructions are: 
 

  1. Jump (unconditional and conditional) 
     
  2. Call (unconditional and conditional) 
     
  3. Return (unconditional and conditional) 
     

1. Jump Instructions – The jump instruction transfers the program sequence to the memory address given in the operand based on the specified flag. Jump instructions are 2 types: Unconditional Jump Instructions and Conditional Jump Instructions. 

(a) Unconditional Jump Instructions: Transfers the program sequence to the described memory address. 

 



OPCODEOPERANDEXPLANATIONEXAMPLE
JMPaddressJumps to the addressJMP 2050

(b) Conditional Jump Instructions: Transfers the program sequence to the described memory address only if the condition in satisfied. 

 

OPCODEOPERANDEXPLANATIONEXAMPLE
JCaddressJumps to the address if carry flag is 1JC 2050
JNCaddressJumps to the address if carry flag is 0JNC 2050
JZaddressJumps to the address if zero flag is 1JZ 2050
JNZaddressJumps to the address if zero flag is 0JNZ 2050
JPEaddressJumps to the address if parity flag is 1JPE 2050
JPOaddressJumps to the address if parity flag is 0JPO 2050
JMaddressJumps to the address if sign flag is 1JM 2050
JPaddressJumps to the address if sign flag 0JP 2050

2. Call Instructions – The call instruction transfers the program sequence to the memory address given in the operand. Before transferring, the address of the next instruction after CALL is pushed onto the stack. Call instructions are 2 types: Unconditional Call Instructions and Conditional Call Instructions. 

(a) Unconditional Call Instructions: It transfers the program sequence to the memory address given in the operand. 

 

OPCODEOPERANDEXPLANATIONEXAMPLE
CALLaddressUnconditionally callsCALL 2050

(b) Conditional Call Instructions: Only if the condition is satisfied, the instructions executes. 

 

OPCODEOPERANDEXPLANATIONEXAMPLE
CCaddressCall if carry flag is 1CC 2050
CNCaddressCall if carry flag is 0CNC 2050
CZaddressCalls if zero flag is 1CZ 2050
CNZaddressCalls if zero flag is 0CNZ 2050
CPEaddressCalls if parity flag is 1CPE 2050
CPOaddressCalls if parity flag is 0CPO 2050
CMaddressCalls if sign flag is 1CM 2050
CPaddressCalls if sign flag is 0CP 2050

3. Return Instructions – The return instruction transfers the program sequence from the subroutine to the calling program. Return instructions are 2 types: Unconditional Jump Instructions and Conditional Jump Instructions. 

(a) Unconditional Return Instruction: The program sequence is transferred unconditionally from the subroutine to the calling program. 

 

OPCODEOPERANDEXPLANATIONEXAMPLE
RETnoneReturn from the subroutine unconditionallyRET

(b) Conditional Return Instruction: The program sequence is transferred unconditionally from the subroutine to the calling program only is the condition is satisfied. 

 

OPCODEOPERANDEXPLANATIONEXAMPLE
RCnoneReturn from the subroutine if carry flag is 1RC
RNCnoneReturn from the subroutine if carry flag is 0RNC
RZnoneReturn from the subroutine if zero flag is 1RZ
RNZnoneReturn from the subroutine if zero flag is 0RNZ
RPEnoneReturn from the subroutine if parity flag is 1RPE
RPOnoneReturn from the subroutine if parity flag is 0RPO
RMnoneReturns from the subroutine if sign flag is 1RM
RPnoneReturns from the subroutine if sign flag is 0RP

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :