分支程序设计的问题
目的:如果输入数字在1-5之间显示Input right !,如果不是则显示Input erro !
.model small
.stack 256
.data
msg db 'Input number 1-5:',0dh,0ah,'$'
rmsg db 'Input right !',0dh,0ah,'$'
ermsg db 'Input erro !',0dh,0ah,'$'
.code
.startup
start1: mov dx,offset msg
mov ah,9
int 21h
mov ah,1
int 21h
cmp al,'1'
jb erin
cmp al,'8'
ja erin
jmp done
erin: mov dx,offset ermsg
rtin: mov dx,offset rmsg
done: mov ah,9
int 21h
.exit 0
end
可是上面的程序不能实现,哪里错了?
不是作业,是我自己尝试学习分支时遇到的问题
也请大家给出设计分支程序的经验和技巧,谢谢