作者:knightkant 此贴贴于2004-3-30 0:05:38,已被阅读699次/回复3 
请教INT 16H的1号功能
想写个循环程序,然后利用INT 16H的1号功能检测是否键盘有键按下
如果有,就马上读取它的扫描码,在实验仪上显示出来
没有则继续循环显示上一次按键的结果
我现在的问题在于 第一次的检测没问题,按了哪个键肯定准确的知道了
可是下一个循环过来检测是否有按键,按的哪个键就出问题了
它总是输出我第一次按键的值,后面按的都不理睬,十分郁闷
然后看了INT 16H 它一号功能的详细说明
说什么
INT 16 - KEYBOARD - CHECK FOR KEYSTROKE
   AH = 01h
Return: ZF set if no keystroke available
   ZF clear if keystroke available
       AH = BIOS scan code
       AL = ASCII character
Note:   if a keystroke is present, it is not removed from the keyboard buffer;
     however, any extended keystrokes which are not compatible with 83/84-
     key keyboards are removed by IBM and most fully-compatible BIOSes in
     the process of checking whether a non-extended keystroke is available
   some (older) clone BIOSes do not discard extended keystrokes and manage
     function AH=00h and AH=10h the same
   the K3PLUS v6.00+ INT 16 BIOS replacement doesn't discard extended
     keystrokes (same as with functions 10h and 20h), but will always
     translate prefix E0h to 00h. This allows old programs to use extended
     keystrokes and should not cause compatibility problems
看到上面写着好像无法REMOVE我第一次的按键值,这个太郁闷了
不知道有没有什么办法能让程序接收到我第二,三,四次的结果?

此贴的回复贴(直接):
应该不会有问题,把你的程序贴上来!!!609 蓝天星 2004-3-30 8:00:04 0 正常
你可以用AH=0CH的DOS功能调用!554 echojihui 2004-3-30 9:24:12 101 正常
需求恢复475 snowball_lin 2011-3-15 16:02:41 0 正常