微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 时钟+秒表+流水灯的单片机汇编程序

时钟+秒表+流水灯的单片机汇编程序

时间:09-10 来源:互联网 点击:

KK13:RET

//=====流水灯子程序===========================
LED: MOV A,#0feH
MOV 41H,#08H
MOV P0,#0FFH
LED1:
MOV P1,A
MOV R3,#100
D0: ACALL DELAY
DJNZ R3,D0
MOV R3,41H
DJNZ R3,AAA
LJMP BB
AAA:RL A
MOV 41H,R3
ACALL KEY
LJMP LED1
BB:
MOV 41H,#07H
CC: MOV P1,A
MOV R3,#30
D1: ACALL DELAY
DJNZ R3,D1
MOV R3,41H
DJNZ R3,DD
LJMP LED0
DD:RR A
MOV 41H,R3
ACALL KEY
LJMP CC

LED0:RET

//=====延时子程序==============================
DELAY:MOV R1,#250
DEL1:NOP
NOP
NOP
NOP
DJNZ R1,DEL1
RET
//====调用时钟显示作延时========================
DELAY1:MOV R2,#20
DELA3: ACALL MAIN2
DJNZ R2,DELA3
RET
//====调用秒表显示作延时========================
DELAY3:MOV R2,#20
DELA5:ACALL MAIN3
DJNZ R2,DELA5
RET
//====调用延时子程序作延时======================
DELAY2:MOV R2,#100
DELA4:ACALL DELAY
DJNZ R2,DELA4
RET
//======共阳数码管段码表=================================
TAB:DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,87H
END

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top