assume cs:code
stack segment
dw 8 dup(0)
stack ends
code segment
start:
mov ax,stack
mov ss,ax
mov sp,10h;设置栈段
mov ax,4240h
mov dx,0fh
mov cx,0ah
call divdw
mov ax,4c00h
int 21h
divdw:
push ax;将ax放进栈保存
;接下来实现高位的除法
mov ax,dx
mov dx,0
div cx
;把商放进bx中
mov bx,ax
pop ax
div cx
mov cx,dx;寄存器间的值调整
mov dx,bx
ret
code ends
end start