用發(fā)光二極管實現(xiàn)跑馬燈--單片機仿真實驗
作業(yè)題目:用匯編語言實現(xiàn)跑馬燈
本文引用地址:http://m.butianyuan.cn/article/201611/320744.htm作業(yè)要求:用發(fā)光二極管實現(xiàn)跑馬燈效果,八個發(fā)光二極管從上到下跑兩遍,閃兩下;
程序流程圖:
發(fā)光二極管的應(yīng)用仿真效果圖:
匯編語言的源程序:
LED EQ P1
ORG 00H
SJMP Start
ORG 30H
Start: MOV
NEXT: MOV
MOV
ACALL
AA: RL A
DJNZ
MOV
DJNZ
BB: CRL A
DJNZ R0,BB
NEXT1:MOV
DJNZ
MOV
DJNZ
BB: CRL A
DJNZ R0,BB
AJMP Start
DELAY: MOV R6,#50H
DJNZ R5,DELAY
RET
END
評論