mov ax, 0100h
int 16h
jz no_key
; Handle case if there is a key press here
; AH will contain the scan code; AL will contain the ASCII code
no_key:
; Handle case if there is no key press here
使用JNZ:
mov ax, 0100h
int 16h
jnz key_pressed
; Handle case if there is no key press here
key_pressed:
; Handle case if there is a key pressed here
; AH contains the scan code; AL contains the ASCII code
1条答案
按热度按时间bprjcwpo1#
如您所见,当没有可用的击键时为here、
ZF=1
,当有可用的击键时为ZF=0
。使用
JZ
:使用
JNZ
: