0
我写了代码,但我不知道它为什么会永远提示用户,实际上它永远不会结束,除非按Enter键而不提供任何数字。 这的代码:为什么这个程序集代码做jmp永远
output prompt1;
inputs number,16 ;
atoi number ;
mov max,ax ;
mov cx , 10 ;
do: dec cx ;
output prompt1;
inputs number,16;
atoi number ;
cmp ax, max;
jge l1;
cmp cx , 1;
jne do ;
je exit;
l1: mov max ,ax ;
jmp do ;
exit:
output prompt2;
itoa number , max;
output number;
的输入和输出一些用户接口设备和itoa,的atoi是整数ASCII和分别反之亦然,但我要强调的点“的atoi”将结果保存在ax寄存器中。
而另一个问题,我有,如何设计{或使}这样这些{如果,而对于C/C++风格}算法更完善的风格?
非常感谢。