News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Why is the PC down?

Started by leetow2003, December 18, 2010, 01:09:32 PM

Previous topic - Next topic

leetow2003

I want to move data to B8000H in P-mode,look:

dseg        segment   use16     
gdt         label   byte       
dummy       descriptor <>     
datas       descriptor <0ffffh,0h,12h,92h,0>
datas_sel   =datas-gdt     
datab       descriptor <100h,8000h,0bh,92h,0>
datab_sel   =datab-gdt   
.......
dseg        ends
;
cseg        segment
            assume cs:cseg
;Just now in Protected mode
            mov ax,datab_sel
            mov ds,ax
            mov si,0
            mov byte ptr [si],48h
            mov byte ptr [si+1],7

;Jump to real mode
cseg        ends

when this program run,the letter 'H' can be displayed,but
the pc is down;but I add codes after instruction "mov byte ptr [si+1],7",
mov ax,datas_sel           
mov ds,ax
the PC run well,I want to know why?
If datas' base address is 120000h,when it jump to
real mode,what value is ds?Is DS 1200h?   

leetow2003

dseg        segment   use16     
gdt         label   byte       
dummy       descriptor <>     
datas_sel   =datas-gdt     
datab       descriptor <100h,8000h,0bh,92h,0>
datab_sel   =datab-gdt   
.......
dseg        ends
;
cseg        segment
            assume cs:cseg
;Just now in Protected mode
            mov ax,datab_sel
            mov ds,ax
            mov si,0
            mov byte ptr [si],48h
            mov byte ptr [si+1],7

;Jump to real mode
cseg        ends

when I run this program,PC is down,and I change the datab segment
limit,PC run well:
datab       descriptor <0ffffh,8000h,0bh,92h,0>
I want to why?