ORG 0000H
MAIN: MOV DPTR,#TABLE
MOV A,#00H
MOV P2,#00H
LOOP: PUSH ACC
MOVC A,@A+DPTR
MOV P1,A
POP ACC
INC A
ACALL DELAY
CJNE A,#8,LOOP
MOV DPTR,#TABLE1
MOV A,#00H
MOV P1,#00H
LOOP1: PUSH ACC
MOVC A,@A+DPTR
MOV P2,A
POP ACC
INC A
ACALL DELAY
CJNE A,#8,LOOP1
SJMP MAIN
DELAY: MOV R7,#0FFH
DLY: MOV R6,#0FFH
DJNZ R6,$
DJNZ R7,DLY
RET
TABLE: DB 01H,02H,04H,08H,10H,20H,40H,80H
TABLE1: DB 80H,40H,20H,10H,08H,04H,02H,01H
END
No comments:
Post a Comment