求大神解决 帮写一个程序 51单片机流水灯程序P1.0到1.7再加上P0.0到0.5依次点亮再整体闪三下
1个回答
展开全部
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV A,#0FEH
MOV B,#0FFH
MOV P1,A
MOV P0,B
MOV R2,#14
LOOP:
LCALL DELAY
RLC A
XCH A,B
RLC A
MOV C,ACC.6
XCH A,B
MOV ACC.0,C
MOV P1,A
MOV P0,B
DJNZ R2,LOOP
MOV R2,#3
LOOP1:
MOV P0,#00H
MOV P1,#00H
LCALL DELAY
MOV P1,#0FFH
MOV P0,#0FFH
DELAY
DJNZ R2,LOOP1
SJMP $
DELAY:
MOV R6,#200
DLY:
MOV R7,#250
DJNZ R7,$
DJNZ R6,DLY
RET
END
LJMP MAIN
ORG 0030H
MAIN:
MOV A,#0FEH
MOV B,#0FFH
MOV P1,A
MOV P0,B
MOV R2,#14
LOOP:
LCALL DELAY
RLC A
XCH A,B
RLC A
MOV C,ACC.6
XCH A,B
MOV ACC.0,C
MOV P1,A
MOV P0,B
DJNZ R2,LOOP
MOV R2,#3
LOOP1:
MOV P0,#00H
MOV P1,#00H
LCALL DELAY
MOV P1,#0FFH
MOV P0,#0FFH
DELAY
DJNZ R2,LOOP1
SJMP $
DELAY:
MOV R6,#200
DLY:
MOV R7,#250
DJNZ R7,$
DJNZ R6,DLY
RET
END
更多追问追答
追问
亲 能加个注释么 就是每一条的指令都是什么意思
追答
这么简单的语句还要加注释?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询