0RG 00h
0RG 30H
START:
M0V P0,#0ffH
M0V P1,#0FFH
M0V P2,#0FFH
M0V P3,#0FFH
JB P3.7,$
SB:
M0V R4,#8
SBA:
M0V R5,#250
SBB:
JB P3.7,SXB1
DJNZ R5,SBB
DJNZ R4,SBA
M0V R4,#2
JMP SBC
SXB1:
M0V R5,#5
SXB2:
JNB P3.7,SBB
DJNZ R5,SXB2
JMP START
SBC:
M0V R5,#250
SB1:
JB P3.7,SB2
DJNZ R5,SB1
DJNZ R4,SBC
JMP START
SB2:
M0V R5,#5
SB2_A:
JNB P3.7,SB1
DJNZ R5,SB2_A
M0V R4,#3
SB2_1:
M0V R5,#250
SB3:
JNB P3.7,SXC
DJNZ R5,SB3
DJNZ R4,SB2_1
M0V R4,#2
JMP SB3_1
SXC:
M0V R5,#5
SXC1:
JB P3.7,SB3
DJNZ R5,SXC1
JMP START
SB3_1:
M0V R5,#250
SB3_2:
JNB P3.7,SB4
DJNZ R5,SB3_2
DJNZ R4,SB3_1
JMP START
SB4:
M0V R5,#5
SB4_1:
JB P3.7,SB3_2
DJNZ R5,SB4_1
M0V R1,#1AH
M0V R2,#4
PP:
M0V R3,#8
LOOP:
M0V R5,#250
LOOP2:
JB P3.7,LOOP3
DJNZ R5,LOOP2
JMP START
LOOP3:
LCALL YS1
M0V C,P3.7
JNC UUU
M0V R5,#250
LOOP4:
JNB P3.7,UUU
N0P
DJNZ R5,LOOP4
JMP START
UUU:
M0V A,@R1
RRC A
M0V @R1,A
DJNZ R3,LOOP
INC R1
DJNZ R2,PP
M0V A,1AH
XRL A,#00000000B
JNZ EXIT
M0V A,1BH
XRL A,#11111111B
JNZ EXIT
LCALL YS3
M0V A,1CH
CPL A
XRL A,1DH
JNZ EXIT
LCALL YS3
CLR P2.6
CLR P3.3
AJMP BIJIA0
AA:
M0V R1,#25
XX:
ACALL YS2
JNB P3.7,HH
DJNZ R1,XX
EXIT:
M0V P0,#0H
M0V P1,#0FFH
M0V P2,#0FFH
M0V P3,#0FFH
AJMP START
HH:
M0V R6,#4
SS:
ACALL YS1
JB P3.7,EXIT
DJNZ R6, SS
JNB P3.7, $
LCALL YS3
AJMP AA
BIJIA0:
M0V A,1CH
MOV P1,A
CJNE A,#01011100B,TT1
M0V P0,#7EH
TT1:
CJNE A,#00011110B,T2
M0V P0,#0A2H
T2:
CJNE A,#01011110B,T3
M0V P0,#62H
T3:
CJNE A,#01011000B,T4
M0V P0,#74H
T4:
CJNE A,#00011010B,T5
M0V P0,#61H
T5:
CJNE A,#01011011B,T6
M0V P0,#21H
T6:
CJNE A,#00011011B,T7
M0V P0,#7AH
T7:
CJNE A,#01011001B,T8
M0V P0,#20H
T8:
CJNE A,#01011010B,t9
M0V P0,#60H
T9:
CJNE A,#00011000B,t10
M0V P0,#28H
T10:
AJMP AA
YS1:
M0V R4,#20
D1:
M0V R5,#20
DJNZ R5,$
DJNZ R4,D1
RET
YS2:
M0V R4,#10
D2:
M0V R5,#235
DJNZ R5,$
DJNZ R4,D2
RET
YS3:
M0V R4,#2
D3:
M0V R5,#248
DJNZ R5,$
DJNZ R4,D3
RET
END