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