📄 ds12c887.s
字号:
cpc R25,R30
brne X5
xjmp L21
X5:
cpi R24,4
ldi R30,0
cpc R25,R30
brne X6
xjmp L22
X6:
cpi R24,5
ldi R30,0
cpc R25,R30
brne X7
xjmp L23
X7:
cpi R24,6
ldi R30,0
cpc R25,R30
brne X8
xjmp L24
X8:
cpi R24,7
ldi R30,0
cpc R25,R30
brne X9
xjmp L25
X9:
cpi R24,8
ldi R30,0
cpc R25,R30
brne X10
xjmp L26
X10:
cpi R24,9
ldi R30,0
cpc R25,R30
brne X11
xjmp L27
X11:
xjmp L15
X1:
.dbline 86
; {
L18:
.dbline 87
; case 0x00:display_char(n01,n02,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n02
ldi R19,>_n02
ldi R16,<_n01
ldi R17,>_n01
xcall _display_char
.dbline 87
xjmp L16
L19:
.dbline 88
; case 0x01:display_char(n11,n12,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n12
ldi R19,>_n12
ldi R16,<_n11
ldi R17,>_n11
xcall _display_char
.dbline 88
xjmp L16
L20:
.dbline 89
; case 0x02:display_char(n21,n22,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n22
ldi R19,>_n22
ldi R16,<_n21
ldi R17,>_n21
xcall _display_char
.dbline 89
xjmp L16
L21:
.dbline 90
; case 0x03:display_char(n31,n32,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n32
ldi R19,>_n32
ldi R16,<_n31
ldi R17,>_n31
xcall _display_char
.dbline 90
xjmp L16
L22:
.dbline 91
; case 0x04:display_char(n41,n42,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n42
ldi R19,>_n42
ldi R16,<_n41
ldi R17,>_n41
xcall _display_char
.dbline 91
xjmp L16
L23:
.dbline 92
; case 0x05:display_char(n51,n52,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n52
ldi R19,>_n52
ldi R16,<_n51
ldi R17,>_n51
xcall _display_char
.dbline 92
xjmp L16
L24:
.dbline 93
; case 0x06:display_char(n61,n62,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n62
ldi R19,>_n62
ldi R16,<_n61
ldi R17,>_n61
xcall _display_char
.dbline 93
xjmp L16
L25:
.dbline 94
; case 0x07:display_char(n71,n72,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n72
ldi R19,>_n72
ldi R16,<_n71
ldi R17,>_n71
xcall _display_char
.dbline 94
xjmp L16
L26:
.dbline 95
; case 0x08:display_char(n81,n82,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n82
ldi R19,>_n82
ldi R16,<_n81
ldi R17,>_n81
xcall _display_char
.dbline 95
xjmp L16
L27:
.dbline 96
; case 0x09:display_char(n91,n92,y,x);break;
std y+2,R22
std y+0,R20
ldi R18,<_n92
ldi R19,>_n92
ldi R16,<_n91
ldi R17,>_n91
xcall _display_char
.dbline 96
L15:
L16:
.dbline -2
L14:
adiw R28,3
xcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r x 22 c
.dbsym r y 20 c
.dbsym r number 10 c
.dbend
.dbfunc e readtime _readtime fV
.even
_readtime::
.dbline -1
.dbline 103
; }
; }
;
; /*********************************读取时间值************************************/
;
; void readtime(void)
; {
.dbline 104
; second=Read_RegSec();
xcall _Read_RegSec
sts _second,R16
.dbline 105
; second10=(second&0xf0)>>4; //取得秒的十位数字
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _second10,R24
.dbline 106
; second01=second&0x0f; //取得秒的个位数字
mov R24,R16
andi R24,15
sts _second01,R24
.dbline 108
;
; minute=Read_RegMin();
xcall _Read_RegMin
sts _minute,R16
.dbline 109
; minute10=(minute&0xf0)>>4; //取得分的十位数字
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _minute10,R24
.dbline 110
; minute01=minute&0x0f; //取得分的个位数字
mov R24,R16
andi R24,15
sts _minute01,R24
.dbline 112
;
; hour=Read_RegHour();
xcall _Read_RegHour
sts _hour,R16
.dbline 113
; hour10=(hour&0xf0)>>4; //取得时的十位数字
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _hour10,R24
.dbline 114
; hour01=hour&0x0f; //取得时的个位数字
mov R24,R16
andi R24,15
sts _hour01,R24
.dbline 116
;
; weekday=Read_RegWeekday();
xcall _Read_RegWeekday
sts _weekday,R16
.dbline 117
; weekday10=(weekday&0xf0)>>4; //取得星期的十位数字
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _weekday10,R24
.dbline 118
; weekday01=weekday&0x0f;
mov R24,R16
andi R24,15
sts _weekday01,R24
.dbline 120
;
; monthday=Read_RegMonthday();
xcall _Read_RegMonthday
sts _monthday,R16
.dbline 121
; monthday10=(monthday&0xf0)>>4;
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _monthday10,R24
.dbline 122
; monthday01=monthday&0x0f;
mov R24,R16
andi R24,15
sts _monthday01,R24
.dbline 124
;
; month=Read_RegMonth();
xcall _Read_RegMonth
sts _month,R16
.dbline 125
; month10=(month&0xf0)>>4;
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _month10,R24
.dbline 126
; month01=month&0x0f;
mov R24,R16
andi R24,15
sts _month01,R24
.dbline 128
;
; year=Read_RegYear();
xcall _Read_RegYear
sts _year,R16
.dbline 129
; year10=(year&0xf0)>>4;
mov R24,R16
andi R24,240
swap R24
andi R24,#0x0F
sts _year10,R24
.dbline 130
; year01=year&0x0f;
mov R24,R16
andi R24,15
sts _year01,R24
.dbline -2
L28:
.dbline 0 ; func end
ret
.dbend
.dbfunc e displaytime _displaytime fV
.even
_displaytime::
sbiw R28,1
.dbline -1
.dbline 136
; }
;
; /*********************************时间显示函数************************************/
;
; void displaytime(void)
; {
.dbline 137
; juddisplay(year10,0,0);
clr R2
std y+0,R2
clr R18
lds R16,_year10
xcall _juddisplay
.dbline 138
; juddisplay(year01,0,1);
ldi R24,1
std y+0,R24
clr R18
lds R16,_year01
xcall _juddisplay
.dbline 140
;
; juddisplay(month10,0,4);
ldi R24,4
std y+0,R24
clr R18
lds R16,_month10
xcall _juddisplay
.dbline 141
; juddisplay(month01,0,5);
ldi R24,5
std y+0,R24
clr R18
lds R16,_month01
xcall _juddisplay
.dbline 143
;
; juddisplay(monthday10,0,8);
ldi R24,8
std y+0,R24
clr R18
lds R16,_monthday10
xcall _juddisplay
.dbline 144
; juddisplay(monthday01,0,9);
ldi R24,9
std y+0,R24
clr R18
lds R16,_monthday01
xcall _juddisplay
.dbline 146
;
; juddisplay(weekday10,2,5);
ldi R24,5
std y+0,R24
ldi R18,2
lds R16,_weekday10
xcall _juddisplay
.dbline 147
; juddisplay(weekday01,2,6);
ldi R24,6
std y+0,R24
ldi R18,2
lds R16,_weekday01
xcall _juddisplay
.dbline 149
;
; juddisplay(hour10,4,3);
ldi R24,3
std y+0,R24
ldi R18,4
lds R16,_hour10
xcall _juddisplay
.dbline 150
; juddisplay(hour01,4,4);
ldi R24,4
std y+0,R24
ldi R18,4
lds R16,_hour01
xcall _juddisplay
.dbline 152
;
; juddisplay(minute10,4,6);
ldi R24,6
std y+0,R24
ldi R18,4
lds R16,_minute10
xcall _juddisplay
.dbline 153
; juddisplay(minute01,4,7);
ldi R24,7
std y+0,R24
ldi R18,4
lds R16,_minute01
xcall _juddisplay
.dbline 155
;
; juddisplay(second10,4,9);
ldi R24,9
std y+0,R24
ldi R18,4
lds R16,_second10
xcall _juddisplay
.dbline 156
; juddisplay(second01,4,10);
ldi R24,10
std y+0,R24
ldi R18,4
lds R16,_second01
xcall _juddisplay
.dbline -2
L29:
adiw R28,1
.dbline 0 ; func end
ret
.dbend
.dbfunc e main _main fV
.even
_main::
sbiw R28,9
.dbline -1
.dbline 161
; }
;
;
; void main(void)
; {
.dbline 163
;
; init_devices();
xcall _init_devices
.dbline 164
; LCD_Clean();
xcall _LCD_Clean
.dbline 165
; LCD_Init();
xcall _LCD_Init
.dbline 166
; delayds12887(20000);
ldi R16,32
xcall _delayds12887
.dbline 167
; Write_Regtime(0x00,0x41,0x21,0x06,0x07,0x07,0x07);
ldi R24,7
std y+8,R24
std y+6,R24
std y+4,R24
ldi R24,6
std y+2,R24
ldi R24,33
std y+0,R24
ldi R18,65
clr R16
xcall _Write_Regtime
.dbline 168
; Write_Regspecial(0x20,0x00,0x00,0x00); //寄存器A写入0X20
clr R2
std y+2,R2
std y+0,R2
clr R18
ldi R16,32
xcall _Write_Regspecial
.dbline 169
; display_char(maohao1,maohao2,4,8); //显示冒号
ldi R24,8
std y+2,R24
ldi R24,4
std y+0,R24
ldi R18,<_maohao2
ldi R19,>_maohao2
ldi R16,<_maohao1
ldi R17,>_maohao1
xcall _display_char
.dbline 170
; display_char(maohao1,maohao2,4,5); //显示冒号
ldi R24,5
std y+2,R24
ldi R24,4
std y+0,R24
ldi R18,<_maohao2
ldi R19,>_maohao2
ldi R16,<_maohao1
ldi R17,>_maohao1
xcall _display_char
.dbline 171
; display_chinese(nian1,nian2,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,<_nian2
ldi R19,>_nian2
ldi R16,<_nian1
ldi R17,>_nian1
xcall _display_chinese
.dbline 172
; display_chinese(yue1,yue2,0,3);
ldi R24,3
std y+2,R24
clr R2
std y+0,R2
ldi R18,<_yue2
ldi R19,>_yue2
ldi R16,<_yue1
ldi R17,>_yue1
xcall _display_chinese
.dbline 173
; display_chinese(ri1,ri2,0,5);
ldi R24,5
std y+2,R24
clr R2
std y+0,R2
ldi R18,<_ri2
ldi R19,>_ri2
ldi R16,<_ri1
ldi R17,>_ri1
xcall _display_chinese
.dbline 174
; display_chinese(xing1,xing2,1,0);
clr R2
std y+2,R2
ldi R24,1
std y+0,R24
ldi R18,<_xing2
ldi R19,>_xing2
ldi R16,<_xing1
ldi R17,>_xing1
xcall _display_chinese
.dbline 175
; display_chinese(qi1,qi2,1,1);
ldi R24,1
std y+2,R24
std y+0,R24
ldi R18,<_qi2
ldi R19,>_qi2
ldi R16,<_qi1
ldi R17,>_qi1
xcall _display_chinese
.dbline 176
; display_char(maohao1,maohao2,2,4);
ldi R24,4
std y+2,R24
ldi R24,2
std y+0,R24
ldi R18,<_maohao2
ldi R19,>_maohao2
ldi R16,<_maohao1
ldi R17,>_maohao1
xcall _display_char
xjmp L32
L31:
.dbline 179
.dbline 180
xcall _readtime
.dbline 181
xcall _displaytime
.dbline 182
L32:
.dbline 178
xjmp L31
X12:
.dbline -2
L30:
adiw R28,9
.dbline 0 ; func end
ret
.dbend
.area bss(ram, con, rel)
.dbfile C:\DOCUME~1\Administrator\桌面\USING07-07\Mega128\12c887\DS12C887.C
_year01::
.blkb 1
.dbsym e year01 _year01 c
_year10::
.blkb 1
.dbsym e year10 _year10 c
_year::
.blkb 1
.dbsym e year _year c
_month01::
.blkb 1
.dbsym e month01 _month01 c
_month10::
.blkb 1
.dbsym e month10 _month10 c
_month::
.blkb 1
.dbsym e month _month c
_monthday01::
.blkb 1
.dbsym e monthday01 _monthday01 c
_monthday10::
.blkb 1
.dbsym e monthday10 _monthday10 c
_monthday::
.blkb 1
.dbsym e monthday _monthday c
_weekday01::
.blkb 1
.dbsym e weekday01 _weekday01 c
_weekday10::
.blkb 1
.dbsym e weekday10 _weekday10 c
_weekday::
.blkb 1
.dbsym e weekday _weekday c
_hour01::
.blkb 1
.dbsym e hour01 _hour01 c
_hour10::
.blkb 1
.dbsym e hour10 _hour10 c
_hour::
.blkb 1
.dbsym e hour _hour c
_minute01::
.blkb 1
.dbsym e minute01 _minute01 c
_minute10::
.blkb 1
.dbsym e minute10 _minute10 c
_minute::
.blkb 1
.dbsym e minute _minute c
_second01::
.blkb 1
.dbsym e second01 _second01 c
_second10::
.blkb 1
.dbsym e second10 _second10 c
_second::
.blkb 1
.dbsym e second _second c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -