ORG 00H
SJMP MAIN
CLK EQU P3.1
LATCH EQU P3.2
SERIAL EQU P3.0
MAIN :
MOV A,#0FFH
MOV DPTR, #BANG
MOV R1,#0
MOV R2,#00000001B
MOV P2,#00000000B
LOOP:
MOV P2,R2
MOV A,R1
MOVC A,@A+DPTR
CALL DICH
MOV R3,#200
DJNZ R3,$
INC R1
MOV A,R2
RL A
MOV R2,A
CJNE R1,#6,LOOP
SJMP MAIN
DICH:
MOV R7,#8
LAP:
RRC A
MOV SERIAL,C
CLR CLK
NOP
NOP
NOP
SETB CLK
CLR LATCH
NOP
NOP
NOP
SETB LATCH
DJNZ R7,LAP
RET
BANG:
DB 0FFH,0FFH,081H,0FDH,0FDH,0FDH,0FFH,0FFH
END
SJMP MAIN
CLK EQU P3.1
LATCH EQU P3.2
SERIAL EQU P3.0
MAIN :
MOV A,#0FFH
MOV DPTR, #BANG
MOV R1,#0
MOV R2,#00000001B
MOV P2,#00000000B
LOOP:
MOV P2,R2
MOV A,R1
MOVC A,@A+DPTR
CALL DICH
MOV R3,#200
DJNZ R3,$
INC R1
MOV A,R2
RL A
MOV R2,A
CJNE R1,#6,LOOP
SJMP MAIN
DICH:
MOV R7,#8
LAP:
RRC A
MOV SERIAL,C
CLR CLK
NOP
NOP
NOP
SETB CLK
CLR LATCH
NOP
NOP
NOP
SETB LATCH
DJNZ R7,LAP
RET
BANG:
DB 0FFH,0FFH,081H,0FDH,0FDH,0FDH,0FFH,0FFH
END