简体   繁体   中英

jmp in assembly

I would really appreciate if someone can explain to me what the ":" is good for in jmp instruction, below is from wiki from wiki

JMP 0x89AB, I know that this one is to jump to that position 
JMP 0xACDC:0x5578 what is that?

没有参考维基,我只能猜测,但我担心这与8088/86/286/386处理器及其“分段”地址空间有关。

x86 based processors work of a segmented memory architecture .

Basically memory is addressed using two parts. The segment address and the offset address. The part before the ':' is the segment address and the part after the ':' is the offset address.

0x1234:0x5678 style addresses are segmented addresses. All it means is 0x1234 * 0x10 + 0x5678 . The example you gave would be 0xB2338 .

That is a far jump. It's meaning differs between real and protected mode:

  • Real mode → it has a segment and an offset, the jump target is segment * 16 + offset .
  • Protected mode → it has a selector which points to a descriptor in either the GDT (global descriptor table, for the whole system) or LDT (local descriptor table, per process). The jump target depends on the descriptor type (and needs having sufficient privileges):
    • Code segment: it jumps to offset within the described segment.
    • Call gate, task gate, TSS: the offset is ignored, and the appropriate action is performed (eg: a task switch).

我猜0xACDC是代码段地址,0x55​​78是代码中的偏移量。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM