getkey.asm
来自「开放源码的编译器open watcom 1.6.0版的源代码」· 汇编 代码 · 共 41 行
ASM
41 行
include ..\cwlib.inc
scode
;-------------------------------------------------------------------------
;
;Get key press info.
;
;On Entry:
;
;none.
;
;On Exit:
;
;AL - ASCII character code.
;AH - Hardware key code.
;EAX high word - Shift keys status word from 417h.
;
GetKey proc near
push ebx
xor ebx,ebx
mov ah,1
int 16h ;keypress waiting?
jz l0
mov ah,0
int 16h ;get key codes.
movzx ebx,ax
l0: push es
mov es,ZeroSelector
movzx eax,es:w[417h] ;get shift status.
pop es
shl eax,16
or eax,ebx
pop ebx
ret
GetKey endp
efile
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?