How to jump R-Mode from 32-bit P-Mode
Posted: Wed May 18, 2011 7:36 am
When I jump to R-Mode from 32-bit P-Mode,the PC is always down,why?
How to correct it?
Look:
How to correct it?
Look:
Code: Select all
......
jump16 macro selector,offsetv
db 66h
db 0eah ;jmp
dw offsetv ;2 bytes offset address
dw selector
endm
....
cseg1 segment use16
assume cs:cseg1
start:
...
cli
;
mov eax,cr0
or eax,1
mov cr0,eax
.....
toreal:
sti
mov ax,4c00h
int 21h
cseg1 ends
;
cseg3 segment use32
assume cs:cseg3
spm32:
mov eax,cr0
and eax,0fffffffeh
mov cr0,eax
;Return to code
jump16 <seg toreal>,<offset toreal>
;
cseg3 ends