实验十.编写子程序(2)解决除法溢出问题
根据给出的公式可实现溢出问题,代码如下:assume cs:code
code segment
start:
mov ax,4240h
mov dx,0fh
mov cx,0ah
call short divdw
mov ax,4c00h
int 21h
divdw:
mov bx,ax;save ax value to bx
mov ax,dx
mov dx,0
div cx
mov es,ax ;int(H/N)to es
mov ax,bx
div cx
mov cx,dx
mov dx,es
ret
code ends
end start
页:
[1]