x86 堆栈指针指向哪里? [英] x86 where stack pointer points?

查看:33
本文介绍了x86 堆栈指针指向哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如如果我推了 ax 是 [SP] 指向我的 ax 值还是 ax 后面的单词?它也不同于实模式和保护模式吗?我问这个是因为汇编艺术书说明和解释了 sp 指向最后推送的数据,并且在此页面上 OSDev Wiki- 堆栈它在最后一次推送数据后指向空字.

For example if I pushed ax is [SP] points to my value of ax or the word after ax? Also is it differs from real mode to protected mode? I ask this because the Art of assembly book illustrates and explains as the sp points to last pushed data, and on this page OSDev Wiki - Stack it illustrated as it points to empty word after last pushed data.

推荐答案

维基百科说这里:

堆栈是通过隐式递减(推送)实现的,并且递增(弹出)堆栈指针.在 16 位模式下,此隐式堆栈指针寻址为 SS:[SP],在 32 位模式下为 SS:[ESP],在64 位模式是 [RSP].堆栈指针实际上指向最后一个存储的值,假设其大小将匹配处理器的操作模式(即 16、32 或 64 位)匹配 push/pop/call/ret 指令的默认宽度.

The stack is implemented with an implicitly decrementing (push) and incrementing (pop) stack pointer. In 16-bit mode, this implicit stack pointer is addressed as SS:[SP], in 32-bit mode it is SS:[ESP], and in 64-bit mode it is [RSP]. The stack pointer actually points to the last value that was stored, under the assumption that its size will match the operating mode of the processor (i.e., 16, 32, or 64 bits) to match the default width of the push/pop/call/ret instructions.

这也是我的回忆说它的工作方式.

This is the way my way-back memory says it works, too.

这篇关于x86 堆栈指针指向哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆