Page 1 of 1
How to jump to 0x10000 in MASM?
Posted: Sun Dec 09, 2001 12:00 am
by mj
Hi,
After switching to PMode in bootstrap, I want to jump to 0x10000,
the cs selector is 10, how could I do so in MASM?
I have tried the below, but it doesn't work(reboot):
DB 66h,0eah
dd 10000h,10h
Thanks in advance.
RE:How to jump to 0x10000 in MASM?
Posted: Mon Dec 10, 2001 12:00 am
by Chase
>On 2001-12-09 20:56:10, mj wrote:
>Hi,
> After switching to PMode in bootstrap, I want to jump to 0x10000,
>the cs selector is 10, how could I do so in MASM?
> I have tried the below, but it doesn't work(reboot):
> DB 66h,0eah
> dd 10000h,10h
>
>Thanks in advance.
Will someone please tell me that Masm can do mixed (16 and 32) code.
I'm not even going to check and see if your hand coding is correct.
I'd be amazed if it didn't and would suggest that you switch to Nasm.
Usually a reboot at that stage means something in your segment selector table
isn't set correctly, you set your GDTR wrong or maybe didn't init A20
correctly or maybe you GDT is wrong.
(you do have int's off, right?)
Sorry I can't be more helpful, that reboot going into pmode
is the most common problem and is a real pain to fix.
About the only thing I can suggest is have the code that you're
jumping to just do an infinate loop to exclude that from being the
problem.
RE:How to jump to 0x10000 in MASM?
Posted: Wed Dec 12, 2001 12:00 am
by Ale
>On 2001-12-09 20:56:10, mj wrote:
>Hi,
> After switching to PMode in bootstrap, I want to jump to 0x10000,
>the cs selector is 10, how could I do so in MASM?
> I have tried the below, but it doesn't work(reboot):
> DB 66h,0eah
> dd 10000h,10h
>
>Thanks in advance.
try using
DB 66h,0eah
dd 10000h
dw 10h
or something like
BITS 32
call 0x10:0x10000
or
BITS 32
mov ax,0x10
mov ebx,0x10000
push ax
push ebx
retf
Bye, Alex
RE:How to jump to 0x10000 in MASM?
Posted: Mon Dec 31, 2001 12:00 am
by Guest
>On 2001-12-09 20:56:10, mj wrote:
>Hi,
> After switching to PMode in bootstrap, I want to jump to 0x10000,
>the cs selector is 10, how could I do so in MASM?
> I have tried the below, but it doesn't work(reboot):
> DB 66h,0eah
> dd 10000h,10h
>
>Thanks in advance.
I am not an expert. but i've written a working program that switches in 32bit pmode
and back to real mode.. so from my so little experience here's what i found..
assuming that you'd just turned on PM bit in cr0 the processor acts in
16bit pmode until it executes a jump to a an approperiate 32bit preset selector
your code should work..i have to note out that the selector #
is 16bit.. so a cleaner code would look like
;66h if still in 16bit pmode
db 66h,0eah
address dd 10000h
selector dw 10h
i am not sure why your machine reboots when it executes the code
but what i would do is check to make sure gdt has the right values,
interrupts are cleared, all segment registers are loaded with approperiate
values before the jump and the a20 line is enabled.
hopefully this would help..