; ***********************************************
; * Function : 8LED閃光程序 *
; * MICroProcessor : HT48R50A-1/28SKDIP-A *
; *Author: www.picr.com *
; * Crystal : 4MHz *
; ***********************************************
#INCLUDE HT48R50A-1.INC
;------------------------------------------------
DATA .SECTION AT 60H 'DATA'
DELAY_COUNTER_1 DB ? ;[60H]
DELAY_COUNTER_2 DB ? ;[61H]
LOOP_COUNTER DB ? ;[62H]
LED_DATA DB ? ;[63H]
;------------------------------------------------
CODE .SECTION AT 00H 'CODE'
ORG 00H
JMP START
START:
CLRPAC
MOV A,01H
MOV LED_DATA,A
LOOP:
MOV A,07H
MOV LOOP_COUNTER,A
LEFT:
MOV A,LED_DATA
MOV PA,A
CALL DELAY
RL LED_DATA
SDZ LOOP_COUNTER
JMP LEFT
MOV A,07H
MOV LOOP_COUNTER,A
RIGHT:
MOV A,LED_DATA
MOV PA,A
CALL DELAY
RR LED_DATA
SDZ LOOP_COUNTER
JMP RIGHT
JMP LOOP
RET
;------------------------------------------------
DELAY PROC
MOV A,0FFH
MOV DELAY_COUNTER_1,A
MOV DELAY_COUNTER_2,A
WAIT:
SDZ DELAY_COUNTER_2
JMP WAIT
SDZ DELAY_COUNTER_1
JMP WAIT
RET
DELAY ENDP
;------------------------------------------------
END