(完整版)基于单片机的万年历毕业论文 下载本文

JB 0EH,GFLASH6 ;调小时闪 MOV 75H,#0FH MOV 74H,#0FH AJMP GFLASHOUT GFLASH6:

MOV 73H,#0FH ;调分钟闪 MOV 72H,#0FH AJMP GFLASHOUT

;加一程序~~~~~~~~~~~~~~~~~~~~~~~~~ ADD1: MOV A,R7 ADD A,#1 DA A RET

;减一程序~~~~~~~~~~~~~~~~~~~~~~~~~ JIAN1: MOV A,R7 DEC A

CJNE A,#4FH,KK1 MOV A,#49H KK1:

CJNE A,#3FH,KK2 MOV A,#39H KK2:

CJNE A,#2FH,KK3

MOV A,#29H KK3:

CJNE A,#1FH,KK4 MOV A,#19H KK4:

CJNE A,#0FH,KK5 MOV A,#09H KK5: RET

;分离程序~~~~~~~~~~~~~~~~~~~~~~~~~ DIVIDE: MOV A,R0 ANL A,#0FH MOV R1,A MOV A,R0 SWAP A ANL A,#0FH MOV R2,A RET

;写1302程序~~~~~~~~~~~~~~~~~~~~~~~~~~ WRITE: CLR SCLK NOP SETB RST NOP

MOV A,32H MOV R4,#8 WRITE1:

RRC A ;送地址给1302 NOP NOP CLR SCLK NOP NOP NOP MOV IO,C NOP NOP NOP SETB SCLK NOP NOP

DJNZ R4,WRITE1 CLR SCLK NOP MOV A,31H MOV R4,#8 WRITE2: RRC A

NOP ;送数据给1302

CLR SCLK NOP NOP MOV IO,C NOP NOP NOP SETB SCLK NOP NOP

DJNZ R4,WRITE2 CLR RST RET

;读1302程序~~~~~~~~~~~~~~~~~~~~~~~~~ READ: CLR SCLK NOP NOP SETB RST NOP MOV A,32H MOV R4,#8 READ1:

RRC A ;送地址给1302 NOP