[求助]帮我看一下怎么改正这道程序!老大们帮帮忙,十万火急
编写程序输入两个十进制数据(如76,32),然后再输入任何一个四则运算符(如 “+”)请求出两个十进制的四则运算结果,并在显示屏幕上输出该10进制数结果,如76+32的和值“108”。data segment
string1 db 'please input the first num:$'
string2 db 13,10,'please input the second num:$'
x dw ?
y dw ?
result dw ?
data ends
code segment
assume ds:data,cs:code
main proc far
start: mov ax,data
mov ds,ax
mov dx,offset string1
mov ah,9
int 21h
lea si,x
call input
mov dx,offset string2
mov ah,9
int 21h
lea si,y
call input
lea si,result
call operate
lea si,result
call disp
main endp
input proc far
push ax
push bx
xor bx,bx
t0: mov ah,1
int 21h
cmp al,0dh
je t1
and ax,00ffh
add bx,ax
jmp t0
t1: mov [si],bx
pop bx
pop ax
ret
input endp
operate proc far
push ax
push bx
mov bx,x
mov ah,2
int 21h
cmp al,'+'
je L1
cmp al,'-'
je L2
cmp al,'*'
je L3
cmp al,'/'
je L4
L1:add bx,y
jmp L0
L2:sub bx,y
jmp L0
L3:mov ax,y
mul bx
mov ax,bx
jmp L0
L4:mov ax,bx
mov bx,y
div bx
mov bx,ax
L0:mov [si],bx
pop ax
pop bx
ret
operate endp
disp proc far
mov ax,[si]
mov bx,10
xor cx,cx
again:xor dx,dx
div bx
push dx
inc cx
cmp ax,0
je K
jmp again
K: pop dx
or dx,30h
mov ah,2
int 21h
loop K
ret
disp endp
code end
end main
为什么在emu8086上运行时出现(17) cannot assemble far call.
(17) refer to far_call-2.asm in examples.的句子呢???指的是第十七句call input那里。
如果有会做的也可以帮我做出来,十分感谢!!