DATA SEGMENT
input db 'please input(0-9): $'
tab dw 0,1,8,27,64,125,216,343,512,729
inerror db 0dh,0ah,'input error! $'
x db ?
xxx dw ?
data ends
code segment
assume cs:code,ds:data
main proc far
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov dx,offset input
mov ah,9
int 21h
mov ah,1
cmp al,'0'
jb error
cmp al,'9'
ja error
and al,0fh
mov x,al
mov bl,al
mov bh,0
add bx,bx
mov ax,tab[bx]
mov xxx,ax
exit: ret
error: mov dx,offset inerror
mov ah,9
int 21h
jmp exit
code ends
end main
高手帮俺看看,不对怎么不能输入数字!只能显示:please input (0-9):
input error:
怎么回事啊!