About PUSH and POP in microprocessor/controller

  • Thread starter Thread starter reddvoid
  • Start date Start date
  • Tags Tags
    Push
AI Thread Summary
The PUSH operation copies data from a register to the top of the stack without altering the original register's contents. The stack pointer register is adjusted to reflect the new top of the stack. Conversely, the POP operation retrieves data from the top of the stack and copies it to the specified register, again leaving the original stack data intact. Both operations maintain the integrity of the source register, as they do not perform a move operation that would change its contents. This behavior remains consistent across various microprocessors and controllers.
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.
 
Thank you :)
 
Very basic question. Consider a 3-terminal device with terminals say A,B,C. Kirchhoff Current Law (KCL) and Kirchhoff Voltage Law (KVL) establish two relationships between the 3 currents entering the terminals and the 3 terminal's voltage pairs respectively. So we have 2 equations in 6 unknowns. To proceed further we need two more (independent) equations in order to solve the circuit the 3-terminal device is connected to (basically one treats such a device as an unbalanced two-port...
suppose you have two capacitors with a 0.1 Farad value and 12 VDC rating. label these as A and B. label the terminals of each as 1 and 2. you also have a voltmeter with a 40 volt linear range for DC. you also have a 9 volt DC power supply fed by mains. you charge each capacitor to 9 volts with terminal 1 being - (negative) and terminal 2 being + (positive). you connect the voltmeter to terminal A2 and to terminal B1. does it read any voltage? can - of one capacitor discharge + of the...

Similar threads

Replies
20
Views
2K
Replies
7
Views
171
Replies
10
Views
3K
Replies
5
Views
3K
Replies
0
Views
491
Back
Top