- 实验内容、程序清单及运行结果
编写0号中断的处理程序(课本实验12)
解:
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
运行结果:
标签:code,di,中断,mov,si,处理程序,ax,编写,es From: https://blog.csdn.net/ZYS7078/article/details/145329815