📄 jtd.htm
字号:
INTT0<BR><BR> ORG
0013H<BR> LJMP
INTT1<BR><BR> ORG
001BH<BR> LJMP
TT1<BR><BR> ORG 0100H<BR>TT1:
MOV TH1,#0D8H
;定时器1,定时10us<BR> MOV
TL1,#0F0H<BR> DJNZ
R6,EXIT<BR> MOV R6,#100
;定时器定时100次<BR> MOV
R1,#0FFH<BR>EXIT: RETI<BR><BR>INTT0:MOV
P1,#0BEH
;外部中断0,<BR> JB
P3.4,$<BR>
RETI<BR><BR>INTT1:MOV P1,#0BBH
;外部中断1,<BR> JB
P3.4,$<BR> RETI<BR><BR>
ORG 1000H<BR>MAIN: MOV
R6,#100
;主程序;<BR> MOV
R1,#00H<BR> MOV
TMOD,#10H
;初始化<BR> MOV
TH1,#0D8H<BR> MOV
TL1,#0F0H<BR> MOV
IE,#8DH<BR> MOV
20H,#25<BR> MOV
21H,#5<BR> MOV
22H,#15<BR> MOV
23H,#30<BR> MOV
24H,#20<BR> SETB
TR1<BR><BR>ST1: MOV P1,#0BBH
;第一个状态,主干道亮绿灯、支干道亮红灯;<BR> CJNE
R1,#0FFH,TZ1<BR> MOV
R1,#00H<BR> DEC
20H<BR> DEC 23H<BR>TZ1:
MOV R2,20H<BR> MOV
R3,23H<BR> LCALL DISP
;调用显示子程序。<BR><BR> MOV
A,20H<BR> CJNE
A,#00H,ST1<BR> MOV
20H,#25<BR><BR>ST2: MOV P1,#0BDH
;第二个状态,主干道亮黄灯、支干道亮红灯;<BR> CJNE
R1,#0FFH,TZ2<BR> MOV
R1,#00H<BR> DEC
21H<BR> DEC 23H<BR>TZ2:
MOV R2,21H<BR> MOV
R3,23H<BR> LCALL DISP
;调用显示子程序。<BR> MOV
A,21H<BR> CJNE
A,#00H,ST2<BR> MOV
21H,#05<BR> MOV
23H,#30<BR><BR>ST3: MOV P1,#0DEH
;第三个状态,主干道亮红灯、支干道亮绿灯;<BR> CJNE
R1,#0FFH,TZ3<BR> MOV
R1,#00H<BR> DEC
24H<BR> DEC 22H<BR>TZ3:
MOV R2,24H<BR> MOV
R3,22H<BR> LCALL DISP
;调用显示子程序。<BR> MOV
A,22H<BR> CJNE
A,#00H,ST3<BR> MOV
22H,#15<BR><BR>ST4: MOV P1,#0EEH
;第四个状态,主干道亮红灯、支干道亮黄灯;<BR> CJNE
R1,#0FFH,TZ4<BR> MOV
R1,#00H<BR> DEC
24H<BR> DEC 21H<BR>TZ4:
MOV R2,24H<BR> MOV
R3,21H<BR> LCALL DISP
;调用显示子程序。<BR> MOV
A,21H<BR> CJNE
A,#00H,ST4<BR> MOV
21H,#05<BR> MOV
24H,#20<BR> LJMP ST1
;跳转到第一个状态。<BR><BR>DISP: MOV
A,R2
;显示子程序。<BR>
MOV B,#10<BR> DIV
AB<BR> MOV
60H,A<BR> MOV
61H,B<BR><BR> MOV
A,R3<BR> MOV
B,#10<BR> DIV
AB<BR> MOV
62H,A<BR> MOV
63H,B<BR><BR> MOV
40H,#04H<BR> MOV
R5,#0FEH<BR> MOV
R0,#60H<BR>LLP: MOV A,@R0<BR>
MOV DPTR,#TABLE<BR>
MOVC A,@A+DPTR<BR> MOV
P0,A<BR> MOV
A,R5<BR> MOV
P2,A<BR> RL
A<BR> MOV R5,A<BR>
INC R0<BR>
LCALL DELAY1<BR> DJNZ
40H,LLP<BR> RET<BR><BR>DELAY1:
;延时子程序<BR> MOV
R4,#1<BR>DL2: MOV R7,#1<BR>
DJNZ R7,$<BR> DJNZ
R4,DL2<BR> RET<BR><BR>TABLE:DB
3FH,06H,5BH,4FH,66H<BR> DB
6DH,7DH,07H,7FH,6FH<BR><BR>
END<BR>;请大家多指教!<BR></SPAN></TD></TR></TBODY></TABLE></SPAN></TD></TR>
<TR>
<TD width=8><IMG height=2 src="jtd.files/blank.gif" width=8></TD>
<TD vAlign=bottom><BR>
<TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all"
cellSpacing=0 cellPadding=0 width=332 border=0>
<TBODY>
<TR>
<TD><IMG height=17 src="jtd.files/signature.gif" width=500
border=0><BR>收获和付出是成正比的!</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE class=TBone cellSpacing=1 cellPadding=5 width="100%" align=center
bgColor=#cccccc border=0>
<TBODY>
<TR class=TBBG1 bgColor=#eeeeee>
<TD vAlign=top align=middle width=150 height=20><IMG height=2
src="jtd.files/null.gif" width=150>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><A
href="http://www.01mcu.net/bbs/User/LookUserInfo.asp?ID=1"><IMG
height=32 src="jtd.files/sy.jpg" width=32 border=0></A></TD>
<TD vAlign=top align=right><IMG height=21 alt=帅哥,离线
src="jtd.files/OfMale.gif" width=23
align=absMiddle></TD></TR></TBODY></TABLE><IMG height=5
src="jtd.files/null.gif" width=2 border=0><BR><A
href="http://www.01mcu.net/bbs/User/LookUserInfo.asp?ID=1">Lsong</A> </TD></TR>
<TR>
<TD><IMG height=5 src="jtd.files/null.gif" width=2 border=0><BR><IMG
title=级别:大天使 height=11 src="jtd.files/level12.gif" width=110
align=absMiddle><BR><IMG height=5 src="jtd.files/null.gif" width=2
border=0><BR>职务:<FONT class=BlueFont
color=blue>区版主</FONT><BR>级别:大天使<BR>魅力:3<BR>积分:5326<BR>经验:198915<BR>文章:5591<BR>注册:03-05-22
19:15 <BR></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top height=20>
<TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" height="100%"
width="100%">
<TBODY>
<TR>
<TD width=2><IMG height=2 src="jtd.files/blank.gif" width=2></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD><IMG height=20 src="jtd.files/face0.gif" width=20
align=absBottom>发表: 2006-06-20 10:15:15<IMG height=3
src="jtd.files/null.gif" width=5 align=absMiddle><A
href="http://www.01mcu.net/bbs/Announce/Announce2.asp?BoardID=7&ID=27778&submitflag=first&repost=1"><IMG
title=引用回复 height=16 src="jtd.files/re.gif" width=16
align=absMiddle border=0></A><IMG height=3
src="jtd.files/null.gif" width=5 align=absMiddle><A
href="http://www.01mcu.net/" target=_blank><IMG title=此用户主页
height=16 src="jtd.files/home.gif" width=16 align=absMiddle
border=0></A><IMG height=3 src="jtd.files/null.gif" width=5
align=absMiddle><A
href="http://www.01mcu.net/bbs/User/SendMessage.asp?SdM_ToUser=Lsong"><IMG
title=给Lsong发消息 height=16 src="jtd.files/message.gif" width=16
align=absMiddle border=0></A></TD>
<TD align=right><FONT
color=#888888>第<B>2</B>楼</FONT></TD></TR></TBODY></TABLE><BR><SPAN
style="LINE-HEIGHT: 15pt">
<TABLE style="LINE-HEIGHT: 15pt" cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD><SPAN
style="FONT-SIZE: 12px">好!<BR>能加上硬件描述就更好了,加上后就加精!</SPAN></TD></TR></TBODY></TABLE></SPAN></TD></TR>
<TR>
<TD width=8><IMG height=2 src="jtd.files/blank.gif" width=8></TD>
<TD vAlign=bottom><BR>
<TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all"
cellSpacing=0 cellPadding=0 width=332 border=0>
<TBODY>
<TR>
<TD><IMG height=17 src="jtd.files/signature.gif" width=500
border=0><BR> <FONT
color=#ff1493><B>供应单片机学习器材</B></FONT><BR><FONT
color=#9400d3>*************************</FONT><BR>
<A href="http://www.01mcu.net/"
target=_blank>http://www.01mcu.net/</A><BR>
<A
href="mailto:01mcu@126.com">01mcu@126.com</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE class=TBone cellSpacing=1 cellPadding=5 width="100%" align=center
bgColor=#cccccc border=0>
<TBODY>
<TR class=TBBG9 bgColor=#f7f7f7>
<TD vAlign=top align=middle width=150 height=20><IMG height=2
src="jtd.files/null.gif" width=150>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><A
href="http://www.01mcu.net/bbs/User/LookUserInfo.asp?ID=9530"><IMG
height=32 src="jtd.files/0013.gif" border=0 width32></A></TD>
<TD vAlign=top align=right><IMG height=21 alt=帅哥,离线
src="jtd.files/OfMale.gif" width=23
align=absMiddle></TD></TR></TBODY></TABLE><IMG height=5
src="jtd.files/null.gif" width=2 border=0><BR><A
href="http://www.01mcu.net/bbs/User/LookUserInfo.asp?ID=9530">aywangming</A>
<IMG height=15 alt=双子座 src="jtd.files/z3.gif" width=15
align=absMiddle> <IMG height=15 alt=寅虎 src="jtd.files/sx3s.gif"
width=15 align=absMiddle></TD></TR>
<TR>
<TD><IMG height=5 src="jtd.files/null.gif" width=2 border=0><BR><IMG
title=级别:论坛游民 height=11 src="jtd.files/level1.gif" width=110
align=absMiddle><BR><IMG height=5 src="jtd.files/null.gif" width=2
border=0><BR>级别:论坛游民<BR>积分:15<BR>经验:299<BR>文章:13<BR>注册:06-06-07
08:26 <BR></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top height=20>
<TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" height="100%"
width="100%">
<TBODY>
<TR>
<TD width=2><IMG height=2 src="jtd.files/blank.gif" width=2></TD>
<TD vAlign=top>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD><IMG height=20 src="jtd.files/face0.gif" width=20
align=absBottom>发表: 2006-07-05 23:53:39<IMG height=3
src="jtd.files/null.gif" width=5 align=absMiddle><A
href="http://www.01mcu.net/bbs/Announce/Announce2.asp?BoardID=7&ID=27904&submitflag=first&repost=1"><IMG
title=引用回复 height=16 src="jtd.files/re.gif" width=16
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -