Pages - Menu

Wednesday, September 11, 2013

PUSH and POP operation of stack memory in microcontroller

PUSH & POP
STACK:
it s part of RAM in which data will store temporary during execution of program.
STACK work on last in first out principal.to store and retrieve data during program execution in stack push and pop instruction work for it.
PUSH:
its used to store data into stack.
POP:
to retrieve data from stack.
SP:
stack pointer is 8 bit register which store value of top of the stack.
by default stack pointer contain 07h.

PUSH AND POP OPERATION:

PUSH:
using push operation stack pointer increased first and then content of register or memory will store on that stack location which stored in SP.
here SP contain =07h

PUSH R6;SP increased by one and contain of R6 store into 08 location.
PUSH R1;SP increased again by one and contain of R1 stored into 09 location.
PUSH R4;SP increased again by one and contain of R4 stored into 0A location.

POP:
In this retrieve data first and then stack pointer decreased by one.
if we write
POP 20h;then content at 0Ah location will copy into 20h then stack pointer decrease by 1.
POP 21h;then content at 09h location will copy into 21h then stack pointer decrease by 1.

-----------------------------------------------------------------------------------------------------------------------
 NEXT: serial communication                                        PREVIOUS:how to access external memory






14 comments:

  1. This is not right as we can't use push or pop instructions with register names as 8051 stack mnemonics have no way of determining the register banks. Thus addresses for most of the registers should be used.

    ReplyDelete
  2. How push and pop is useful in interrupt handling in 8051

    ReplyDelete
  3. Randi MCA kyu kra jb itna nhi aata hrami

    ReplyDelete
  4. Great explanation by the author
    Sanjary Kids is one of the best play school and preschool in Hyderabad,India. Give your child the best preschool experience by choosing the best playschool of Hyderabad in Abids. we provide programs like Play group,Nursery,Junior KG,Senior KG,and provides Teacher Training Program.
    Preschool in hyderabad

    ReplyDelete
  5. Excellent blog posts information

    Sanjary Academy is the best Piping Design institute in Hyderabad, Telangana. It is the best Piping design Course in India and we have offer professional Engineering Courses like Piping design Course, QA/QC Course, document controller course, Pressure Vessel Design Course, Welding Inspector Course, Quality Management Course and Safety Officer Course.
    best Piping Design Course
    piping design course with placement
    Piping Design Course
    Piping Design Course in Hyderabad ­
    Piping Design Course in India­
    best Piping Design institute
    best institute of Piping Design Course in India

    ReplyDelete
  6. Thanks for sharing the updated information it will useful and helpful

    Pressure Vessel Design Course is one of the courses offered by Sanjary Academy in Hyderabad. We have offer professional Engineering Course like Piping Design Course,QA/QC Course,document Controller course,pressure Vessel Design Course,Welding Inspector Course, Quality Management Course, Safety officer course.
    Welding Inspector Course
    Safety officer course
    Quality Management Course
    Quality Management Course in India

    ReplyDelete
  7. Sushant Singh Rajput Last Movie Dil Bechara 2020 Download HDRip
    Dil Bechara 2020 FHD Download Here

    ReplyDelete
  8. प्यारा ब्लॉग! याहू न्यूज पर सर्फिंग करते समय मुझे आपकी बीए फाइनल टाइम टेबल वेबसाइट मिली।

    ReplyDelete
  9. These are genuinely fantastic ideas about blogging really. You have touched some very nice points here. Please keep up this good writing.

    ReplyDelete
  10. क्या आपको भारत की जनसंख्या कितनी है ये पता है?

    ReplyDelete
  11. Your page has got very important information which I was looking for for a long time this is the best page of 2023 see rest of the information
    Syed Rizwan Ahmed Wiki
    Cecilia Asoro wiki
    Lisa Marie Presley Wiki
    Erika Donalds Wiki

    ReplyDelete