“短”是什么意思?汇编语言中的跳转是什么意思?
这段代码中的“SHORT”是什么意思?
JE SHORT 00013FB8
What does the "SHORT" mean in this code?
JE SHORT 00013FB8
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
这段代码中的“SHORT”是什么意思?
JE SHORT 00013FB8
What does the "SHORT" mean in this code?
JE SHORT 00013FB8
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
短跳转(和近调用)是目标位于同一模块中的跳转(即它们是模块内的,但是可以从某些黑客行为中获得模块间变体)。它们最常见的是高达 127 字节的相对位移(它们从指令地址向前或向后改变执行流程),但是也有提供 32k 字节的 16 位变体。
您实际上不需要太担心,它确实是多余的信息,但英特尔开发人员手册(第 2a 卷和第 2b 卷,特别是第 2a 卷)将涵盖血淋淋的细节。
Short jumps (and near calls) are jumps whose target is in the same module (i.e. they are intramodular, however it is possible to get intermodular variants from certain hacks). They are most commonly up to 127 bytes of relative displacement (they change the flow of execution forward or backward from the address of the instruction), however there are 16bit variants offering 32k bytes.
You don't really need to worry about it much, its really superfluous information, but the intel developer manuals (volumes 2a and 2b, specifically 2a) will cover the gory details.
可以使用当前汇编指令的相对偏移量来实现短跳转。对于 x86/32 位,这是一条 2 字节指令,其中第一个字节始终为 EB,用于短跳转,第二个字节是 或 之前的字节数。在当前指令跳转之后。第二个字节是一个有符号的 8 位数字,因此 x86 上最远的短跳转是 +/-127 字节。任何超过 +/-127 字节的内容都是长跳转,
E9
,并且必须使用完整的 32 位地址;产生 5 字节指令。如果您要内联修补汇编代码,请记住这一点很重要。
前任。
EB 0
将跳转到短跳转之后的操作码,而不是代码行本身。前任。
EB 7F
是最远的跳跃。A short jump can be achieved using a relative offset from the current assembly instruction. For x86/32-bit, this is a 2 byte instruction, where the first byte is always
EB
, for short jump, and the second byte is the number of bytes before or after the current instruction to jump. The second byte is a signed 8-bit number, so the the furthest short jump on x86 is +/-127 bytes away. Anything past +/-127 bytes away is a long jump,E9
, and must use the full 32-bit address; resulting in a 5 byte instruction.This is important to keep in mind if you are inline patching assembly code.
ex.
EB 0
would jump to the opcode following the short jump, not the line of code itself.ex.
EB 7F
is the furthest jump down.这意味着它不会跳得太远。根据反汇编器,后面的数字要么是它跳转到的地址,要么是相对偏移量,它告诉您下一条指令和跳转目标之间有多少字节。
It means that it isn't jumping very far. Depending on the disassembler, the number after that will either be the address that it jumps to or a relative offset which tells you how many bytes are between the next instruction and the target of the jump.
短跳转发生在PC的引导中,这意味着2字节长的汇编指令告诉处理器跳转到BIOS中的地址100h开始引导。
short jump is in PC's boot, that means that 2-byte long assembly instruction tells processor to jump address 100h in BIOS to start booting.