schack8888
风云使者
风云使者
  • 注册日期2010-12-06
  • 发帖数686
  • QQ
  • 火币3641枚
  • 粉丝161
  • 关注102
阅读:4939回复:0

[汇编源码]汇编V86模式切换程序

楼主#
更多 发布于:2011-10-23 17:04
386以上计算机从实模式进入虚拟86模式

源码:
.model small
.386p
.data
base_memory dd ?
new_base dd 0
new_base1 dd 0
.code
mov cs:psp_seg,ds
mov ax,seg base_memory
mov ds,ax
mov es,ax
mov ds,ax
int 12h
movzx eax,ax
shl eax,0ah
add eax,0fffh
and ax,0f000h
mov base_memory,eax ;eax
mov ah,88h
int 15h
add ax,400h
movzx eax,ax
shl eax,0ah
and ax,0f000h
mov bx,cs:psp_seg
mov es,bx
mov si,2ch
cmp bx,es:[si]
jb ignore
mov bx,es:[si]
ignore:
movzx ebx,bx
shl ebx,4
add ebx,0fffh
and bx,0f000h
mov ecx,base_memory ;ecx
sub ecx,ebx
sub eax,ecx
sub eax,010000h
mov new_base,eax
shr eax,4
mov new_base1,eax
call fill1_gdt
psp_seg dw ?
fill1_gdt proc near
movzx eax,ax
shl eax,4
mov ebx,eax
shr ebx,10h
add [si+2],ax
adc [si+4],bl
fill1_gdt endp
end

喜欢0 评分0
兼职版主
游客

返回顶部