jnz label 若運算結果不為0 則跳到label所指的地方
kbRead:
WaitLoop: in al, 64h ; Read Status byte
and al, 10b ; Test IBF flag (Status<1>) a1==0000時,input buffer是empty a==0010時,input buffer不是empty表有新input資料可以讀
jz WaitLoop ; Wait for IBF = 1
in al, 60h ; Read input buffer
kbWrite:
WaitLoop: in al, 64h ; Read Status byte
and al, 01b ; Test OBF flag (Status<0>) a1==0000時,output buffer是empty a==0001時 output buffe不是empty表output buffer不可以寫
jnz WaitLoop ; Wait for OBF = 0
out 60h, cl ; Write data to output buffer
參考:
http://www.computer-engineering.org/ps2keyboard/
mail2.dwu.edu.tw/~ezliang/Assembly/97B_PDF/07_JUMP.pdf
沒有留言:
張貼留言