Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

About PUSH and POP in microprocessor/controller

  1. Dec 14, 2012 #1
    Does PUSH operation moves or copies data from register to top of stack ;
    I mean, what happens to the contents of the register from which the data is pushed ?
     
  2. jcsd
  3. Dec 14, 2012 #2
    Does PUSH operation moves or copies data from register to top of stack ;
    I mean, what happens to the contents of the register from which the data is pushed ?
     
  4. Dec 14, 2012 #3

    jedishrfu

    Staff: Mentor

    nothing, its still there. push just places a copy of the data onto the stack and adjusts the stack pointer register.

    pop does the opposite grabbing the top stack data copying to the register and changing the stack pointer register to the next value in the stack.
     
  5. Dec 14, 2012 #4
    The content of the register is unchanged. Moving operations don't change the source register.
     
  6. Dec 14, 2012 #5
    Unless the new processors changed, push or move the content of the register on stack don't change the content of the register.
     
  7. Dec 20, 2012 #6
    Thank you :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: About PUSH and POP in microprocessor/controller
  1. [microprocessor] =cpu? (Replies: 4)

Loading...