AT&T 语法中 lea 0x4(%esp),%ecx 是什么意思?
at&t 汇编中 lea 0x4(%esp),%ecx
是什么意思?
0x4(%esp)
到底是什么?
What does lea 0x4(%esp),%ecx
mean in at&t assembly?
What really is 0x4(%esp)
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它是
%esp + 0x4
。LEA
代表加载有效地址。在本例中,这是一个简单的添加,如上所示。通常人们和编译器不再真正使用它,因为 CPU 现在配备了一个漂亮的地址生成单元(也称为 AGU),它允许您使用各种奇特的算术来计算寄存器和值的地址。简而言之,无论您对 lea 做了什么,您现在都可以将其嵌入到任何其他指令中。It's
%esp + 0x4
.LEA
stands for Load Effective Address. It's, in this case, a simple addition, as shown above. Typically people and compilers don't really use it anymore because CPUs now ship with a nifty address generation unit (otherwise called AGU), which lets you use all kinds of fancy arithmetics to compute addresses from registers and values. In short, whatever you did withlea
, you can now embed it inside any other instruction.esp
是堆栈指针。 0x4 是偏移量。 AT&T 语法具有命令源、目标
,这里的命令是LEA
,即“加载有效地址”。所以我们告诉CPU将地址“堆栈指针+4”加载到寄存器“ecx”中
esp
is the stack pointer. 0x4 is the offset. AT&T syntax has thecommand source, destination
and the command here isLEA
which is "Load Effective Address."So we're telling the CPU to load the address "stack pointer + 4" into the register "ecx"