assume cs:code,ss:code
code segment
mov ax,cs
mov ds,ax
mov si,offset do0
mov ax,0000h
mov es,ax
mov di,0200h
mov cx,offset do0end-offset do0
cld
rep movsb
mov ax,0000
mov ds,ax
mov word ptr ds:[0*4],0200h
mov word ptr ds:[0*4+2],0000h
mov ax,4c00h
int 21h
do0:
jmp short do0start
db "divide error!"
do0start:
push ax
push cx
push si
push di
push ds
push es
mov ax,cs
mov ds,ax
mov si,0202h
mov ax,0b800h
mov es,ax
mov di,12*160+34*2
mov cx,13
s:
mov al,[si]
mov es:[di],al
mov byte ptr es:[di+1],02h;绿色字
inc si
add di,2
loop s
pop es
pop ds
pop di
pop si
pop cx
pop ax
iret
do0end:
nop
code ends
end
;编写一个测试程序
assume cs:code
code segment
mov ax,0100h
mov bl,0001h
div bl;执行完该条指令调用中断例程,iret返回后继续执行该指令
mov ax,4c00h;须改用int 0该程序才不死机
int 21h
code ends
end
王爽 汇编 实验12 编写0号中断的处理程序
最新推荐文章于 2022-09-17 22:55:51 发布