SlideShare a Scribd company logo
2
Most read
4
Most read
8
Most read
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1
Instruction Set of 8085 microprocessor
a) Data Transfer Group
b) Arithmetic Group
c) Logical Group
d) Branching/Loop Group
e) Stack and Machine Control Group
Notation used in Instruction and opcode
Notations Meaning
M Memory location pointed by HL register pair
R 8-bit register
RP 16-bit register pair
RS Source register
RD Destination register
Addr 16-bit address
X 8-bit data
d)Branch Group
Microprocessor executes machine codes in sequential manner. If
microprocessor go to a different memory location it uses branching instructions.
Branch group instructions are classified in three categories:
1. Jump Instructions:
(i) JMP address (Unconditional Jump Instructions)
(ii) Conditional Jump Instructions
(iii) PCHL
2. Call and Return Instructions:
(i) CALL address
(ii) Conditional Call Instructions
(iii) RET
(iv) Conditional RET Instructions
3. Restart Instructions:
(i) RST N
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2
1. Jump Instructions:
(i) JMP address (Unconditional Jump Instructions)
Description - Unconditional jump to the address specified along with the
instruction.
Operation - Address -----> PC
No. of Bytes- 3
Flags - No flags are modified.
Example - JMP 2050 H
Before Execution After Execution
Address Instruction
2039 -
2041 -
2043 JMP 2050
2046 -
2048 -
2050 -
When JMP 2050 H instruction is executed, microprocessor will jump at address
2050 H and starts executing instruction from 2050 H onwards.
(ii) Conditional Jump Instructions
Description - Conditional jump instructions check the condition and then jump
if condition is true. If condition is false microprocessor continue the next
instruction after it.
 JC addr - Jump, if carry flag is set.
 JNC addr - Jump, if carry flag is not set (reset).
 JZ addr - Jump, if zero flag is set.
 JNZ addr - Jump, if zero flag is not set (reset).
 JP addr - Jump, if positive i.e. sign flag is reset.
 JM addr - Jump, if minus i.e. sign flag is set.
 JPE addr - Jump, if parity even i.e. parity flag is set.
 JPO addr - Jump, if parity odd i.e. parity flag is reset.
Address Instruction
2039 -
2041 -
2043 JMP 2050
2046 -
2048 -
2050 -
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3
Operation - If condition is true, address -----> PC
If condition is false, PC = PC + 3
No. of Bytes - 3
Flags - No flags are modified, only flags are checked.
Example - JC 2050 H
I. When condition is false.
Before Execution After Execution
When condition is false (carry flag is reset) program control is not transferred
to 2050 H instead it will execute the next instruction after JC 2050 H.
II. When condition is true.
Before Execution After Execution
When condition is true (carry flag is set) program control is transferred to 2050
H and it will execute the next instruction from 2050 H onwards.
Address Instruction
2039 -
2041 -
2043 JC 2050
2046 -
2048 -
2050 -
Address Instruction
2039 -
2041 -
2043 JC 2050
2046 -
2048 -
2050 -
Address Instruction
2039 -
2041 -
2043 JC 2050
2046 -
2048 -
2050 -
Address Instruction
2039 -
2041 -
2043 JC 2050
2046 -
2048 -
2050 -
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4
(iii) PCHL
Description - Load program counter with content of HL register pair.
Operation - HL -----> PC
No. of Bytes- 1
Flags - No flags are modified.
Example - PCHL
Before Execution After Execution
HL = 2040 H HL = 2040 H
PC = 3000 H PC = 2040 H
2. CALL and Return instructions:
(i) CALL Address (Unconditional CALL subroutine)
Description - When this instruction is executed the program sequence is
transferred to the address specified in the instruction. This instruction is used to
call a subroutine.
Operation - PCH -----> (SP-1),
PCL -----> (SP-2),
(SP-2) -----> SP
No. of Bytes- 3
Flags - No flags are modified.
Example - CALL 2050 H
Before Execution After Execution
SP = 27FF H SP -1 = 27FE H = 09H SP = 27FD H
PC = 2006 H SP -2 = 27FD H = 20H PC = 2050 H
Address Instruction
2000 -
2002 -
2004 -
2006 CALL 2050 H
2009 -
200B -
Address Instruction
2000 -
2002 -
2004 -
2006 CALL 2050 H
2009 -
200B -
Subroutine
2050H
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5
(ii) Conditional CALL Instructions
Description - Conditional call instructions check the condition and then jump if
condition is true. If condition is false microprocessor continue the next
instruction after it.
 CC addr - Call, if carry flag is set.
 CNC addr - Call, if carry flag is not set (reset).
 CZ addr - Call, if zero flag is set.
 CNZ addr - Call, if zero flag is not set (reset).
 CP addr - Call, if positive i.e. sign flag is reset.
 CM addr - Call, if minus i.e. sign flag is set.
 CPE addr - Call, if parity even i.e. parity flag is set.
 CPO addr - Call, if parity odd i.e. parity flag is reset.
Operation - If condition is true,
PCH -----> (SP-1),
PCL -----> (SP-2),
(SP-2) -----> SP, Address -----> PC
If condition is false,
PC = PC + 3
No. of Bytes - 3
Flags - No flags are modified, only flags are checked.
Example - CZ 2050 H
I. When condition is false.
Before Execution After Execution
II.
Address Instruction
2000 -
2002 -
2004 -
2006 CZ 2050 H
2009 -
200B -
Address Instruction
2000 -
2002 -
2004 -
2006 CZ 2050 H
2009 -
200B -
Subroutine
2050H
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6
SP = 27FF H SP = 27FF H
PC = 2006 H PC = 2009 H
When condition is false (zero flag is reset) program control is not transferred
to 2050 H instead it will execute the next instruction after CZ 2050 H.
II. When condition is true.
Before Execution After Execution
SP = 27FF H SP -1 = 27FE H = 09H SP = 27FD H
PC = 2006 H SP -2 = 27FD H = 20H PC = 2050 H
When condition is true (zero flag is set) program control is transferred to 2050
H and it will execute the next instruction from 2050 H onwards.
(iii) RET (Return from subroutine)
Description- When this instruction is executed the program sequence is
transferred from the subroutine to the calling program.
Main Program Subroutine
Address Instruction
2000 -
2002 -
2004 -
2006 CZ 2050 H
2009 -
200B -
Address Instruction
2000 -
2002 -
2004 -
2006 CZ 2050 H
2009 -
200B -
Subroutine
2050H
CALL SUBROUTINE
NEXT INSTRUCTUION
HLT
RET
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7
Operation - (SP)-----> PCL
(SP+1)-----> PCH,
(SP+2) -----> SP
No. of Bytes- 1
Flags - No flags are modified.
Example - RET
Before Execution After Execution
SP = 27FD H SP = 27FD H = 09H SP = 27FF H
PC = 2058 H SP+1 = 27FE H = 20H PC = 2009 H
SP+2 = 27FF H
When RET instruction is executed, it will take return address from stack
(27FD H & 27FE H) and load in program counter. So next instruction will be
from 2009 H.
(iv) Conditional RET Instructions (Return from subroutine)
Description- Conditional RET instructions check the condition and then jump if
condition is true. If condition is false microprocessor continue the next
instruction after it.
 RC - Return from subroutine, if carry flag is set.
 RNC - Return from subroutine, if carry flag is not set (reset).
 RZ - Return from subroutine, if zero flag is set.
 RNZ - Return from subroutine, if zero flag is not set (reset).
 RP - Return from subroutine, if positive i.e. sign flag is reset.
 RM - Return from subroutine, if minus i.e. sign flag is set.
Address Instruction
2000 -
2002 -
2004 -
2006 CALL 2050 H
2009 Next
Instruction
200B -
Address Instruction
2000 -
2002 -
2004 -
2006 CALL 2050 H
2009 Next
Instruction
200B -
Subroutine
2050H -----
2058H RET
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8
 RPE - Return from subroutine, if parity even i.e. parity flag is set.
 RPO - Return from subroutine, if parity odd i.e. parity flag is reset.
Operation - If condition is true,
SP -----> PCL,
(SP+1) -----> PCH,
(SP+2) -----> SP,
If condition is false,
PC = PC + 1
No. of Bytes - 1
Flags - No flags are modified, only flags are checked.
Example - RZ
When this instruction is executed microprocessor checks the zero
flag and if it is set then program sequence is transferred to the main
program otherwise program sequence continue the subroutine.
4. RST N (Restart instructions)
Description - This instructions are equivalent to 1 byte CALL instruction at
restart location. These instructions can be used as software interrupts in a
program to transfer program execution to one of the 8 locations depending on
which RST instruction is executed.
Instructions Restart Locations
RST 0 0000
RST 1 0008
RST 2 0010
RST 3 0018
RST 4 0020
RST 5 0028
RST 6 0030
RST 7 0038
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9
Operation PCH -----> (SP-1),
PCL -----> (SP-2),
(SP-2) -----> SP
Restart Address ----------> PC
No. of Bytes- 1
Flags - No flags are modified.
Example - RST 3
This instruction is equivalent to CALL 0018 H, the PC contents are
stored on to stack and program sequence is transferred to address
0018 H.

More Related Content

PPTX
Branching instructions in 8086 microprocessor
PDF
Introduction to html
PPTX
Code Conversion in 8085 Microprocessor
PDF
Data Communication and Networking
PPTX
Protocols
PPT
Text-Elements of multimedia
PPTX
Instruction sets of 8086
PPTX
Organizational Behaviour Presentation
Branching instructions in 8086 microprocessor
Introduction to html
Code Conversion in 8085 Microprocessor
Data Communication and Networking
Protocols
Text-Elements of multimedia
Instruction sets of 8086
Organizational Behaviour Presentation

What's hot (20)

PDF
8085 arithmetic instructions
PPTX
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
PPT
Logical instruction of 8085
PDF
8085 stack & machine control instruction
PPTX
Microprocessor 8086
PPTX
8085 DATA TRANSFER INSTRUCTIONS
PPTX
8251 USART
PPT
8251 universal synchronous asynchronous receiver transmitter
PPTX
Branch instructions in 8051 micrcocontroller
PDF
8085 instructions and addressing modes
PPT
1.ADDRESSING MODES OF 8086.ppt
PPTX
3.programmable interrupt controller 8259
PPT
Architecture of 8086 Microprocessor
PPT
Memory & I/O interfacing
PPTX
8086 microprocessor-architecture
PPTX
Addressing modes
PPTX
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
PPTX
Register Organisation of 8086 Microprocessor
PPTX
Computer organization and architecture
PPT
Instruction set-of-8085
8085 arithmetic instructions
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
Logical instruction of 8085
8085 stack & machine control instruction
Microprocessor 8086
8085 DATA TRANSFER INSTRUCTIONS
8251 USART
8251 universal synchronous asynchronous receiver transmitter
Branch instructions in 8051 micrcocontroller
8085 instructions and addressing modes
1.ADDRESSING MODES OF 8086.ppt
3.programmable interrupt controller 8259
Architecture of 8086 Microprocessor
Memory & I/O interfacing
8086 microprocessor-architecture
Addressing modes
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
Register Organisation of 8086 Microprocessor
Computer organization and architecture
Instruction set-of-8085
Ad

Similar to 8085 branching instruction (20)

PPT
branch ins 8051
PDF
Stack and subroutine
PDF
Microcontroladores: introducción a la programación en lenguaje ensamblador AVR
PPTX
B sc e 5.2 mp unit 2 soft ware(alp)
PPTX
9. 8085 instruction set v
PPT
Instruction set of 8051.ppt
PPTX
6.pptx
PPTX
Flag registers, addressing modes, instruction set
PPTX
UNit-4.pptx programming the basic computer
PPT
Microcontroller instruction set
PPT
PPT
3_JumpAndCall_v21_presenatationb also.ppt
PPT
1344 Alp Of 8086
PPTX
Computer Architecture and Organization- THE PROCESSOR DESIGN
DOC
Cataloge ge 3.control and_automation_dienhathe.com-4_20_vat300_e_c6-6-4_1_rev_b
DOC
Cataloge ge 3.control and_automation-20_vat300_e_c6-6-4_1_rev_b
PPT
microcontroller_instruction_set for ENGINEERING STUDENTS
PPT
instruction_set_8051_microcontroller.ppt
PPTX
EPC Module-5 ES.pptxModule-5 ES.pptxModule-5 ES.pptx
PDF
Instructions
branch ins 8051
Stack and subroutine
Microcontroladores: introducción a la programación en lenguaje ensamblador AVR
B sc e 5.2 mp unit 2 soft ware(alp)
9. 8085 instruction set v
Instruction set of 8051.ppt
6.pptx
Flag registers, addressing modes, instruction set
UNit-4.pptx programming the basic computer
Microcontroller instruction set
3_JumpAndCall_v21_presenatationb also.ppt
1344 Alp Of 8086
Computer Architecture and Organization- THE PROCESSOR DESIGN
Cataloge ge 3.control and_automation_dienhathe.com-4_20_vat300_e_c6-6-4_1_rev_b
Cataloge ge 3.control and_automation-20_vat300_e_c6-6-4_1_rev_b
microcontroller_instruction_set for ENGINEERING STUDENTS
instruction_set_8051_microcontroller.ppt
EPC Module-5 ES.pptxModule-5 ES.pptxModule-5 ES.pptx
Instructions
Ad

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Construction Project Organization Group 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
web development for engineering and engineering
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Well-logging-methods_new................
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT
Mechanical Engineering MATERIALS Selection
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Digital Logic Computer Design lecture notes
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
bas. eng. economics group 4 presentation 1.pptx
Geodesy 1.pptx...............................................
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
Construction Project Organization Group 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Automation-in-Manufacturing-Chapter-Introduction.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
web development for engineering and engineering
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Well-logging-methods_new................
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mechanical Engineering MATERIALS Selection
Model Code of Practice - Construction Work - 21102022 .pdf
Digital Logic Computer Design lecture notes
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT

8085 branching instruction

  • 1. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1 Instruction Set of 8085 microprocessor a) Data Transfer Group b) Arithmetic Group c) Logical Group d) Branching/Loop Group e) Stack and Machine Control Group Notation used in Instruction and opcode Notations Meaning M Memory location pointed by HL register pair R 8-bit register RP 16-bit register pair RS Source register RD Destination register Addr 16-bit address X 8-bit data d)Branch Group Microprocessor executes machine codes in sequential manner. If microprocessor go to a different memory location it uses branching instructions. Branch group instructions are classified in three categories: 1. Jump Instructions: (i) JMP address (Unconditional Jump Instructions) (ii) Conditional Jump Instructions (iii) PCHL 2. Call and Return Instructions: (i) CALL address (ii) Conditional Call Instructions (iii) RET (iv) Conditional RET Instructions 3. Restart Instructions: (i) RST N
  • 2. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2 1. Jump Instructions: (i) JMP address (Unconditional Jump Instructions) Description - Unconditional jump to the address specified along with the instruction. Operation - Address -----> PC No. of Bytes- 3 Flags - No flags are modified. Example - JMP 2050 H Before Execution After Execution Address Instruction 2039 - 2041 - 2043 JMP 2050 2046 - 2048 - 2050 - When JMP 2050 H instruction is executed, microprocessor will jump at address 2050 H and starts executing instruction from 2050 H onwards. (ii) Conditional Jump Instructions Description - Conditional jump instructions check the condition and then jump if condition is true. If condition is false microprocessor continue the next instruction after it.  JC addr - Jump, if carry flag is set.  JNC addr - Jump, if carry flag is not set (reset).  JZ addr - Jump, if zero flag is set.  JNZ addr - Jump, if zero flag is not set (reset).  JP addr - Jump, if positive i.e. sign flag is reset.  JM addr - Jump, if minus i.e. sign flag is set.  JPE addr - Jump, if parity even i.e. parity flag is set.  JPO addr - Jump, if parity odd i.e. parity flag is reset. Address Instruction 2039 - 2041 - 2043 JMP 2050 2046 - 2048 - 2050 -
  • 3. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3 Operation - If condition is true, address -----> PC If condition is false, PC = PC + 3 No. of Bytes - 3 Flags - No flags are modified, only flags are checked. Example - JC 2050 H I. When condition is false. Before Execution After Execution When condition is false (carry flag is reset) program control is not transferred to 2050 H instead it will execute the next instruction after JC 2050 H. II. When condition is true. Before Execution After Execution When condition is true (carry flag is set) program control is transferred to 2050 H and it will execute the next instruction from 2050 H onwards. Address Instruction 2039 - 2041 - 2043 JC 2050 2046 - 2048 - 2050 - Address Instruction 2039 - 2041 - 2043 JC 2050 2046 - 2048 - 2050 - Address Instruction 2039 - 2041 - 2043 JC 2050 2046 - 2048 - 2050 - Address Instruction 2039 - 2041 - 2043 JC 2050 2046 - 2048 - 2050 -
  • 4. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4 (iii) PCHL Description - Load program counter with content of HL register pair. Operation - HL -----> PC No. of Bytes- 1 Flags - No flags are modified. Example - PCHL Before Execution After Execution HL = 2040 H HL = 2040 H PC = 3000 H PC = 2040 H 2. CALL and Return instructions: (i) CALL Address (Unconditional CALL subroutine) Description - When this instruction is executed the program sequence is transferred to the address specified in the instruction. This instruction is used to call a subroutine. Operation - PCH -----> (SP-1), PCL -----> (SP-2), (SP-2) -----> SP No. of Bytes- 3 Flags - No flags are modified. Example - CALL 2050 H Before Execution After Execution SP = 27FF H SP -1 = 27FE H = 09H SP = 27FD H PC = 2006 H SP -2 = 27FD H = 20H PC = 2050 H Address Instruction 2000 - 2002 - 2004 - 2006 CALL 2050 H 2009 - 200B - Address Instruction 2000 - 2002 - 2004 - 2006 CALL 2050 H 2009 - 200B - Subroutine 2050H
  • 5. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5 (ii) Conditional CALL Instructions Description - Conditional call instructions check the condition and then jump if condition is true. If condition is false microprocessor continue the next instruction after it.  CC addr - Call, if carry flag is set.  CNC addr - Call, if carry flag is not set (reset).  CZ addr - Call, if zero flag is set.  CNZ addr - Call, if zero flag is not set (reset).  CP addr - Call, if positive i.e. sign flag is reset.  CM addr - Call, if minus i.e. sign flag is set.  CPE addr - Call, if parity even i.e. parity flag is set.  CPO addr - Call, if parity odd i.e. parity flag is reset. Operation - If condition is true, PCH -----> (SP-1), PCL -----> (SP-2), (SP-2) -----> SP, Address -----> PC If condition is false, PC = PC + 3 No. of Bytes - 3 Flags - No flags are modified, only flags are checked. Example - CZ 2050 H I. When condition is false. Before Execution After Execution II. Address Instruction 2000 - 2002 - 2004 - 2006 CZ 2050 H 2009 - 200B - Address Instruction 2000 - 2002 - 2004 - 2006 CZ 2050 H 2009 - 200B - Subroutine 2050H
  • 6. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6 SP = 27FF H SP = 27FF H PC = 2006 H PC = 2009 H When condition is false (zero flag is reset) program control is not transferred to 2050 H instead it will execute the next instruction after CZ 2050 H. II. When condition is true. Before Execution After Execution SP = 27FF H SP -1 = 27FE H = 09H SP = 27FD H PC = 2006 H SP -2 = 27FD H = 20H PC = 2050 H When condition is true (zero flag is set) program control is transferred to 2050 H and it will execute the next instruction from 2050 H onwards. (iii) RET (Return from subroutine) Description- When this instruction is executed the program sequence is transferred from the subroutine to the calling program. Main Program Subroutine Address Instruction 2000 - 2002 - 2004 - 2006 CZ 2050 H 2009 - 200B - Address Instruction 2000 - 2002 - 2004 - 2006 CZ 2050 H 2009 - 200B - Subroutine 2050H CALL SUBROUTINE NEXT INSTRUCTUION HLT RET
  • 7. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7 Operation - (SP)-----> PCL (SP+1)-----> PCH, (SP+2) -----> SP No. of Bytes- 1 Flags - No flags are modified. Example - RET Before Execution After Execution SP = 27FD H SP = 27FD H = 09H SP = 27FF H PC = 2058 H SP+1 = 27FE H = 20H PC = 2009 H SP+2 = 27FF H When RET instruction is executed, it will take return address from stack (27FD H & 27FE H) and load in program counter. So next instruction will be from 2009 H. (iv) Conditional RET Instructions (Return from subroutine) Description- Conditional RET instructions check the condition and then jump if condition is true. If condition is false microprocessor continue the next instruction after it.  RC - Return from subroutine, if carry flag is set.  RNC - Return from subroutine, if carry flag is not set (reset).  RZ - Return from subroutine, if zero flag is set.  RNZ - Return from subroutine, if zero flag is not set (reset).  RP - Return from subroutine, if positive i.e. sign flag is reset.  RM - Return from subroutine, if minus i.e. sign flag is set. Address Instruction 2000 - 2002 - 2004 - 2006 CALL 2050 H 2009 Next Instruction 200B - Address Instruction 2000 - 2002 - 2004 - 2006 CALL 2050 H 2009 Next Instruction 200B - Subroutine 2050H ----- 2058H RET
  • 8. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8  RPE - Return from subroutine, if parity even i.e. parity flag is set.  RPO - Return from subroutine, if parity odd i.e. parity flag is reset. Operation - If condition is true, SP -----> PCL, (SP+1) -----> PCH, (SP+2) -----> SP, If condition is false, PC = PC + 1 No. of Bytes - 1 Flags - No flags are modified, only flags are checked. Example - RZ When this instruction is executed microprocessor checks the zero flag and if it is set then program sequence is transferred to the main program otherwise program sequence continue the subroutine. 4. RST N (Restart instructions) Description - This instructions are equivalent to 1 byte CALL instruction at restart location. These instructions can be used as software interrupts in a program to transfer program execution to one of the 8 locations depending on which RST instruction is executed. Instructions Restart Locations RST 0 0000 RST 1 0008 RST 2 0010 RST 3 0018 RST 4 0020 RST 5 0028 RST 6 0030 RST 7 0038
  • 9. Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9 Operation PCH -----> (SP-1), PCL -----> (SP-2), (SP-2) -----> SP Restart Address ----------> PC No. of Bytes- 1 Flags - No flags are modified. Example - RST 3 This instruction is equivalent to CALL 0018 H, the PC contents are stored on to stack and program sequence is transferred to address 0018 H.