目录

实验任务

  1. 实验内容、程序清单及运行结果

编写0号中断的处理程序(课本实验12)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
assume cs:code
code segment
start:
mov ax,cs
mov ds,ax
mov si,offset do
mov ax,0
mov es,ax
mov di,200h
mov cx,offset doend-offset do ;安装中断例程
cld
rep movsb
mov word ptr es:[0],200h
mov word ptr es:[2],0 ;设置中断向量表
mov dx,0ffffh
mov bx,1 ;测试一下
div bx
mov ax,4c00h
int 21h
do: jmp short dostart
db 'divide error!'
dostart:
mov ax,0
mov ds,ax
mov si,202h
mov ax,0b800h
mov es,ax
mov di,160*10+80
mov cx,13
s:
mov al,ds:[si]
mov ah,2
mov es:[di],ax
inc si
inc di
inc di
loop s
mov ax,4c00h
int 21h
doend: nop
code ends
end start

结果: