帮我看下哪错了
data segmentnum1message db 'please input num:','$'
num2message db 'please input num2:','$'
resultmessage db 'result:','$'
yushumessage db 'yushu:','$'
choiced db 'add sub mul div','$'
pleasechoice db 'choice num you wan','$'
continue db '-----------------------------','$'
exit db 'if you want to exit,input 0','$'
exit_input db ?
num1 db 50,0,50 dup(?)
num2 db 50,0,50 dup(?)
result dw ?
yushu dw ?
factor db 10
data ends
stack segment
dw 100 dup(?)
tos label word
stack ends
code segment
assume cs:code,ds:data
main proc far
start:
mov ax,stack
mov ds,ax
lea sp,tos
push ds
xor ax,ax
push ax
mov ax,data
mov ds,ax
loop_main:
call init
call choice
lea dx,num1message;
call message
lea dx,num1;
call input ;
push bx
mov dl,0ah
mov ah,02h
int 21h
mov dl,0dh
mov ah,02h
int 21h
lea dx,num2message
call message
lea dx,num2
call input
push ax
cmp al,'1'
jz result_sum
cmp choiced,'2'
jz result_sub
cmp choiced,'3'
jz result_mul
cmp choiced,'4'
jz result_div
result_sum:
call sum
jmp printf_result
result_sub:
call substract
jmp printf_result
result_mul:
call mult
jmp printf_result
result_div:
call divs
printf_result:
call ctr1
lea dx,resultmessage
call message
call output
;------------
call ctr1
cmp choiced,'4'
jnz end_print
lea dx,yushumessage
call message
mov ax,yushu
mov result,ax
call output
call ctr1
;------------------
end_print:
lea dx,exit
call message
call ctr1
lea dx,continue
call message
call ctr1
mov ah,01h
int 21h
cmp al,'0'
jnz loop_main
pop ax
pop ds
mov ax,4c00h
int 21h
main endp
;-------------------------sub program
sum proc near
push bp
mov bp,sp
push si
push di
mov si,[bp+6] ;
mov di,[bp+4] ;
add di,si
mov result,di
pop di
pop si
pop bp
ret 4
sum endp
substract proc near
push bp
mov bp,sp
push si
push di
mov di,[bp+6]
mov si,[bp+4]
sub di,si
mov result,di
pop di
pop si
pop bp
ret 4
substract endp
mult proc near
push bp
mov bp,sp
push ax
push bx
mov ah,0
mov al,byte ptr [bp+6]
mov bh,0
mov bl,byte ptr [bp+4]
mul bl
mov result,ax
pop bx
pop ax
pop bp
ret 4
mult endp
divs proc near
push bp
mov bp,sp
push ax
push bx
mov ax,[bp+6]
mov dx,0
mov bx,[bp+4]
div bx
mov result,ax
mov yushu,dx
pop dx
pop ax
pop bp
ret 4
divs endp
init proc near
lea dx,choiced
call message
call ctr1
lea dx,pleasechoice
call message
call ctr1
ret
init endp
choice proc near
mov ah,01h
int 21h
mov choiced,al
call ctr1
ret
choice endp
ctr1 proc near
mov dl,0ah
mov ah,02h
int 21h
mov dl,0dh
int 21h
ret
ctr1 endp
input proc near
mov al,0
mov ah,0ah
int 21h
add dx,1
mov si,dx
mov cl,[si]
mov ch,0
mov bx,0
next: mov ax,bx
mul factor
mov bx,ax
inc si
mov al,[si]
mov ah,0
sub al,30h
add bx,ax
loop next
ret
input endp
output proc near
mov ax,result
mov dx,0
mov cx,0
loop1: div word ptr factor
push dx
inc cx
cmp ax,0
jz show
jmp loop1
show: pop dx
add dx,30h
mov ah,02h
int 21h
loop show
ret
output endp
message proc near
mov ah,09h
ret
message endp
code ends
end start