求跑马灯程序word文档
发布网友
发布时间:2024-07-13 10:41
我来回答
共1个回答
热心网友
时间:2024-08-19 16:29
;10.12.29 外部中断1按键按下,P1流水灯(跑马灯),P2鸳鸯戏水灯
ORG 0000H
AJMP MAIN
ORG 03H
AJMP EX0INT
ORG 0030H
MAIN: MOV SP,#60H
SETB EA
SETB EX0
SETB IT0
MOV R0,#8
JNB F0,MAIN
MOV A,#0FEH
LED: MOV P1,A
MOV P2,#0AAH
ACALL DLY
MOV P2,#55H
ACALL DLY
RL A
DJNZ R0,LED
MOV R0,#8
AJMP LED
EX0INT: SETB F0
RETI
DLY: MOV R7,#20
MOV R6,#20
MOV R5,#250
DJNZ R5,$
DJNZ R6,$-4
DJNZ R7,$-8
RET
END