除法中斷處理程序-asm
stack segment
dw 16 dup(0)
stack ends
code segment
start:
mov ax,cs
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,28h
mov si,offset do0
mov ax,0
mov es,ax
mov di,200h
mov cx,offset do0end-offset do0
cld
rep movsb
mov ax,0
mov es,ax
mov word ptr es:[0*4],200h
mov word ptr es:[0*4+2],0
calls1
mov ax,004ch
int 21h
do0:jmp short do0start
db "divvide error!"
do0start: mov ax,cs
mov ds,ax
mov si,202h
mov ax,0b800h
mov es,ax
mov di,3*160+2*2
mov cx,13
mov bl,5
s0:mov al,[si]
mov es:[di],al
inc di
mov es:[di],bl
inc si
incdi
loop s0
mov ax,004ch
int 21h
do0end:nop
s1: mov ax,0ffffh
mov dx,1
mov bx,1
div bx
ret
code ends
評論