Unit.
# 04
Branch instructions
By
Asst. Prof. Dr. Salim M. Wadi
Communication Techniques Engineering Department
Engineering Technical College-Najaf
AL-Furat AL-Awsat Technical University
Salim M. Wadi
[Link]@[Link]
Unit. # 03
Outlines of the lecture
1. Define the Branching operations that can be executed in 8085
microprocessor.
2. Explain the working of jumping instructions
3. Explain the working of Call and Return instructions.
Salim M. Wadi
[Link]@[Link] 1
Unit. # 04
1st Aim: Define the Branch instructions
Branch instructions used to change the sequence of program
execution.
These instructions classified into:
Jumping instructions.
Calling instructions.
Return instructions.
Salim M. Wadi
[Link]@[Link] 2
Unit. # 04
2nd Aim: Explain the jumping oprtaion.
Jumping operations
jumping operations classified into two types.
Un-conditional jumping.
Conditional jumping.
Salim M. Wadi
[Link]@[Link] 3
Unit. # 04
2nd Aim: Explain the jumping operation.
Jumping instructions
Un-conditional Jumping instruction
JMP 16-bit number
This instruction lead to loading the program counter with
operand
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
2nd Aim: Explain the jumping operation.
Jumping instructions
Conditional Jumping instructions
1- JC 16-bit number
This instruction lead to loading the program counter with
operand if the cy=1
2- JNC 16-bit number
This instruction lead to loading the program counter with
operand if the cy=0
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
2nd Aim: Explain the jumping operation.
Jumping instructions
Conditional Jumping instructions
3- JZ 16-bit number
This instruction lead to loading the program counter with
operand if the Z=1
4- JNZ 16-bit number
This instruction lead to loading the program counter with
operand if the Z=0
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
2nd Aim: Explain the jumping operation.
Jumping instructions
Conditional Jumping instructions
5- JPE 16-bit number
This instruction lead to loading the program counter with
operand if the P=1
6- JPO 16-bit number
This instruction lead to loading the program counter with
operand if the P=0
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
2nd Aim: Explain the jumping operation.
Jumping instructions
Conditional Jumping instructions
7- JM 16-bit number
This instruction lead to loading the program counter with
operand if the S=1
8- JP 16-bit number
This instruction lead to loading the program counter with
operand if the S=0
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
calling and return operations
Calling and return instructions classified into two types.
Un-conditional Calling and return .
Conditional Calling and return .
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Calling Instructions
Un-conditional calling instruction
CALL 16-bit number
This instruction lead to loading the program counter with
operand with another operations will be explained in stack and
subroutine unit.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Calling Instructions
Conditional calling instruction
CC 16-bit number
This instruction lead to loading the program counter with
operand if CY=1.
CNC 16-bit number
This instruction lead to loading the program counter with
operand if CY=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Calling Instructions
Conditional calling instruction
CPE 16-bit number
This instruction lead to loading the program counter with
operand if P=1.
CPO 16-bit number
This instruction lead to loading the program counter with
operand if P=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Calling Instructions
Conditional calling instruction
CNZ 16-bit number
This instruction lead to loading the program counter with
operand if Z=0.
CZ 16-bit number
This instruction lead to loading the program counter with
operand if Z=1.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Calling Instructions
Conditional calling instruction
CM 16-bit number
This instruction lead to loading the program counter with
operand if S=1.
CP 16-bit number
This instruction lead to loading the program counter with
operand if S=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Return Instructions
Un-conditional Return instruction
RET 16-bit number
This instruction lead to loading the program counter with
operand with another operations will be explained in stack and
subroutine unit.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Return Instructions
Conditional Return instruction
RC 16-bit number
This instruction lead to loading the program counter with
operand if CY=1.
RNC 16-bit number
This instruction lead to loading the program counter with
operand if CY=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Return Instructions
Conditional Return instruction
RPE 16-bit number
This instruction lead to loading the program counter with
operand if P=1.
RPO 16-bit number
This instruction lead to loading the program counter with
operand if P=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Return Instructions
Conditional Return instruction
RZ 16-bit number
This instruction lead to loading the program counter with
operand if Z=1.
RNZ 16-bit number
This instruction lead to loading the program counter with
operand if Z=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 04
3rd Aim: Explain the calling and return operations.
Return Instructions
Conditional Return instruction
RM 16-bit number
This instruction lead to loading the program counter with
operand if S=1.
RP 16-bit number
This instruction lead to loading the program counter with
operand if S=0.
Salim M. Wadi
[Link]@[Link] 4
Unit. # 03
Ex/ Write the content of accumulator after execute the
following program:
LXI H,2000
MVI M, 47
A1: MVI A, AF
ADD M
JNC A1
ANA M
HLT
Salim M. Wadi
[Link]@[Link]
Unit. # 03
H.W.
Q1/ What is the difference between Jumping and
Calling instructions.
Q2/ How many times executing of each instruction
in program below:
MVI A, A0
ORA A
A1: INR A
JNC A1
HLT
Salim M. Wadi
[Link]@[Link]
Unit. # 03
Thank you for listening
Salim M. Wadi
[Link]@[Link] 20