计算机编程中的键盘输入与视频编程技术
在计算机编程领域,键盘输入和视频编程是非常重要的部分。下面将详细介绍键盘输入相关的程序以及视频编程的相关知识。
键盘输入程序
以下是一个键盘输入相关的程序代码:
mov
eax,300
;
delay for
300
ms
call
Delay
INVOKE ClearKeyboard,
ESCkey
check for Esc key
jnz
Li
continue loop if ZF=O
quit:
call
Clrscr
exit
main
ENDP
Cl earKeyboard
PROC.
scanCode : BYTE
Clears
the keyboard while checking for
a
particular
scan
code.
Receives:
keyboard
scan
code
Returns:
Zero flag
set if the ASCII
code is
found;
otherwise,
Zero flag is clear.
push
ax
Li:
mov
ah,iih
;
check keyboard buffer
mt
i6h
;
any key pressed?
jz
noKey
;
no:
exit
now
nov
ah,iOh
;
yes:
remove
from buffer
mt
i6h
cmp
ah,scanCode
;
was it the exit key?
je
quit
;
yes:
exit
now
(ZF=i)
jmp
Li
;
no:
check
buffer again
noKey:
;
no key pre
超级会员免费看
订阅专栏 解锁全文
79

被折叠的 条评论
为什么被折叠?



