基于51单片机的8个小彩灯花样流水灯proteus仿真汇编语言
仿真电路如下图所示: 部分代码:
ORG 0000H
AJMP START
ORG 0003H
AJMP INTR0
ORG 0013H
AJMP INTR1
START:MOV IE,#85H
MOV IP,#01H
MOV TCON,#00H
MOV SP,#60H
MOV P0,#0FFH
MOV P3,#0FFH
MOV A,#0FEH
LP1:MOV P0,A
RL A
LCALL DELAY
SJMP LP1
INTR0:PUSH ACC
PUSH PSW
MOV R1,#10
MOV A,#00H
XH: MOV P0,A
LCALL DELAY
CPL A
DJNZ R1,XH
POP PSW
POP ACC
RETI
INTR1:PUSH ACC
PUSH PSW
MOV A,#7FH
MOV R2,#16
XH1:MOV P0,A
LCALL DELAY
RR A
DJNZ R2,XH1
共有 0 条评论