汇编网首页登录博客注册
mahdi_glt的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
学习动态
最新评论
最新留言
文章收藏
友情链接

[2011-05-14 07:26] 实验15 安装新中断例程  松开按键A的时候满屏幕都是A(纯DOS下有用)

图片载入中
assume cs:code

stack segment
        db 128 dup (0)
stack ends

code segment
;=======================设置安装程序=============
start:
        mov ax,stack
        mov ss,ax
        mov sp,128;堆栈设置
        
        push cs
        pop ds
        mov ax,0
        mov es,ax
        mov si,offset int9
        mov di,204h
        mov cx,offset endint9-offset int9
        cld
        rep movsb;安装中断例程
        
        push word ptr es:[4*9]
        pop word ptr es:[200h]
        push word ptr es:[4*9+2]
        pop word ptr es:[202h];转移原中断向量到200h~203h
        
        cli
        mov word ptr es:[4*9],204h
        mov word ptr es:[4*9+2],0
        sti                                                ;设置新的中断向?
        
        mov ax,4c00h
        int 21h
        
;=======================中断程序=================
int9:
        push cx
        push es
        in al,60h
        pushf
        mov bx,0
        mov es,bx
        call dword ptr es:[200h];调用原中断例程处理
        cmp al,1eh+80h
        jne int9ret
        mov ax,0b800h
        mov es,ax
        mov cx,2000
        mov bx,0
        mov al,'A'
int9s1:
        mov es:[bx],al
        add bx,2
        loop int9s1
int9ret:
        pop es
        pop cx
        iret
endint9:nop
;=======================程序结束=================
code ends
end start
评论次数(0)  |  浏览次数(539)  |  类型(我的代码) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码