Jack Jordan
Jack Jordan

Reputation: 99

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?

Upvotes: 1

Views: 1477

Answers (5)

ninjalj
ninjalj

Reputation: 43728

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 (e.g: a task switch).

Upvotes: 1

Kendall Frey
Kendall Frey

Reputation: 44374

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

Upvotes: 1

Shane Powell
Shane Powell

Reputation: 14158

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.

Upvotes: 1

Sergey Podolsky
Sergey Podolsky

Reputation: 157

I guess that 0xACDC is a code segment address and 0x5578 is an offset inside the code.

Upvotes: 0

KevinDTimm
KevinDTimm

Reputation: 14376

without reference to the wiki, I can only guess, but I'd hazard that this has to do with the 8088/86/286/386 processors with them 'segmented' address space.

Upvotes: 1

Related Questions