SlideShare a Scribd company logo
1 of 11
Subroutine
• A subroutine is a group of instructions that will be
used repeatedly in different locations of the
program.
– Rather than repeat the same instructions several
times, they can be grouped into a subroutine that is
called from the different locations.
• The 8085 has two instructions for dealing with
subroutines.
– The CALL instruction is used to redirect program
execution to the subroutine.
– The RET insutruction is used to return the execution to
the calling routine.
Stack of 8085
• It is the set of memory locations defined by
programmer in a main program.
• It is used to store the information during
execution of the program
• The stack is a LIFO structure.(Last In First Out.)
• The stack normally grows backwards into
Memory.
– In other words, the programmer defines the bottom
of the stack and the stack grows up intoreducing
address range.
Stack
• Given that the stack grows backwards into
memory, it is customary to place the bottom of
the stack at the end of memory to keep it as far
away from user programs as possible.
• In the 8085, the stack is defined by setting the
• SP (Stack Pointer) register.
– LXI SP, FFFFH
– This sets the Stack Pointer to location FFFFH (end of
memory for the 8085).
• The Size of the stack is limited only by the
available memory
Stack
• Information is saved on the stack by PUSHing
it on
• It is retrieved from the stack by POPing it off.
• The 8085 provides two instructions:
PUSH and POP for storing information on the
stack and retrieving it back.
– Both PUSH and POP work with register pairs
ONLY.
Push Instruction
POP Instruction
Example
Program 10: Add two 8-bit numbers
along with considering the carry.
Write a Program for traffic lights
The delay for green light and red is 1
min and for yellow it is 15 sec
draw the flow charts

More Related Content

What's hot

Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorRavi Anand
 
8085 Architecture
8085 Architecture8085 Architecture
8085 Architecturedeval patel
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085Sumit Swain
 
MP&AL presentation (8085 microprocessor architecture)
MP&AL presentation (8085 microprocessor architecture)MP&AL presentation (8085 microprocessor architecture)
MP&AL presentation (8085 microprocessor architecture)Ridhima Chowdhury
 
B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051MahiboobAliMulla
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessorApar Pramod
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessorATTO RATHORE
 
8085 paper-presentation-1232646931472979-2
8085 paper-presentation-1232646931472979-28085 paper-presentation-1232646931472979-2
8085 paper-presentation-1232646931472979-2manish singhal
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptxISMT College
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentationJiMs ChAcko
 

What's hot (20)

Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
8085 Architecture
8085 Architecture8085 Architecture
8085 Architecture
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
8085 architecture
8085 architecture8085 architecture
8085 architecture
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 
8085 Microprocessor
8085 Microprocessor8085 Microprocessor
8085 Microprocessor
 
8085 MICROPROCESSOR
8085 MICROPROCESSOR 8085 MICROPROCESSOR
8085 MICROPROCESSOR
 
MP&AL presentation (8085 microprocessor architecture)
MP&AL presentation (8085 microprocessor architecture)MP&AL presentation (8085 microprocessor architecture)
MP&AL presentation (8085 microprocessor architecture)
 
B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051
 
8085 microprocessor notes
8085 microprocessor notes8085 microprocessor notes
8085 microprocessor notes
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
Architecture of 8085
Architecture of  8085Architecture of  8085
Architecture of 8085
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
8085 Architecture
8085 Architecture8085 Architecture
8085 Architecture
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessor
 
Subroutine
SubroutineSubroutine
Subroutine
 
8085 paper-presentation-1232646931472979-2
8085 paper-presentation-1232646931472979-28085 paper-presentation-1232646931472979-2
8085 paper-presentation-1232646931472979-2
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptx
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentation
 

Viewers also liked

Microprocessor and Microcontroller lec2
Microprocessor and Microcontroller lec2Microprocessor and Microcontroller lec2
Microprocessor and Microcontroller lec2Ameen San
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introductionAmeen San
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arraysAmeen San
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scriptsAmeen San
 
Matlab ploting
Matlab plotingMatlab ploting
Matlab plotingAmeen San
 
Matlab complex numbers
Matlab complex numbersMatlab complex numbers
Matlab complex numbersAmeen San
 
Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Ramadan Ramadan
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor labkpaulraj
 
Matlab dc circuit analysis
Matlab dc circuit analysisMatlab dc circuit analysis
Matlab dc circuit analysisAmeen San
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fittingAmeen San
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1deval patel
 
Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1Ameen San
 
Difference between microprocessor and microcontroller
Difference between microprocessor and microcontrollerDifference between microprocessor and microcontroller
Difference between microprocessor and microcontrollerMicrocontrollers Lab
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Safin Biswas
 
Plc analog input output programming
Plc analog input output programmingPlc analog input output programming
Plc analog input output programmingEngr Alam
 
Plc analog Tutorial
Plc analog TutorialPlc analog Tutorial
Plc analog TutorialElectro 8
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutineAshim Saha
 

Viewers also liked (20)

Microprocessor and Microcontroller lec2
Microprocessor and Microcontroller lec2Microprocessor and Microcontroller lec2
Microprocessor and Microcontroller lec2
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Matlab m files and scripts
Matlab m files and scriptsMatlab m files and scripts
Matlab m files and scripts
 
Matlab ploting
Matlab plotingMatlab ploting
Matlab ploting
 
Matlab complex numbers
Matlab complex numbersMatlab complex numbers
Matlab complex numbers
 
Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)
 
Introto pl cs
Introto pl csIntroto pl cs
Introto pl cs
 
Microprocessor lab
Microprocessor labMicroprocessor lab
Microprocessor lab
 
Matlab dc circuit analysis
Matlab dc circuit analysisMatlab dc circuit analysis
Matlab dc circuit analysis
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fitting
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1
 
Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1Microprocessor and Microcontroller lec1
Microprocessor and Microcontroller lec1
 
Difference between microprocessor and microcontroller
Difference between microprocessor and microcontrollerDifference between microprocessor and microcontroller
Difference between microprocessor and microcontroller
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)
 
Plc analog input output programming
Plc analog input output programmingPlc analog input output programming
Plc analog input output programming
 
Plc analog Tutorial
Plc analog TutorialPlc analog Tutorial
Plc analog Tutorial
 
Interrupts of microprocessor 8085
Interrupts of microprocessor  8085Interrupts of microprocessor  8085
Interrupts of microprocessor 8085
 
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
MICROPROCESSOR & MICROCONTROLLER 8086,8051 NotesMICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
MICROPROCESSOR & MICROCONTROLLER 8086,8051 Notes
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 

Similar to Microprocessor and Microcontroller lec4

Similar to Microprocessor and Microcontroller lec4 (20)

Stacks & Subroutines.ppt.pptx
Stacks & Subroutines.ppt.pptxStacks & Subroutines.ppt.pptx
Stacks & Subroutines.ppt.pptx
 
Lec04
Lec04Lec04
Lec04
 
Lec04
Lec04Lec04
Lec04
 
Microprocessor Part 4
Microprocessor    Part 4Microprocessor    Part 4
Microprocessor Part 4
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 
8085-Programming-II-mod-1.pptx
8085-Programming-II-mod-1.pptx8085-Programming-II-mod-1.pptx
8085-Programming-II-mod-1.pptx
 
module-2.pptx
module-2.pptxmodule-2.pptx
module-2.pptx
 
B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)
 
8085
80858085
8085
 
Unit 4.pptx
Unit 4.pptxUnit 4.pptx
Unit 4.pptx
 
class-Stacks.pptx
class-Stacks.pptxclass-Stacks.pptx
class-Stacks.pptx
 
Microprocessors and microcontrollers short answer questions and answers
Microprocessors and microcontrollers short answer questions and answersMicroprocessors and microcontrollers short answer questions and answers
Microprocessors and microcontrollers short answer questions and answers
 
Topic 1
Topic 1Topic 1
Topic 1
 
Digital Electronics & Fundamental of Microprocessor-II
Digital Electronics & Fundamental of Microprocessor-IIDigital Electronics & Fundamental of Microprocessor-II
Digital Electronics & Fundamental of Microprocessor-II
 
MPMC UNIT-2.pdf
MPMC UNIT-2.pdfMPMC UNIT-2.pdf
MPMC UNIT-2.pdf
 
Unit 5
Unit 5Unit 5
Unit 5
 
20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes
 
Important questions
Important questionsImportant questions
Important questions
 
Micro overview
Micro overviewMicro overview
Micro overview
 
Computer Architecture - Program Execution
Computer Architecture - Program ExecutionComputer Architecture - Program Execution
Computer Architecture - Program Execution
 

More from Ameen San

Application of Capacitors to Distribution System and Voltage Regulation
Application of Capacitors to Distribution System and Voltage RegulationApplication of Capacitors to Distribution System and Voltage Regulation
Application of Capacitors to Distribution System and Voltage RegulationAmeen San
 
Distribution System Voltage Drop and Power Loss Calculation
Distribution System Voltage Drop and Power Loss CalculationDistribution System Voltage Drop and Power Loss Calculation
Distribution System Voltage Drop and Power Loss CalculationAmeen San
 
Load Characteristics
Load CharacteristicsLoad Characteristics
Load CharacteristicsAmeen San
 
ELECTRICAL DISTRIBUTION TECHNOLOGY
ELECTRICAL DISTRIBUTION TECHNOLOGYELECTRICAL DISTRIBUTION TECHNOLOGY
ELECTRICAL DISTRIBUTION TECHNOLOGYAmeen San
 
Stepper motor
Stepper motor Stepper motor
Stepper motor Ameen San
 
PLC application
PLC applicationPLC application
PLC applicationAmeen San
 
PLC arithmatic functions
PLC arithmatic functionsPLC arithmatic functions
PLC arithmatic functionsAmeen San
 
PLC data types and addressing
PLC data types and addressingPLC data types and addressing
PLC data types and addressingAmeen San
 
PLC Counters
PLC CountersPLC Counters
PLC CountersAmeen San
 
PLC Traffic Light Control
PLC Traffic Light ControlPLC Traffic Light Control
PLC Traffic Light ControlAmeen San
 
PLC Internal Relays
PLC Internal RelaysPLC Internal Relays
PLC Internal RelaysAmeen San
 
PLC Intro to programming
PLC Intro to programmingPLC Intro to programming
PLC Intro to programmingAmeen San
 
PLC Logic Circuits
PLC Logic CircuitsPLC Logic Circuits
PLC Logic CircuitsAmeen San
 
PLC input and output devices
PLC input and output devices PLC input and output devices
PLC input and output devices Ameen San
 
PLC Applications
PLC ApplicationsPLC Applications
PLC ApplicationsAmeen San
 
Protection Devices and the Lightning
Protection Devices and the LightningProtection Devices and the Lightning
Protection Devices and the LightningAmeen San
 
Circuit Breakers
Circuit BreakersCircuit Breakers
Circuit BreakersAmeen San
 

More from Ameen San (20)

Application of Capacitors to Distribution System and Voltage Regulation
Application of Capacitors to Distribution System and Voltage RegulationApplication of Capacitors to Distribution System and Voltage Regulation
Application of Capacitors to Distribution System and Voltage Regulation
 
Distribution System Voltage Drop and Power Loss Calculation
Distribution System Voltage Drop and Power Loss CalculationDistribution System Voltage Drop and Power Loss Calculation
Distribution System Voltage Drop and Power Loss Calculation
 
Load Characteristics
Load CharacteristicsLoad Characteristics
Load Characteristics
 
ELECTRICAL DISTRIBUTION TECHNOLOGY
ELECTRICAL DISTRIBUTION TECHNOLOGYELECTRICAL DISTRIBUTION TECHNOLOGY
ELECTRICAL DISTRIBUTION TECHNOLOGY
 
Stepper motor
Stepper motor Stepper motor
Stepper motor
 
PLC application
PLC applicationPLC application
PLC application
 
PLC arithmatic functions
PLC arithmatic functionsPLC arithmatic functions
PLC arithmatic functions
 
PLC data types and addressing
PLC data types and addressingPLC data types and addressing
PLC data types and addressing
 
PLC Counters
PLC CountersPLC Counters
PLC Counters
 
PLC Traffic Light Control
PLC Traffic Light ControlPLC Traffic Light Control
PLC Traffic Light Control
 
PLC Timers
PLC TimersPLC Timers
PLC Timers
 
PLC Internal Relays
PLC Internal RelaysPLC Internal Relays
PLC Internal Relays
 
PLC Intro to programming
PLC Intro to programmingPLC Intro to programming
PLC Intro to programming
 
PLC Logic Circuits
PLC Logic CircuitsPLC Logic Circuits
PLC Logic Circuits
 
PLC input and output devices
PLC input and output devices PLC input and output devices
PLC input and output devices
 
PLC Applications
PLC ApplicationsPLC Applications
PLC Applications
 
Protection Devices and the Lightning
Protection Devices and the LightningProtection Devices and the Lightning
Protection Devices and the Lightning
 
Protection
ProtectionProtection
Protection
 
Relays
RelaysRelays
Relays
 
Circuit Breakers
Circuit BreakersCircuit Breakers
Circuit Breakers
 

Recently uploaded

Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 

Microprocessor and Microcontroller lec4

  • 1. Subroutine • A subroutine is a group of instructions that will be used repeatedly in different locations of the program. – Rather than repeat the same instructions several times, they can be grouped into a subroutine that is called from the different locations. • The 8085 has two instructions for dealing with subroutines. – The CALL instruction is used to redirect program execution to the subroutine. – The RET insutruction is used to return the execution to the calling routine.
  • 2. Stack of 8085 • It is the set of memory locations defined by programmer in a main program. • It is used to store the information during execution of the program • The stack is a LIFO structure.(Last In First Out.) • The stack normally grows backwards into Memory. – In other words, the programmer defines the bottom of the stack and the stack grows up intoreducing address range.
  • 3. Stack • Given that the stack grows backwards into memory, it is customary to place the bottom of the stack at the end of memory to keep it as far away from user programs as possible. • In the 8085, the stack is defined by setting the • SP (Stack Pointer) register. – LXI SP, FFFFH – This sets the Stack Pointer to location FFFFH (end of memory for the 8085). • The Size of the stack is limited only by the available memory
  • 4. Stack • Information is saved on the stack by PUSHing it on • It is retrieved from the stack by POPing it off. • The 8085 provides two instructions: PUSH and POP for storing information on the stack and retrieving it back. – Both PUSH and POP work with register pairs ONLY.
  • 7.
  • 8. Example Program 10: Add two 8-bit numbers along with considering the carry.
  • 9.
  • 10.
  • 11. Write a Program for traffic lights The delay for green light and red is 1 min and for yellow it is 15 sec draw the flow charts