In x86 assembly, when you write a (direct) jump or call, the jump target is specified as an offset from the address of the next instruction. For example:
*000: jmp *020 ; => EB *E
*002: ...
Here, EB is the opcode for a short jmp, and *E is the offset from the following instruction (at *002) to the jump target (i.e., *E = *020 - *002).
Another example:
2000: jmp 2*00 ; => E* FD 00
200*: ...
Here, E* is the opcode for a near jmp, and 00FD is the offset from the following instruction (at 200*) to the jump target.
(Indirect jumps do not use offsets. For example, jmp eax will use the contents of eax as the jump target, without adding the address of the next instruction.)
_______________________________________________________



Reply With Quote