微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 除法中断处理程序-asm

除法中断处理程序-asm

时间:12-01 来源:互联网 点击:
assume cs:code,ss:stack;关键在于处理中断的层层返回

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

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top