News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

long jump after lgdt instruction

Started by nemesis9, August 06, 2007, 06:01:58 AM

Previous topic - Next topic

nemesis9

I've just executed the lgdt instruction.  I need to code the long jump immediately following that, how do I do it?

for example:
                           lgdt gdt_descriptor
                           jump far ptr LONG_JUMP_TO_HERE    <- this doesn't assemble

LONG_JUMP_TO HERE:   mov eax, 018h
                                   mov ds, eax
                                   ...

if I code it as 'jmp LONG_JUMP_TO_HERE'   it will assemble but it wont give me the 0EAh opcode with the cs:dword address that is necessary.
I've tried all kinds of syntax with no luck.   
Thanks.



Tedd

http://support.microsoft.com/kb/49900
and/or
http://www.phatcode.net/res/224/files/html/ch09/09-07.html
(see LISTING 9.7)

Although, if you've just loaded the gdt, you'll probably want to jump to one of your newly defined segments, so that won't help you much anyway. You'll need to code in the jump yourself, with the correct new cs value (usually 8, depending how you've set out your gdt) and the offset of the location within that segment (not the segment you're jumping from.)
No snowflake in an avalanche feels responsible.