Helge Kruse wrote:
> Reply inline.
>>>> Is there any way to write a clean jump to 32 bit segment?
> > ;assemble with FASM
> > use16
> > 66 31 C0 xor eax, eax
> > 8E D8 mov ds, ax
> > 0F 01 16 18 00 lgdt [gdt]
> > 0F 20 C0 mov eax, cr0
> > 24 EF and al, 0EFh
!! the line above should be: OR AL,01 !!
> > 0F 22 C0 mov cr0, eax
> > EA 30 00 08 00 jmp 8:protected_mode
if it is supposed to switch from RM16 to PM32 then I'd use:
66 EA xx xx xx xx yy yy jmpf yyyy:xxxxxxxx ;selector:offset32
it may work without the 66, but the highword of EIP is either
zeroed or (even rare to happen on most CPUs) undefined then.
> I dont know the syntax 8:Label. Is 8 the selector offset?
> In that case I would expect a far jump. This would need 16 bit
> selector offset and 32 bit offset, wouldn't it?
> But I think EA is the opcode for a near jump.
No, Code EA ... is a far jump.
__
wolfgang


|