问题描述
我现在正在逐步执行 AT&T 程序集中的一个函数,但无法弄清楚这个特定的 jmp 命令是如何工作的.
I am stepping through a function in AT&T assembly right now and can't figure out how this specific jmp command works.
jmp *0x804a140(,%eax,4)
它究竟是如何使用 %eax 寄存器和 4 与跳转指令的?我以前从未见过 jmp 用这种方式.
How exactly is it using the %eax register and 4 with the jump instruction? I have never seen jmp used this way before.
推荐答案
如果您对 at&t 语法感到困惑,请将您的工具切换到 intel 模式.
If you are confused by at&t syntax, switch your tool to intel mode.
您看到的有效地址并非特定于跳转,您可能会在任何需要内存操作数的指令中遇到它.
The effective address you see is not specific to jumps, you could have encountered it with any instruction that takes a memory operand.
在英特尔语法中,这看起来像:jmp [0x804a140 + 4 * eax]
.这是一个间接跳转,从内存地址 0x804a140 + 4 * eax
获取跳转目标.这可能是所谓的跳转表中的一项.
In intel syntax this would look like: jmp [0x804a140 + 4 * eax]
. It's an indirect jump that fetches the jump target from memory address 0x804a140 + 4 * eax
. This is probably an item in a so-called jump table.
这篇关于jmp指令在这种情况下如何在att程序集中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!