数码管显示的电子时钟汇编程序
时间:11-29
来源:互联网
点击:
;*************************************************************
;功能:;实现电子时钟显示(汇编);定义:; P3口位选,P1口段选,P0.0,P0.1,P0.2为调时口;时间:; 2010—11—26;*************************************************************SECOND EQU 30HMINITE EQU 31HHOUR EQU 32HHOURK BIT P0.0MINITEK BIT P0.1SECONDK BIT P0.2DISPBUF EQU 40HDISPBIT EQU 48HT2SCNTA EQU 49HT2SCNTB EQU 4AHTEMP EQU 4BHORG 00HLJMP STARTORG 0BHLJMP INT_T0START: MOV SECOND,#00HMOV MINITE,#00HMOV HOUR,#12MOV DISPBIT,#00HMOV T2SCNTA,#00HMOV T2SCNTB,#00HMOV TEMP,#0FEHLCALL DISPMOV TMOD,#01HMOV TH0,#(65536-2000) / 256MOV TL0,#(65536-2000) MOD 256SETB TR0SETB ET0SETB EAWT: JB SECONDK,NK1LCALL DELY10MSJB SECONDK,NK1INC SECONDMOV A,SECONDCJNE A,#60,NS60MOV SECOND,#00HNS60:LCALL DISPJNB SECONDK,$NK1:JB MINITEK,NK2LCALL DELY10MSJB MINITEK,NK2INC MINITEMOV A,MINITECJNE A,#60,NM60MOV MINITE,#00HNM60:LCALL DISPJNB MINITEK,$NK2:JB HOURK,NK3LCALL DELY10MSJB HOURK,NK3INC HOURMOV A,HOURCJNE A,#24,NH24MOV HOUR,#00HNH24: LCALL DISPJNB HOURK,$NK3: LJMP WTDELY10MS:MOV R6,#10D1: MOV R7,#248 DJNZ R7,$DJNZ R6,D1RETDISP:MOV A,#DISPBUFADD A,#8DEC AMOV R1,AMOV A,HOURMOV B,#10div ABMOV @R1,ADEC R1MOV A,BMOV @R1,ADEC R1MOV A,#10MOV@R1,ADEC R1MOV A,MINITEMOV B,#10div ABMOV @R1,ADEC R1MOV A,BMOV @R1,ADEC R1MOV A,#10MOV@R1,ADEC R1MOV A,SECONDMOV B,#10div ABMOV @R1,ADEC R1MOV A,BMOV @R1,ADEC R1RETINT_T0:MOV TH0,#(65536-2000) / 256MOV TL0,#(65536-2000) MOD 256MOV A,#DISPBUFADD A,DISPBITMOV R0,AMOV A,@R0MOV DPTR,#TABLEMOVC A,@A+DPTRMOV P1,AMOV A,DISPBITMOV DPTR,#TABMOVC A,@A+DPTRMOV P3,AINC DISPBITMOV A,DISPBITCJNE A,#08H,KNAMOV DISPBIT,#00HKNA:INC T2SCNTAMOV A,T2SCNTACJNE A,#100,DONEMOV T2SCNTA,#00HINC T2SCNTBMOV A,T2SCNTBCJNE A,#05H,DONEMOV T2SCNTB,#00HINC SECONDMOV A,SECONDCJNE A,#60,NEXTMOV SECOND,#00HINC MINITEMOV A,MINITECJNE A,#60,NEXTMOV MINITE,#00HINC HOURMOV A,HOURCJNE A,#24,NEXTMOV HOUR,#00HNEXT:LCALL DISPDONE: RETITABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,40HTAB: DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FHEND//源代码下载 :http://www.51hei.com/f/sza511.rar
数码管显示电子时钟汇编程 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)