; ***********************************************
; * Function : 8 LED闪光程序 *
; * 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:
CLR PAC
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
上一篇:HT48R50A的7段数码管显示程序
下一篇:KEY_按键示例程序
推荐阅读最新更新时间:2024-03-16 15:53