GET_KEY: MOV A,#0FEH
G_IT1: MOV P1,#0FFH
MOV P3,A
PUSH A
MOV A,P1
CPL A
JNZ STORE
POP A
RL A
SJMP G_IT1
STORE: MOV R7,A
POP A
CPL A
MOV R6,A
RET
GET_K_NUM:MOV A,R7
MOV R4,#00H
ROL1: RR A
JNB ACC.7,COUNT1
SJMP OK1
COUNT1: INC R4
SJMP ROL1
OK1: MOV A,R4
MOV R7,A
MOV A,R6
MOV R4,#00H
ROL2: RR A
JNB ACC.7,COUNT2
SJMP OK2
COUNT2: INC R4
SJMP ROL2
OK2: MOV A,R4
MOV B,#04H
MUL AB
ADD A,R7
MOV DPTR,#NUMB
MOVC A,@A+DPTR
MOV R3,A
RET
;;;;;;;;;;;;;;;;;修正字位系列子程序;;;;;;;;;;;;;;;;;;;;;;
CORRECT:MOV A,71H
CJNE A,#00H,LEF_CO
CJNE R0,#79H,CO_IT
MOV R0,#7EH
SJMP CO_OUT
CO_IT: DEC R0
SJMP CO_OUT
LEF_CO: CJNE R0,#7EH,CO_IT2
MOV R0,#79H
SJMP CO_OUT
CO_IT2: INC R0
CO_OUT:RET
CORRECT1:CJNE R0,#7DH,CON_DO
MOV R0,#79H
SJMP LR1
CON_DO: CJNE R0,#7EH,CON_DO1
MOV R0,#7AH
SJMP LR1
CON_DO1:INC R0
INC R0
LR1: RET
CORRECT2:CJNE R0,#7AH,CON_DO3
MOV R0,#7EH
SJMP LR2
www.751com.cn
LR2: RET
;;;;;;;;;;;;;;;计算速度系数子程序;?;;;;;;;;;;;;;;;;
COMPUTE: MOV A,R3
ANL A,#0FH
MOV R7,A
MOV A,#02H
RE_ROLL:RL A
DJNZ R7,RE_ROLL
MOV B,#6H
MUL AB
MOV 70H,A
RET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
TAB:DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H
DB 80H,90H,88H,83H,0C6H,0A1H,86H,8EH,0FFH
NUMB: DB 00H,01H,04H,07H
DB 0FH,02H,05H,08H
DB 0EH,03H,06H,09H
DB 0DH,0CH,0BH,0AH
DB 13H,12H,11H,10H
DB 16H,15H,14H,0FFH
上一页 [1] [2] [3] [4] [5] [6] [7]