About PUSH and POP in microprocessor/controller

  • Thread starter Thread starter reddvoid
  • Start date Start date
  • Tags Tags
    Push
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 5K views
reddvoid
Messages
118
Reaction score
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 ?
 
Engineering news on Phys.org
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 ?
 
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.
 
The content of the register is unchanged. Moving operations don't change the source register.
 
Unless the new processors changed, push or move the content of the register on stack don't change the content of the register.