- [qiangzi] 楼主有空的话能帮我装一下dos吗?我一直装不上,qq519710391,先谢谢! 02/06 20:34
- [zwz_good] 看到自己的注释能给别人带来帮助,心里非常高兴,也许这就是帮助别人的快乐吧。 10/20 16:23
- [游客] 程序测试了一下,没什么问题。 10/20 14:25
- [游客] 博主程序中的那部分注释说明非常重要,非常有用,非常有帮助。好啊。 10/20 14:15
- [zwz_good] 谢谢你的鼓励。 10/10 20:56
- [游客] 自己实现更能体会过程,有好处,做完了再做便捷的就知道便捷在哪了。 顶博主! 10/10 14:25
- [zwz_good] 噢,习惯了使用这个子程序了,再来一个使用INT 21H中断的,谢谢提醒。 10/09 20:25
- [tinyparticle] ;名称:show_str 显示字符串子程序 ;功能:在指定的位置,用指定的颜色,显示一个用0 10/09 20:17
- [tinyparticle] 同意楼上 10/08 22:56
- [20081148] 你的7ch中断例程有问题,题目要求实现无条件段内近转移 jmp near ptr s指令,可你的代码 10/08 22:24
- [20081148] 你的虚拟机从哪下的啊?我下了好几个,都不能用,无语了。 10/21 08:53
[2009-10-12 20:25] 实验 15 安装新的int9中断例程
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 int9end - offset int9
cld
rep movsb
push es:[9*4]
pop es:[200h]
push es:[9*4+2]
pop es:[202h]
cli
mov word ptr es:[9*4], 204h
mov word ptr es:[9*4+2], 0
sti
mov ax, 4c00h
int 21h
int9:
push ax
push bx
push cx
push es
in al, 60h
pushf
call dword ptr cs:[200h]
cmp al, 9eh ;1e+80h
jne int9ret
mov ax, 0b800h
mov es, ax
mov bx, 0
mov cx, 2000
s:
mov byte ptr es:[bx], 'A'
add bx, 2
loop s
int9ret:
pop es
pop cx
pop bx
pop ax
iret
int9end:
nop
code ends
end start
========一定要注意本程序仅能运行一次,运行第二次以后会出现错误:系统处理不了键盘中断了。这是因为第一次运行后将BIOS提供的键盘中断例程入口地址保存到了0000:0200h处,当第二次运行后,会将这个入口地址覆盖掉,导致系统处理不了键盘中断!!!!=====
另外本程序是在虚拟机下运行的,今后两章也要在虚拟机下运行,避免不必要的错误。
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 int9end - offset int9
cld
rep movsb
push es:[9*4]
pop es:[200h]
push es:[9*4+2]
pop es:[202h]
cli
mov word ptr es:[9*4], 204h
mov word ptr es:[9*4+2], 0
sti
mov ax, 4c00h
int 21h
int9:
push ax
push bx
push cx
push es
in al, 60h
pushf
call dword ptr cs:[200h]
cmp al, 9eh ;1e+80h
jne int9ret
mov ax, 0b800h
mov es, ax
mov bx, 0
mov cx, 2000
s:
mov byte ptr es:[bx], 'A'
add bx, 2
loop s
int9ret:
pop es
pop cx
pop bx
pop ax
iret
int9end:
nop
code ends
end start
========一定要注意本程序仅能运行一次,运行第二次以后会出现错误:系统处理不了键盘中断了。这是因为第一次运行后将BIOS提供的键盘中断例程入口地址保存到了0000:0200h处,当第二次运行后,会将这个入口地址覆盖掉,导致系统处理不了键盘中断!!!!=====
另外本程序是在虚拟机下运行的,今后两章也要在虚拟机下运行,避免不必要的错误。
评论次数(0) |
浏览次数(460) |
类型(汇编作业) |
收藏此文 |