📄 icc17-1.s
字号:
ldi R17,10
lds R16,_set_minute1
xcall mod8u
subi R16,240 ; addi 16
xcall _Putedot
.dbline 21
ldi R24,88
sts _col,R24
.dbline 21
ldi R24,4
sts _row,R24
.dbline 21
ldi R17,10
lds R16,_set_hour2
xcall div8u
subi R16,240 ; addi 16
xcall _Putedot
.dbline 22
ldi R24,96
sts _col,R24
.dbline 22
ldi R24,4
sts _row,R24
.dbline 22
ldi R17,10
lds R16,_set_hour2
xcall mod8u
subi R16,240 ; addi 16
xcall _Putedot
.dbline 23
ldi R24,112
sts _col,R24
.dbline 23
ldi R24,4
sts _row,R24
.dbline 23
ldi R17,10
lds R16,_set_minute2
xcall div8u
subi R16,240 ; addi 16
xcall _Putedot
.dbline 24
ldi R24,120
sts _col,R24
.dbline 24
ldi R24,4
sts _row,R24
.dbline 24
ldi R17,10
lds R16,_set_minute2
xcall mod8u
subi R16,240 ; addi 16
xcall _Putedot
.dbline 26
lds R2,_Flag_1820Error
tst R2
breq X1
xjmp L93
X1:
.dbline 27
.dbline 28
ldi R24,72
sts _col,R24
.dbline 28
ldi R24,6
sts _row,R24
.dbline 29
lds R2,_sign
tst R2
brne L95
.dbline 29
ldi R16,13
xcall _Putedot
xjmp L96
L95:
.dbline 30
lds R16,_e
subi R16,240 ; addi 16
xcall _Putedot
L96:
.dbline 31
ldi R24,80
sts _col,R24
.dbline 31
ldi R24,6
sts _row,R24
.dbline 31
lds R16,_e+1
subi R16,240 ; addi 16
xcall _Putedot
.dbline 32
ldi R24,88
sts _col,R24
.dbline 32
ldi R24,6
sts _row,R24
.dbline 32
lds R16,_e+2
subi R16,240 ; addi 16
xcall _Putedot
.dbline 33
ldi R24,96
sts _col,R24
.dbline 33
ldi R24,6
sts _row,R24
.dbline 33
ldi R16,14
xcall _Putedot
.dbline 34
ldi R24,104
sts _col,R24
.dbline 34
ldi R24,6
sts _row,R24
.dbline 34
lds R16,_e+3
subi R16,240 ; addi 16
xcall _Putedot
.dbline 35
xjmp L94
L93:
.dbline 37
.dbline 38
ldi R24,72
sts _col,R24
.dbline 38
ldi R24,6
sts _row,R24
.dbline 38
ldi R16,31
xcall _Putedot
.dbline 39
ldi R24,80
sts _col,R24
.dbline 39
ldi R24,6
sts _row,R24
.dbline 39
ldi R16,31
xcall _Putedot
.dbline 40
ldi R24,88
sts _col,R24
.dbline 40
ldi R24,6
sts _row,R24
.dbline 40
ldi R16,31
xcall _Putedot
.dbline 41
ldi R24,96
sts _col,R24
.dbline 41
ldi R24,6
sts _row,R24
.dbline 41
ldi R16,31
xcall _Putedot
.dbline 42
ldi R24,104
sts _col,R24
.dbline 42
ldi R24,6
sts _row,R24
.dbline 42
ldi R16,31
xcall _Putedot
.dbline 43
L94:
.dbline 45
lds R24,_d
cpi R24,1
brne L100
.dbline 46
.dbline 46
ldi R24,120
sts _col,R24
.dbline 46
clr R2
sts _row,R2
.dbline 46
ldi R16,30
xcall _Putedot
.dbline 46
xjmp L101
L100:
.dbline 48
.dbline 48
ldi R24,120
sts _col,R24
.dbline 48
clr R2
sts _row,R2
.dbline 48
ldi R16,31
xcall _Putedot
.dbline 48
L101:
.dbline 49
lds R24,_d+1
cpi R24,1
brne L102
.dbline 50
.dbline 50
ldi R24,120
sts _col,R24
.dbline 50
ldi R24,2
sts _row,R24
.dbline 50
ldi R16,30
xcall _Putedot
.dbline 50
xjmp L103
L102:
.dbline 52
.dbline 52
ldi R24,120
sts _col,R24
.dbline 52
ldi R24,2
sts _row,R24
.dbline 52
ldi R16,31
xcall _Putedot
.dbline 52
L103:
.dbline -2
L92:
.dbline 0 ; func end
ret
.dbend
.dbfunc e conv _conv fc
; len -> R20
; month -> R20
; year -> R22,R23
.even
_conv::
xcall push_gset2
mov R20,R18
movw R22,R16
.dbline -1
.dbline 56
.dbline 57
clr R21
cpi R20,1
ldi R30,0
cpc R21,R30
breq L109
cpi R20,2
ldi R30,0
cpc R21,R30
brne X6
xjmp L120
X6:
cpi R20,3
ldi R30,0
cpc R21,R30
breq L110
cpi R20,4
ldi R30,0
cpc R21,R30
breq L116
cpi R20,5
ldi R30,0
cpc R21,R30
breq L111
cpi R20,6
ldi R30,0
cpc R21,R30
breq L117
cpi R20,7
ldi R30,0
cpc R21,R30
breq L112
cpi R20,8
ldi R30,0
cpc R21,R30
breq L113
cpi R20,9
ldi R30,0
cpc R21,R30
breq L118
cpi R20,10
ldi R30,0
cpc R21,R30
breq L114
cpi R20,11
ldi R30,0
cpc R21,R30
breq L119
cpi R20,12
ldi R30,0
cpc R21,R30
breq L115
xjmp L106
X2:
.dbline 58
L109:
.dbline 59
ldi R20,31
.dbline 59
xjmp L107
L110:
.dbline 60
ldi R20,31
.dbline 60
xjmp L107
L111:
.dbline 61
ldi R20,31
.dbline 61
xjmp L107
L112:
.dbline 62
ldi R20,31
.dbline 62
xjmp L107
L113:
.dbline 63
ldi R20,31
.dbline 63
xjmp L107
L114:
.dbline 64
ldi R20,31
.dbline 64
xjmp L107
L115:
.dbline 65
ldi R20,31
.dbline 65
xjmp L107
L116:
.dbline 66
ldi R20,30
.dbline 66
xjmp L107
L117:
.dbline 67
ldi R20,30
.dbline 67
xjmp L107
L118:
.dbline 68
ldi R20,30
.dbline 68
xjmp L107
L119:
.dbline 69
ldi R20,30
.dbline 69
xjmp L107
L120:
.dbline 70
movw R24,R22
andi R24,3
andi R25,0
cpi R24,0
cpc R24,R25
brne L124
X3:
ldi R18,100
ldi R19,0
movw R16,R22
xcall mod16u
cpi R16,0
cpc R16,R17
brne L123
X4:
L124:
ldi R18,400
ldi R19,1
movw R16,R22
xcall mod16u
cpi R16,0
cpc R16,R17
brne L121
X5:
L123:
.dbline 70
ldi R20,29
xjmp L107
L121:
.dbline 71
ldi R20,28
.dbline 71
xjmp L107
L106:
.dbline 72
clr R16
xjmp L105
L107:
.dbline 74
mov R16,R20
.dbline -2
L105:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r len 20 c
.dbsym r month 20 c
.dbsym r year 22 i
.dbend
.dbfile D:\文稿\手把手教你学AVR单片机C程序设计\第17章~1\第17章实验程序\icc17-1/recever.c
.dbfunc e Rece _Rece fV
.area func_lit(rom, con, rel)
L258:
.word `L131
.word `L138
.word `L141
.word `L145
.word `L149
.word `L153
.word `L156
.word `L160
.word `L164
.word `L167
.word `L171
.word `L175
.word `L178
.word `L182
.word `L186
.word `L189
.word `L193
.word `L197
.word `L128
.word `L128
.word `L202
.word `L205
.word `L209
.word `L212
.word `L216
.word `L220
.word `L223
.word `L226
.word `L230
.word `L234
.word `L238
.word `L128
.word `L128
.word `L128
.word `L128
.word `L128
.word `L128
.word `L128
.word `L128
.word `L128
.word `L244
.word `L247
.word `L250
.word `L254
.area text(rom, con, rel)
.dbfile D:\文稿\手把手教你学AVR单片机C程序设计\第17章~1\第17章实验程序\icc17-1/recever.c
.even
_Rece::
xcall push_gset1
.dbline -1
.dbline 2
.dbline 3
lds R24,_Flag
cpi R24,1
breq X8
xjmp L126
X8:
.dbline 4
.dbline 5
clr R2
out 0x3f,R2
.dbline 6
lds R20,_ReceverCnt
clr R21
cpi R20,0
ldi R30,0
cpc R21,R30
brge X9
xjmp L128
X9:
ldi R24,43
ldi R25,0
cp R24,R20
cpc R25,R21
brge X10
xjmp L128
X10:
ldi R16,2
ldi R17,0
movw R18,R20
xcall empy16s
movw R30,R16
ldi R24,<L258
ldi R25,>L258
add R30,R24
adc R31,R25
lpm R0,Z+
lpm R1,Z
movw R30,R0
ijmp
X7:
.dbline 7
L131:
.dbline 8
lds R24,_temp
cpi R24,40
brne L132
.dbline 8
ldi R24,1
sts _ReceverCnt,R24
xjmp L129
L132:
.dbline 9
lds R24,_temp
cpi R24,123
brne L134
.dbline 9
ldi R24,20
sts _ReceverCnt,R24
xjmp L129
L134:
.dbline 10
lds R24,_temp
cpi R24,60
brne L136
.dbline 10
ldi R24,40
sts _ReceverCnt,R24
xjmp L129
L136:
.dbline 11
clr R2
sts _ReceverEndFlag,R2
.dbline 11
xjmp L129
L138:
.dbline 12
lds R24,_temp
cpi R24,48
brlo L139
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L139
.dbline 12
.dbline 12
mov R24,R2
subi R24,48
sts _a,R24
.dbline 12
ldi R24,2
sts _ReceverCnt,R24
.dbline 12
xjmp L129
L139:
.dbline 13
clr R2
sts _ReceverEndFlag,R2
.dbline 13
xjmp L129
L141:
.dbline 14
lds R24,_temp
cpi R24,48
brlo L142
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L142
.dbline 14
.dbline 14
mov R24,R2
subi R24,48
sts _a+1,R24
.dbline 14
ldi R24,3
sts _ReceverCnt,R24
.dbline 14
xjmp L129
L142:
.dbline 15
clr R2
sts _ReceverEndFlag,R2
.dbline 15
xjmp L129
L145:
.dbline 16
lds R24,_temp
cpi R24,48
brlo L146
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L146
.dbline 16
.dbline 16
mov R24,R2
subi R24,48
sts _a+2,R24
.dbline 16
ldi R24,4
sts _ReceverCnt,R24
.dbline 16
xjmp L129
L146:
.dbline 17
clr R2
sts _ReceverEndFlag,R2
.dbline 17
xjmp L129
L149:
.dbline 18
lds R24,_temp
cpi R24,48
brlo L150
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L150
.dbline 18
.dbline 18
mov R24,R2
subi R24,48
sts _a+3,R24
.dbline 18
ldi R24,5
sts _ReceverCnt,R24
.dbline 18
xjmp L129
L150:
.dbline 19
clr R2
sts _ReceverEndFlag,R2
.dbline 19
xjmp L129
L153:
.dbline 20
lds R24,_temp
cpi R24,44
brne L154
.dbline 20
ldi R24,6
sts _ReceverCnt,R24
xjmp L129
L154:
.dbline 21
clr R2
sts _ReceverEndFlag,R2
.dbline 21
xjmp L129
L156:
.dbline 22
lds R24,_temp
cpi R24,48
brlo L157
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L157
.dbline 22
.dbline 22
mov R24,R2
subi R24,48
sts _a+4,R24
.dbline 22
ldi R24,7
sts _ReceverCnt,R24
.dbline 22
xjmp L129
L157:
.dbline 23
clr R2
sts _ReceverEndFlag,R2
.dbline 23
xjmp L129
L160:
.dbline 24
lds R24,_temp
cpi R24,48
brlo L161
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L161
.dbline 24
.dbline 24
mov R24,R2
subi R24,48
sts _a+5,R24
.dbline 24
ldi R24,8
sts _ReceverCnt,R24
.dbline 24
xjmp L129
L161:
.dbline 25
clr R2
sts _ReceverEndFlag,R2
.dbline 25
xjmp L129
L164:
.dbline 26
lds R24,_temp
cpi R24,44
brne L165
.dbline 26
ldi R24,9
sts _ReceverCnt,R24
xjmp L129
L165:
.dbline 27
clr R2
sts _ReceverEndFlag,R2
.dbline 27
xjmp L129
L167:
.dbline 28
lds R24,_temp
cpi R24,48
brlo L168
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L168
.dbline 28
.dbline 28
mov R24,R2
subi R24,48
sts _a+6,R24
.dbline 28
ldi R24,10
sts _ReceverCnt,R24
.dbline 28
xjmp L129
L168:
.dbline 29
clr R2
sts _ReceverEndFlag,R2
.dbline 29
xjmp L129
L171:
.dbline 30
lds R24,_temp
cpi R24,48
brlo L172
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L172
.dbline 30
.dbline 30
mov R24,R2
subi R24,48
sts _a+7,R24
.dbline 30
ldi R24,11
sts _ReceverCnt,R24
.dbline 30
xjmp L129
L172:
.dbline 31
clr R2
sts _ReceverEndFlag,R2
.dbline 31
xjmp L129
L175:
.dbline 32
lds R24,_temp
cpi R24,44
brne L176
.dbline 32
ldi R24,12
sts _ReceverCnt,R24
xjmp L129
L176:
.dbline 33
clr R2
sts _ReceverEndFlag,R2
.dbline 33
xjmp L129
L178:
.dbline 34
lds R24,_temp
cpi R24,48
brlo L179
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L179
.dbline 34
.dbline 34
mov R24,R2
subi R24,48
sts _a+8,R24
.dbline 34
ldi R24,13
sts _ReceverCnt,R24
.dbline 34
xjmp L129
L179:
.dbline 35
clr R2
sts _ReceverEndFlag,R2
.dbline 35
xjmp L129
L182:
.dbline 36
lds R24,_temp
cpi R24,48
brlo L183
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L183
.dbline 36
.dbline 36
mov R24,R2
subi R24,48
sts _a+9,R24
.dbline 36
ldi R24,14
sts _ReceverCnt,R24
.dbline 36
xjmp L129
L183:
.dbline 37
clr R2
sts _ReceverEndFlag,R2
.dbline 37
xjmp L129
L186:
.dbline 38
lds R24,_temp
cpi R24,44
brne L187
.dbline 38
ldi R24,15
sts _ReceverCnt,R24
xjmp L129
L187:
.dbline 39
clr R2
sts _ReceverEndFlag,R2
.dbline 39
xjmp L129
L189:
.dbline 40
lds R24,_temp
cpi R24,48
brlo L190
ldi R24,57
lds R2,_temp
cp R24,R2
brlo L190
.dbline 40
.dbline 40
mov R24,R2
subi R24,48
sts _a+10,R24
.dbline 40
ldi R24,16
sts _ReceverCnt,R24
.dbline 40
xjmp L129
L190:
.dbline 41
clr R2
sts _ReceverEndFlag,R2
.dbline 41
xjmp L129
L193:
.dbline 42
lds R24,_temp
cpi R24,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -