鍵盤掃描程式碼↓
ZERO EQU30H
ONE EQU31H
KEYTEMP EQU32H
KEYDATA EQU33H
SCANLINE EQU34H
ORG00H
MOVKEYTEMP,#FFH
MOVKEYDATA,#FFH
MOVDPTR,#TABLE
LOOP:ACALLKEYSCAN
MOVA,#FFH
XCHA,KEYDATA
CJNEA,#FFH,DISP
SJMPLOOP
DISP:MOVCA,@A+DPTR
MOVP1,A
SJMPLOOP
KEYSCAN:PUSHA
MOVR1,#4
MOVSCANLINE,#F7H
COL:MOVA,SCANLINE
MOVP3,A
MOVA,P3
ANLA,#F0H
MOVR2,#4
ROW:SETBC
RLCA
JNCKEYIN
DJNZR2,ROW
MOVA,SCANLINE
RRA
MOVSCANLINE,A
DJNZR1,COL
INCONE
MOVA,ONE
CJNEA,#5,K3
MOVZERO,#0
MOVKEYTEMP,#FFH
MOVKEYDATA,#FFH
SJMPK3
KEYIN:MOVONE,#0
MOVA,R2
DECA
XRLA,#03H
MOVR2,A
MOVA,R1
DECA
XRLA,#03H
RLA
RLA
ADDA,R2
CJNEA,KEYTEMP,K2
MOVA,ZERO
CJNEA,#5,K1
SJMPK3
K1:INCZERO
MOVA,ZERO
CJNEA,#5,K3
MOVA,KEYTEMP
MOVKEYDATA,A
SJMPK3
K2:MOVKEYTEMP,A
MOVZERO,#1
K3:POPA
RET
TABLE:DB1EH;15
DB0EH;14
DB49H;13
DB8EH;12
DB0BH;11
DB68H;3
DB0AH;6
DB28H;9
DB18H;10
DB4CH;2
DB2AH;5
DB08H;8
DB88H;0
DBF9H;1
DB39H;4
DBF8H;7
END
我要問KEYDATA這個值在何時改變,
(MOVCA,@A+DPTR) 的累積器A 值是在哪個地方決定。
[以上的問題主要的意思是問他的(程式碼)"查表"是怎麼找的]
2006-09-20 14:03:13 · 1 個解答 · 發問者 ? 1 in 電腦與網際網路 ➔ 程式設計
高手們 幫幫忙!!
2006-09-25 13:19:09 · update #1
詳細解答我已寄給你
請到你的信箱看看
若有問題可以再問我
2006-09-26 10:44:16 · answer #1 · answered by 小心我的獵頭腳 1 · 0⤊ 0⤋