写一个流水灯从左到右再从右到左
ORG 00H
START:
CLR C
MOV A,#0FFH
RIGHT:
MOV R1,#08H
CALL DELAY
RLC A
MOV P1,A
DJNZ R1,RIGHT
LEFT:
MOV R2,#08H
CALL DELAY
MOV P1,A
RRC A
DJNZ R2,LEFT
JMP START
DELAY:
MOV R3,#50
D1:
MOV R4,#20
D2:
MOV R5,#248
DJNZ R5,$
DJNZ R4,D2
DJNZ R3,D1
RET
END
貌似有死循环 可是自己看不出
此帖出自
小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
LJMP START
ORG 30H
START:
CLR C
MOV A,#0FFH
MOV R1,#08H
RIGHT:
CALL DELAY
RLC A
MOV P1,A
DJNZ R1,RIGHT
MOV R2,#08H
LEFT:
CALL DELAY
MOV P1,A
RRC A
DJNZ R2,LEFT
JMP START
DELAY:
MOV R3,#50
D1:
MOV R4,#20
D2:
MOV R5,#248
DJNZ R5,$
DJNZ R4,D2
DJNZ R3,D1
RET
END
一周热门 更多>