📄 yj12864.s
字号:
.dbsym r byte 22 c
.dbend
.dbfunc e DS1302_writeD _DS1302_writeD fV
; data -> R20
; addr -> R22
.even
_DS1302_writeD::
xcall push_gset2
mov R20,R18
mov R22,R16
.dbline -1
.dbline 92
.dbline 93
cbi 0x15,7
.dbline 94
cbi 0x18,7
.dbline 95
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 96
sbi 0x15,7
.dbline 97
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 98
mov R16,R22
xcall _DS1302_writeB
.dbline 99
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 100
cbi 0x18,7
.dbline 101
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 102
mov R16,R20
xcall _DS1302_writeB
.dbline 103
cbi 0x18,7
.dbline 104
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 105
cbi 0x15,7
.dbline -2
L117:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r data 20 c
.dbsym r addr 22 c
.dbend
.dbfunc e DS1302_readD _DS1302_readD fc
; data -> R20
; addr -> R20
.even
_DS1302_readD::
xcall push_gset1
mov R20,R16
.dbline -1
.dbline 114
.dbline 116
cbi 0x15,7
.dbline 117
cbi 0x18,7
.dbline 118
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 119
sbi 0x15,7
.dbline 120
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 121
mov R16,R20
xcall _DS1302_writeB
.dbline 122
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 123
xcall _DS1302_readB
mov R20,R16
.dbline 124
ldi R16,10
ldi R17,0
xcall _Delayus
.dbline 125
cbi 0x18,7
.dbline 126
cbi 0x15,7
.dbline 127
mov R16,R20
.dbline -2
L118:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r data 20 c
.dbsym r addr 20 c
.dbend
.dbfunc e DS1302_setT _DS1302_setT fV
; addr -> R20
; i -> R22
; ptTimeD -> R10,R11
.even
_DS1302_setT::
xcall push_gset3
movw R10,R16
.dbline -1
.dbline 136
.dbline 138
ldi R20,128
.dbline 139
clr R18
ldi R16,142
xcall _DS1302_writeD
.dbline 140
ldi R16,5
ldi R17,0
xcall _Delayms
.dbline 141
clr R22
xjmp L123
L120:
.dbline 142
.dbline 143
mov R30,R22
clr R31
add R30,R10
adc R31,R11
ldd R18,z+0
mov R16,R20
xcall _DS1302_writeD
.dbline 144
subi R20,254 ; addi 2
.dbline 145
ldi R16,1
ldi R17,0
xcall _Delayms
.dbline 146
L121:
.dbline 141
inc R22
L123:
.dbline 141
cpi R22,7
brlo L120
.dbline 147
ldi R18,128
ldi R16,142
xcall _DS1302_writeD
.dbline -2
L119:
xcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r addr 20 c
.dbsym r i 22 c
.dbsym r ptTimeD 10 pc
.dbend
.dbfunc e DS1302_getT _DS1302_getT fV
; addr -> R20
; i -> R22
; time -> R10,R11
.even
_DS1302_getT::
xcall push_gset3
movw R10,R16
.dbline -1
.dbline 156
.dbline 158
ldi R20,128
.dbline 159
clr R22
xjmp L128
L125:
.dbline 160
.dbline 161
mov R16,R20
ori R16,1
xcall _DS1302_readD
mov R30,R22
clr R31
add R30,R10
adc R31,R11
std z+0,R16
.dbline 162
subi R20,254 ; addi 2
.dbline 163
L126:
.dbline 159
inc R22
L128:
.dbline 159
cpi R22,7
brlo L125
.dbline 164
cbi 0x18,7
.dbline -2
L124:
xcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r addr 20 c
.dbsym r i 22 c
.dbsym r time 10 pc
.dbend
.dbfunc e DS1302_check _DS1302_check fc
; exist -> R20
.even
_DS1302_check::
xcall push_gset1
.dbline -1
.dbline 173
.dbline 175
clr R18
ldi R16,142
xcall _DS1302_writeD
.dbline 176
ldi R18,165
ldi R16,192
xcall _DS1302_writeD
.dbline 177
ldi R16,193
xcall _DS1302_readD
mov R20,R16
.dbline 178
cpi R16,165
brne L130
.dbline 179
.dbline 180
ldi R20,1
.dbline 181
xjmp L131
L130:
.dbline 183
.dbline 184
clr R20
.dbline 185
L131:
.dbline 186
mov R16,R20
.dbline -2
L129:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r exist 20 c
.dbend
.dbfunc e DS1302_init _DS1302_init fV
.even
_DS1302_init::
.dbline -1
.dbline 195
.dbline 196
clr R18
ldi R16,142
xcall _DS1302_writeD
.dbline 197
clr R18
ldi R16,128
xcall _DS1302_writeD
.dbline 198
ldi R18,128
ldi R16,142
xcall _DS1302_writeD
.dbline -2
L132:
.dbline 0 ; func end
ret
.dbend
.dbfunc e BCD_ASCII _BCD_ASCII fV
; ptasc -> R18,R19
; BCD -> R16
.even
_BCD_ASCII::
.dbline -1
.dbline 208
.dbline 209
mov R24,R16
swap R24
andi R24,#0x0F
ori R24,48
movw R30,R18
std z+0,R24
.dbline 210
mov R24,R16
andi R24,15
ori R24,48
std z+1,R24
.dbline -2
L133:
.dbline 0 ; func end
ret
.dbsym r ptasc 18 pc
.dbsym r BCD 16 c
.dbend
.area lit(rom, con, rel)
L135:
.byte 32,48
.byte 32,48
.byte 0
L136:
.byte 32,48
.byte 32,48
.byte 0
L137:
.byte 32,0
.byte 32,0
.byte 0
L138:
.byte 32,48
.byte 0
L139:
.byte 32,0
.byte 32,0
.byte 32,58
.byte 32,48
.byte 32,48
.byte 32,58
.byte 32,48
.byte 32,48
.byte 0
.area text(rom, con, rel)
.dbfile C:\DOCUME~1\Administrator\桌面\12864液晶菜单显示时钟不过不能调2/RTC.C
.dbfunc e Disp_time _Disp_time fV
; i -> <dead>
; linex2_2 -> y+34
; linex2 -> y+29
; linex1_1 -> y+24
; linex1 -> y+19
; linex3 -> y+2
; asc -> y+0
; time -> R20,R21
.even
_Disp_time::
xcall push_gset1
movw R20,R16
sbiw R28,37
.dbline -1
.dbline 219
.dbline 225
ldi R24,<L135
ldi R25,>L135
movw R30,R28
adiw R30,19
ldi R16,5
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 226
ldi R24,<L136
ldi R25,>L136
movw R30,R28
adiw R30,24
ldi R16,5
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 227
ldi R24,<L137
ldi R25,>L137
movw R30,R28
adiw R30,29
ldi R16,5
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 228
ldi R24,<L138
ldi R25,>L138
movw R30,R28
adiw R30,34
ldi R16,3
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 229
ldi R24,<L139
ldi R25,>L139
movw R30,R28
adiw R30,2
ldi R16,17
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 241
movw R18,R28
movw R30,R20
ldd R16,z+0
xcall _BCD_ASCII
.dbline 242
ldd R2,y+0
std y+15,R2
.dbline 243
ldd R2,y+1
std y+17,R2
.dbline 245
movw R18,R28
movw R30,R20
ldd R16,z+1
xcall _BCD_ASCII
.dbline 246
ldd R2,y+0
std y+9,R2
.dbline 247
ldd R2,y+1
std y+11,R2
.dbline 249
;
movw R18,R28
movw R30,R20
ldd R16,z+2
xcall _BCD_ASCII
.dbline 250
;
ldd R2,y+0
std y+3,R2
.dbline 251
;
ldd R2,y+1
std y+5,R2
.dbline 254
;
;
;
movw R18,R28
movw R30,R20
ldd R16,z+6
xcall _BCD_ASCII
.dbline 255
;
ldd R2,y+0
std y+20,R2
.dbline 256
;
ldd R2,y+1
std y+22,R2
.dbline 258
;
;
movw R18,R28
movw R30,R20
ldd R16,z+4
xcall _BCD_ASCII
.dbline 259
;
ldd R2,y+0
std y+25,R2
.dbline 260
;
ldd R2,y+1
std y+27,R2
.dbline 262
;
;
movw R18,R28
movw R30,R20
ldd R16,z+3
xcall _BCD_ASCII
.dbline 263
;
ldd R2,y+0
std y+30,R2
.dbline 264
;
ldd R2,y+1
std y+32,R2
.dbline 267
;
;
;
movw R18,R28
movw R30,R20
ldd R16,z+5
xcall _BCD_ASCII
.dbline 268
;
ldd R2,y+1
std y+35,R2
L160:
.dbline 271
L161:
.dbline 271
;
;
;
xcall _LCD12864_readBF
tst R16
brne L160
.dbline 272
;
clr R18
ldi R16,1
xcall _LCD12864_gotoXY
.dbline 274
;
;
ldi R16,<L163
ldi R17,>L163
xcall _LCD12864_sendstr
.dbline 275
;
movw R16,R28
subi R16,237 ; offset = 19
sbci R17,255
xcall _LCD12864_sendstr
.dbline 276
;
ldi R16,<L164
ldi R17,>L164
xcall _LCD12864_sendstr
.dbline 277
;
movw R16,R28
subi R16,232 ; offset = 24
sbci R17,255
xcall _LCD12864_sendstr
.dbline 278
;
ldi R16,<L165
ldi R17,>L165
xcall _LCD12864_sendstr
.dbline 281
;
;
;
clr R18
ldi R16,2
xcall _LCD12864_gotoXY
.dbline 283
;
;
movw R16,R28
subi R16,227 ; offset = 29
sbci R17,255
xcall _LCD12864_sendstr
.dbline 284
;
ldi R16,<L166
ldi R17,>L166
xcall _LCD12864_sendstr
.dbline 285
;
ldi R16,<L167
ldi R17,>L167
xcall _LCD12864_sendstr
.dbline 286
;
movw R16,R28
subi R16,222 ; offset = 34
sbci R17,255
xcall _LCD12864_sendstr
.dbline 288
;
;
clr R18
ldi R16,3
xcall _LCD12864_gotoXY
.dbline 290
;
;
movw R16,R28
subi R16,254 ; offset = 2
sbci R17,255
xcall _LCD12864_sendstr
L168:
.dbline 291
L169:
.dbline 291
;
xcall _LCD12864_readBF
tst R16
brne L168
.dbline 292
;
ldi R18,2
ldi R16,4
xcall _LCD12864_gotoXY
.dbline 294
;
;
ldi R16,<L171
ldi R17,>L171
xcall _LCD12864_sendstr
.dbline -2
L134:
adiw R28,37
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym l i 1 c
.dbsym l linex2_2 34 A[3:3]c
.dbsym l linex2 29 A[5:5]c
.dbsym l linex1_1 24 A[5:5]c
.dbsym l linex1 19 A[5:5]c
.dbsym l linex3 2 A[17:17]c
.dbsym l asc 0 A[2:2]c
.dbsym r time 20 pc
.dbend
.area lit(rom, con, rel)
L173:
.byte 21,'X
.byte 19,1
.byte 1,6
.byte 7
L174:
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0
.area text(rom, con, rel)
.dbfile C:\DOCUME~1\Administrator\桌面\12864液晶菜单显示时钟不过不能调2/RTC.C
.dbfunc e shizhong _shizhong fV
; dis_y -> <dead>
; dis_x -> <dead>
; shift -> <dead>
; setdat -> <dead>
; setadd -> <dead>
; settime -> y+7
; set_num -> R20
; i -> R10
; gettime -> y+0
; RD_TFLAG -> R12
; n -> R22
.even
_shizhong::
xcall push_gset4
sbiw R28,14
.dbline -1
.dbline 344
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
.dbline 345
;
clr R12
inc R12
.dbline 345
clr R20
.dbline 345
clr R22
.dbline 352
;
;
;
;
;
;
;
ldi R24,<L173
ldi R25,>L173
movw R30,R28
adiw R30,7
ldi R16,7
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 353
;
ldi R24,<L174
ldi R25,>L174
movw R30,R28
ldi R16,7
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 354
;
xcall _Board_init
.dbline 356
;
;
xcall _LCD12864_initial
.dbline 357
;
xcall _LCD12864_clear
.dbline 358
;
xcall _DS1302_portinit
.dbline 359
;
xcall _DS1302_init
xjmp L176
L175:
.dbline 361
;
;
.dbline 362
;
tst R12
breq L178
.dbline 363
;
.dbline 364
;
movw R16,R28
xcall _DS1302_getT
.dbline 365
;
movw R16,R28
xcall _Disp_time
.dbline 366
;
L178:
.dbline 367
;
xcall _Mkey_press
tst R16
breq L180
.dbline 368
;
.dbline 369
;
xcall _Mkey_scan
mov R10,R16
.dbline 370
;
mov R20,R10
clr R21
cpi R20,15
ldi R30,0
cpc R21,R30
breq L185
xjmp L183
X14:
.dbline 371
;
L185:
.dbline 666
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -