What does “short” jump mean in assembly language?

前端 未结 4 1485
有刺的猬
有刺的猬 2020-12-31 04:43

What does the \"SHORT\" mean in this code?

JE SHORT 00013FB8
相关标签:
4条回答
  • 2020-12-31 04:53

    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.

    0 讨论(0)
  • 2020-12-31 04:54

    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.

    0 讨论(0)
  • 2020-12-31 05:01

    Short jumps (and near calls) are jumps whos target is in the same module(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 superfluos information, but the intel developer manuals(volumes 2a and 2b, specifically 2a) will cover the gory details

    0 讨论(0)
  • 2020-12-31 05:02

    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.

    0 讨论(0)
提交回复
热议问题