ebp,esp区别 push ebp ;ebp入栈
mov ebp, esp ;因为esp是堆栈指针,无法暂借使用,所以得用ebp来存取堆栈 sub esp, 4*5 ;下面的wsprintf一共使用了5个参数,每个参数占用4个字节,所以要入栈4*5个字节 push 1111 push 2222 push 3333 push offset szFormat push offset szOut call wsprintf ;调用wsprintf add esp, 4*5 ;堆栈使用完毕,“还”回4*5个字节给系统 ... mov esp, ebp ;恢复esp的值 pop ebp ;ebp出栈 ret 主要是用来保存/恢复堆栈,以便传递参数给函数。 |
|