Hello,
I wrote a x86 boot loader a long time ago. One step is to jump form 16 bit
to 32 bit segment before entering protected mode. I found
that I need the opcode
_BOOT SEGMENT PARA USE16 PUBLIC 'ZZZZ_LINK_REALLY_LAST'
00000076 66 db 66h ;----- jmpf cs:pInitCpuFlush -----
00000077 2E db 2Eh ; CS:
00000078 FF 2E db 0FFh, 2Eh ; JMPF
0000007A 0000001E R dd OFFSET pInitCpuFlush
_INIT SEGMENT PARA USE32 PUBLIC 'ZZZ_LINK_AT_LAST'
0000001E pInitCpuFlush LABEL FWORD
0000001E 000000FC R dd EnterProtMode
00000022 0010 dw GdtCode - GdtNull
That works. When I try to encode this with normal instructions I get
different opcodes:
jmp cs:pInitCpuFlush
0000007E 67& 66| 2E: FF jmp cs:pInitCpuFlush
2D 0000001E R
00000087 67& 66| FF 2D jmp pInitCpuFlush
0000001E R
0000008F 67& 66| 2E: FF jmp fword ptr cs:pInitCpuFlush
2D 0000001E R
00000098 _BOOT ENDS
Is there any way to write a clean jump to 32 bit segment?
/Helge