0% found this document useful (0 votes)
33 views18 pages

8085: Subroutine - Stack (Part 1)

This document discusses the stack and subroutine instructions for the 8085 microprocessor. It explains the concept of a stack as a LIFO structure used for temporary storage. It details the PUSH and POP instructions for storing and retrieving data from the stack and how the CALL and RET instructions are used to call and return from subroutines by manipulating the stack pointer.

Uploaded by

Vishal Gaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views18 pages

8085: Subroutine - Stack (Part 1)

This document discusses the stack and subroutine instructions for the 8085 microprocessor. It explains the concept of a stack as a LIFO structure used for temporary storage. It details the PUSH and POP instructions for storing and retrieving data from the stack and how the CALL and RET instructions are used to call and return from subroutines by manipulating the stack pointer.

Uploaded by

Vishal Gaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

EE-16102: MICROPROCESSOR & COMP UTER ORGANIZATION

8085 Microprocessor: Subroutine Instructions-Stack


Dr. Vishal Kumar Gaur
Microprocessor: 8085A
Subroutine Instruction-Stack

Concept of Stack
 Function of stack to store and retrieve the data quickly from internal RAM.

 The stack is an area of memory identified by the programmer for temporary storage of
information.
 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 into reducing address range.

2
Microprocessor: 8085A
Subroutine Instruction-Stack

Concept of 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

3
Microprocessor: 8085A
Subroutine Instruction-Stack

Concept of 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.

4
Microprocessor: 8085A
Subroutine Instruction-Stack
Operation of Stack

5
Microprocessor: 8085A
Subroutine Instruction-Stack

6
Microprocessor: 8085A
Subroutine Instruction-Stack

7
Microprocessor: 8085A
Subroutine Instruction-Stack
LIFO

8
Microprocessor: 8085A
Subroutine Instruction-Stack
The PSW Register Pair

9
Microprocessor: 8085A
Subroutine Instruction-Stack

10
Microprocessor: 8085A
Subroutine Instruction-Stack

11
Microprocessor: 8085A
Subroutine Instruction-Stack

12
Microprocessor: 8085A
Subroutine Instruction-Stack

13
Microprocessor: 8085A
Subroutine Instruction-Stack

14
Microprocessor: 8085A
Subroutine Instruction-Stack
CALL Instruction

15
Microprocessor: 8085A
Subroutine Instruction-Stack
RET (1 Byte Instruction)

16
Microprocessor: 8085A
Subroutine Instruction-Stack
Conditional CALL and RTE Instructions

17
Thank You

18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy