I'm getting confused on what does pop
actually do in assembly. Does pop
move the value PUSH
ed onto the stack last (meaning it doesn't apply if we MOV
a value after the the last element PUSH
ed) or does it just pop whatever value that's last on the stack (thus, applying to both MOV
and PUSH
), or does it pop what ever value pointed to by the stack pointer? Consider the following code:
push $4
mov $5, -4(%esp)
add $4, %esp (esp pointing to an unknown value)
pop %ebp
So in this code will the value poped into ebp
be 4, 5, or the unknown value pointed to by esp
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…