怎么用80c51单片机编写一个跑马灯程序

2024-12-31 01:00:46
推荐回答(1个)
回答1:

ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV A,#0FEH
LOOP:
MOV P1,A
RL A
LCALL DELAY
SJMP LOOP
DELAY:
MOV R2,#200
DLY:
MOV R3,#250
DJNZ R3,$
DJNZ R2,DLY
RET
END