为什么这段代码不能执行啊?郁闷
为什么我下面的代码执行结果是Divide overflow啊?
希望哪位高手能帮我看看啊,先谢了啊
data segment
ts db 'please input a plus number(less than 99):$'
pri db 5 dup(?)
pt db 5 dup(?)
sum dw ?
input db 3
db ?
db 3 dup(?)
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov dx,offset ts
mov ah,09h
int 21h
mov dx,offset input
MOV ah,0AH
int 21h
call exchang
mov cx,ax
sub cx,1
lp1: mul cx
loop lp1
mov cx,ax
mov dl,0AH
MOV AH ,02H
int 21h
mov dl,0DH
MOV AH ,02H
int 21h
mov ax,cx
call print
mov ah,4ch
int 21h
exchang proc near
mov al,[input+2]
mov ah,0
sub ax,30h
mov bx,10
mul bx
mov BL,[input+3]
mov bh,0
sub bx,30h
add ax,bx
ret
exchang endp
print proc near
mov cx,10
mov si,0
lp3: div cx
mov [pt+si],ah
inc si
mov al,ah
mov ah,0
cmp ax,0
jnz lp3
mov di,0
lp4: dec si
mov al,[pt+si]
add al,30h
mov [pri+di],al
inc di
cmp si,0
jnz lp4
mov [pri+di],'$'
mov dx,offset pri
mov ah,09h
int 21h
ret
print endp
code ends
end start