Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
27 views2 pages

Stack Memory

The document explains stack operations in the context of the 8085 microprocessor, detailing how data is temporarily stored and retrieved using the PUSH and POP instructions. It describes the Last-In-First-Out (LIFO) nature of stack operations and provides examples of how the stack pointer is manipulated during these operations. Additionally, it illustrates the process of storing and retrieving data from the stack with specific memory addresses.

Uploaded by

ramneetm0
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)
27 views2 pages

Stack Memory

The document explains stack operations in the context of the 8085 microprocessor, detailing how data is temporarily stored and retrieved using the PUSH and POP instructions. It describes the Last-In-First-Out (LIFO) nature of stack operations and provides examples of how the stack pointer is manipulated during these operations. Additionally, it illustrates the process of storing and retrieving data from the stack with specific memory addresses.

Uploaded by

ramneetm0
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/ 2

ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY

2.7 STACK OPERATIONS


 The stack is a group of memory location in the R/W memory (RAM) that is used
for temporary storage of data during the execution of a program.
 Address of the stack is stored into the stack pointer register. The 8085 provide two
instructions PUSH & POP for storing information on the stack and reading it back.
 Data in the register pairs stored on the stack by using the instruction PUSH.
 Data is read from the stack by using the instruction POP.
 PUSH & POP both instruction works with register pairs only.
 he storage and retrieval of the content of registers on the stack fallows the
LIFO(Last- In-First-Out) sequence.
Operation of the stack by PUSH and POP Instruction
2000 LXI SP, 2099H ; this instruction define stack
2003 LXI H, 42F2H ; this instruction store 42F2 in to the HL pair
2006 PUSH H ; store HL pair on to the stack
2010 POP H ; store data from top of the stack to HL pair
For PUSH H
The stack pointer is decremented by one to 2098H, and the contents of the h
register are copied to memory location 2098H.The stack pointer register is again
decremented by one to 2097H,and the contents of the L register are copied to memory
location 2097H.The contents of the register pair HL are not destroyed.

Figure 2.7.1 PUSH H operation


[Source: “Microprocessor Architecture Programming and Application” by R.S. Gaonkar, page-238]

EE8551 MICROPROCESSOR AND MICROCONTROLLER


ROHINI COLLEGE OF ENGINEERING & TECHNOLOGY

For POP H
The contents of the top of the stack location shown by the stack pointer are copied
in the L register and the stack pointer register is incremented by one to 2098 H. The
contents of the top of the stack (now it is 2098H) are copied in the H register, and the
stack pointer is incremented by one. The contents of memory location 2097H and 2098
are not destroyed until some other data bytes are stored in these location.

Figure 2.7.1 POP H operation


[Source: “Microprocessor Architecture Programming and Application” by R.S. Gaonkar, page-238]

EE8551 MICROPROCESSOR AND MICROCONTROLLER

You might also like