ORG 0000H
AJMP BEGIN
ORG 000BH
AJMP CTC0
ORG 001BH
AJMP CTC1
ORG 0030H
BEGIN:MOV R2,#12H
MOV R3,#34H
MOV TMOD,#52H
MOV TL0,#06
MOV TH0,#06
MOV TL1,#30H
MOV TH1,#0F8H
SETB 00H
SETB TR0
SETB TR1
MOV IE,#8AH
MAIN:JB P1.0,J1
CLR 00H
J1: JB P1.1,DISP
SETB 00H
DISP: MOV P0,R3
MOV P2,R2
AJMP MAIN
CTC0:CPL P1.7
RE
ti
CTC1:JB 00H,R
MOV R0,#04H
LOOPL: MOV A,R3
MOV C,ACC.7
MOV A,R2
RLC A
MOV R2,A
MOV A,R3
RLC A
MOV R3,A
DJNZ R0,LOOPL
AJMP RESET
R:MOV R0,#04H
LOOPR: MOV A,R2
MOV C,ACC.0
MOV A,R3
RRC A
MOV R3,A
MOV A,R2
RRC A
MOV R2,A
DJNZ R0,LOOPR
RESET: MOV TL1,#30H
MOV TH1,#0F8H
RETI
END
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>