I learned x86-16 assembly and i want to learn to x86-32 assembly. I maked a simple 32-bit program but this code not work When program makes a far jump console displays 'JMP illegal descriptor 0' I use fasm and DOS Please show me what i'm doing bad
Here's my code
format MZ
push cs
pop ds
mov eax,cs
shl eax,4
mov [AdresSegmentuProgramu_32],eax ;Calculating real mode segment
add eax,gdt_table
mov [gdtr+2],eax
use32
lgdt [gdtr]
mov eax,[AdresSegmentuProgramu_32]
add eax,pmode_entry
mov [AdresSegmentu_PMODE_entry],eax
mov eax,cr0
or eax,1 ;Switch to PMODE
mov cr0,eax
mov eax,[AdresSegmentu_PMODE_entry] ;Far jump to reset CS and jump to simple code
mov [far_jump],eax
jmp far [ds:far_jump]
far_jump:
dd 0
dw 08h ; Selector 0x08
gdtr: dw 128
dd 0
AdresSegmentuProgramu_32 dd 0
AdresSegmentu_PMODE_entry dd 0
use32
gdt_table:
dq 0
code_descriptor:
dw 0ffffh
dw 0
db 0
db 09ah
db 11001111b
db 0
data_descriptor:
dw 0ffffh
dw 0
db 0
db 092h
db 11001111b
db 0
dq 0
dq 0
pmode_entry:
mov esi,0b8000h
mov byte [esi],'a'