【发布时间】:2013-12-06 09:31:02
【问题描述】:
我的老师要求我编写一个程序,该程序最多可容纳 100 个数字,并在用户按下 ALT 键时停止。
并且每当用户按下 ENTER 键时也会转到下一个数字。
但我知道怎么做,因为 ALT 键没有 ASCII 码,我必须使用 INT 16H 的服务之一。
但是我该如何使用呢?
我写了一个我认为可能是正确的代码,但响应是用户应该按两次键。
请帮助如何解决它?
这是我的代码:
.....
下一个数字:mov AH,07H int 21H CMP AL,0DH ; check if the user pressed ENTER ! JNE check_digit ; goes to calculate the number ! CMP BH,6 ;if nothing entered ! JE next_digit ;*************************************************** ;* I think here is the place to put this code : * ;* * ;* mov AH,02H * ;* int 16H * ;* CMP AL,00001000B * ;* JE END * ;*************************************************** ....
【问题讨论】:
标签: assembly decimal cpu-registers x86-16