Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
两条线有什么区别
push eax mov [esp], eax
不将 eax 推入堆栈(esp 指向的地方就像 mov [esp], eax 一样?)
“push”会自动增加“esp”(你的堆栈指针)的值。“mov”不会。所以我如果你想把多个项目放在堆栈上push,你只需:
push
push eax push ebx ...
使用mov, 要获得相同的结果,您将拥有:
mov
sub esp,4 mov [esp], eax sub esp,4 mov [esp], ebx ...
好处push是有反向操作,pop它可以让你以相反的顺序把事情拉回来。当然,这就是堆栈的全部意义所在。:)
pop