;*************************************************************;功能:;實(shí)現(xiàn)電子時(shí)鐘顯示(匯編);定義:; P3口位選,P1口段選,P0.0,P0.1,P0.2為調(diào)時(shí)口;時(shí)間:; 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,D1RET
評(píng)論