To ask question about running instruction in P-Mode?
Posted: Wed Apr 13, 2011 8:17 am
My codes run well,look:
.386P
cseg segment use16
assume cs:cseg
start:
;Enter into P-Mode
mov eax,cr0
or eax,1
mov cr0,eax ;(1)
;
mov ax,10 ;(2)
mov bx,20
;Return to R-Mode
mov eax,cr0
and eax,0fffffffeh
mov cr0,eax
mov ax,4c00h
int 21h
cseg ends
end start
After executing instruction:mov cr0,eax,it enters into P-Mode,just now the value
of segment CS is not changed,I suppose it is 2000h,and CPU fetch next instruction
according to CS,and just now the valuse(such as 2000h) is regarded as selector,
so CPU should not fetch the instruction:mov ax,10,but my codes run well,why?
.386P
cseg segment use16
assume cs:cseg
start:
;Enter into P-Mode
mov eax,cr0
or eax,1
mov cr0,eax ;(1)
;
mov ax,10 ;(2)
mov bx,20
;Return to R-Mode
mov eax,cr0
and eax,0fffffffeh
mov cr0,eax
mov ax,4c00h
int 21h
cseg ends
end start
After executing instruction:mov cr0,eax,it enters into P-Mode,just now the value
of segment CS is not changed,I suppose it is 2000h,and CPU fetch next instruction
according to CS,and just now the valuse(such as 2000h) is regarded as selector,
so CPU should not fetch the instruction:mov ax,10,but my codes run well,why?