📄 avrstudy.s
字号:
clr R31
add R30,R24
adc R31,R25
lpm R30,Z
ori R30,15
in R24,0x10
andi R24,15
or R24,R30
out 0x12,R24
.dbline 31
movw R16,R22
rcall _delay
.dbline 32
L384:
.dbline 28
inc R20
L386:
.dbline 28
cpi R20,8
brlo L383
.dbline -2
L382:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r speed 22 i
.dbend
.dbfunc e reversal375 _reversal375 fV
; i -> R20
; speed -> R22,R23
.even
_reversal375::
rcall push_gset2
movw R22,R16
.dbline -1
.dbline 36
.dbline 38
clr R20
rjmp L391
L388:
.dbline 39
.dbline 40
ldi R24,<_time_sequence2
ldi R25,>_time_sequence2
mov R30,R20
clr R31
add R30,R24
adc R31,R25
lpm R30,Z
ori R30,15
in R24,0x10
andi R24,15
or R24,R30
out 0x12,R24
.dbline 41
movw R16,R22
rcall _delay
.dbline 42
L389:
.dbline 38
inc R20
L391:
.dbline 38
cpi R20,8
brlo L388
.dbline -2
L387:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r speed 22 i
.dbend
.dbfunc e corotation75 _corotation75 fV
; i -> R20
; speed -> R22,R23
.even
_corotation75::
rcall push_gset2
movw R22,R16
.dbline -1
.dbline 46
.dbline 48
clr R20
rjmp L396
L393:
.dbline 49
.dbline 50
ldi R24,<_time_sequence3
ldi R25,>_time_sequence3
mov R30,R20
clr R31
add R30,R24
adc R31,R25
lpm R30,Z
ori R30,15
in R24,0x10
andi R24,15
or R24,R30
out 0x12,R24
.dbline 51
movw R16,R22
rcall _delay
.dbline 52
L394:
.dbline 48
inc R20
L396:
.dbline 48
cpi R20,4
brlo L393
.dbline -2
L392:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r speed 22 i
.dbend
.dbfunc e reversal75 _reversal75 fV
; i -> R20
; speed -> R22,R23
.even
_reversal75::
rcall push_gset2
movw R22,R16
.dbline -1
.dbline 56
.dbline 58
clr R20
rjmp L401
L398:
.dbline 59
.dbline 60
ldi R24,<_time_sequence4
ldi R25,>_time_sequence4
mov R30,R20
clr R31
add R30,R24
adc R31,R25
lpm R30,Z
ori R30,15
in R24,0x10
andi R24,15
or R24,R30
out 0x12,R24
.dbline 61
movw R16,R22
rcall _delay
.dbline 62
L399:
.dbline 58
inc R20
L401:
.dbline 58
cpi R20,4
brlo L398
.dbline -2
L397:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r speed 22 i
.dbend
.dbfunc e motorstar _motorstar fV
; speeddat -> R20,R21
; time -> R22,R23
; i -> R10,R11
.even
_motorstar::
rcall push_gset3
.dbline -1
.dbline 67
.dbline 69
in R24,0x11
ori R24,15
out 0x11,R24
.dbline 70
ldi R22,12
ldi R23,0
.dbline 71
ldi R20,20
ldi R21,0
.dbline 72
clr R10
clr R11
rjmp L406
L403:
.dbline 73
.dbline 74
movw R16,R20
rcall _corotation375
.dbline 75
L404:
.dbline 72
movw R24,R10
adiw R24,1
movw R10,R24
L406:
.dbline 72
cp R10,R22
cpc R11,R23
brlo L403
.dbline 76
clr R10
clr R11
rjmp L410
L407:
.dbline 77
.dbline 78
movw R16,R20
rcall _reversal375
.dbline 79
L408:
.dbline 76
movw R24,R10
adiw R24,1
movw R10,R24
L410:
.dbline 76
cp R10,R22
cpc R11,R23
brlo L407
.dbline 80
clr R10
clr R11
rjmp L414
L411:
.dbline 81
.dbline 82
movw R16,R20
rcall _corotation75
.dbline 83
L412:
.dbline 80
movw R24,R10
adiw R24,1
movw R10,R24
L414:
.dbline 80
cp R10,R22
cpc R11,R23
brlo L411
.dbline 84
clr R10
clr R11
rjmp L418
L415:
.dbline 85
.dbline 86
movw R16,R20
rcall _reversal75
.dbline 87
L416:
.dbline 84
movw R24,R10
adiw R24,1
movw R10,R24
L418:
.dbline 84
cp R10,R22
cpc R11,R23
brlo L415
.dbline -2
L402:
rcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r speeddat 20 i
.dbsym r time 22 i
.dbsym r i 10 i
.dbend
.area vector(rom, abs)
.org 22
rjmp _uart_getchar
.area text(rom, con, rel)
.dbfile E:\AVR学习专区\AVR学习板/stepmotor.c
.dbfile E:\AVR学习专区\AVR学习板/串口测试.c
.dbfunc e uart_init _uart_init fV
.even
_uart_init::
.dbline -1
.dbline 19
.dbline 20
in R24,0xa
ori R24,152
out 0xa,R24
.dbline 21
ldi R24,25
out 0x9,R24
.dbline 22
clr R2
out 0x20,R2
.dbline 23
in R24,0x20
ori R24,134
out 0x20,R24
.dbline 24
ldi R24,128
out 0x3f,R24
.dbline -2
L419:
.dbline 0 ; func end
ret
.dbend
.dbfunc e uart_putchar _uart_putchar fV
; x -> R16
.even
_uart_putchar::
.dbline -1
.dbline 27
L421:
.dbline 29
L422:
.dbline 28
sbis 0xb,5
rjmp L421
.dbline 30
out 0xc,R16
.dbline -2
L420:
.dbline 0 ; func end
ret
.dbsym r x 16 c
.dbend
.dbfunc e uart_getchar _uart_getchar fc
; y -> R20
.even
_uart_getchar::
rcall push_lset
rcall push_gset1
.dbline -1
.dbline 34
L425:
.dbline 36
L426:
.dbline 36
sbis 0xb,7
rjmp L425
.dbline 37
in R20,0xc
.dbline 38
mov R16,R20
rcall _uart_putchar
.dbline -2
L424:
rcall pop_gset1
rcall pop_lset
.dbline 0 ; func end
reti
.dbsym r y 20 c
.dbend
.dbfunc e uart_main _uart_main fV
.even
_uart_main::
.dbline -1
.dbline 42
.dbline 43
ldi R24,3
out 0x11,R24
.dbline 44
rcall _uart_init
L429:
.dbline 46
.dbline 47
.dbline 48
L430:
.dbline 45
rjmp L429
X4:
.dbline -2
L428:
.dbline 0 ; func end
ret
.dbend
.area vector(rom, abs)
.org 2
rjmp _Int0
.area text(rom, con, rel)
.dbfile E:\AVR学习专区\AVR学习板/串口测试.c
.area vector(rom, abs)
.org 4
rjmp _Int1
.area text(rom, con, rel)
.dbfile E:\AVR学习专区\AVR学习板/串口测试.c
.area data(ram, con, rel)
.dbfile E:\AVR学习专区\AVR学习板/串口测试.c
_str1::
.blkb 17
.area idata
.byte 'A,'V,'R,32,181,165,198,172,187,250,191,170,183,162,176,229
.byte 0
.area data(ram, con, rel)
.dbfile E:\AVR学习专区\AVR学习板/串口测试.c
.dbfile AVRSTUDY.C
.dbsym e str1 _str1 A[17:17]c
_str2::
.blkb 17
.area idata
.byte 201,232,188,198,214,198,215,247,163,186,213,197,185,250,198,236
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str2 _str2 A[17:17]c
_str3::
.blkb 65
.area idata
.byte 161,250,'S,'P,'I,32,185,166,196,220,178,226,202,212,32,32
.byte 50,46,'I,50,'C,32,185,166,196,220,178,226,202,212,32,32
.byte 51,46,'A,'D,185,166,196,220,178,226,202,212,32,32,32,32
.byte 52,46,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str3 _str3 A[65:65]c
_str4::
.blkb 65
.area idata
.byte 49,46,'S,'P,'I,32,185,166,196,220,178,226,202,212,32,32
.byte 161,250,'I,50,'C,32,185,166,196,220,178,226,202,212,32,32
.byte 51,46,'A,'D,185,166,196,220,178,226,202,212,32,32,32,32
.byte 52,46,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str4 _str4 A[65:65]c
_str5::
.blkb 65
.area idata
.byte 49,46,'S,'P,'I,32,185,166,196,220,178,226,202,212,32,32
.byte 50,46,'I,50,'C,32,185,166,196,220,178,226,202,212,32,32
.byte 161,250,'A,'D,185,166,196,220,178,226,202,212,32,32,32,32
.byte 52,46,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str5 _str5 A[65:65]c
_str6::
.blkb 65
.area idata
.byte 49,46,'S,'P,'I,32,185,166,196,220,178,226,202,212,32,32
.byte 50,46,'I,50,'C,32,185,166,196,220,178,226,202,212,32,32
.byte 51,46,'A,'D,185,166,196,220,178,226,202,212,32,32,32,32
.byte 161,250,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str6 _str6 A[65:65]c
_str7::
.blkb 65
.area idata
.byte 50,46,'I,50,'C,32,185,166,196,220,178,226,202,212,32,32
.byte 51,46,'A,'D,185,166,196,220,178,226,202,212,32,32,32,32
.byte 52,46,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 161,250,180,174,191,218,205,168,209,182,178,226,202,212,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str7 _str7 A[65:65]c
_str8::
.blkb 65
.area idata
.byte 51,46,'A,'D,185,166,196,220,178,226,202,212,32,32,32,32
.byte 52,46,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 53,46,180,174,191,218,205,168,209,182,178,226,202,212,32,32
.byte 161,250,52,52,188,252,197,204,185,166,196,220,178,226,202,212
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str8 _str8 A[65:65]c
_str9::
.blkb 65
.area idata
.byte 52,46,178,189,189,248,181,231,187,250,178,226,202,212,32,32
.byte 53,46,180,174,191,218,205,168,209,182,178,226,202,212,32,32
.byte 54,46,52,52,188,252,197,204,185,166,196,220,178,226,202,212
.byte 161,250,183,181,187,216,32,32,32,32,32,32,32,32,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str9 _str9 A[65:65]c
_str10::
.blkb 17
.area idata
.byte 'S,'P,'I,32,185,166,196,220,202,181,209,233,214,208,161,173
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str10 _str10 A[17:17]c
_str11::
.blkb 17
.area idata
.byte 178,189,189,248,181,231,187,250,202,181,209,233,214,208,161,173
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str11 _str11 A[17:17]c
_str12::
.blkb 17
.area idata
.byte 32,32,180,174,191,218,202,181,209,233,214,208,161,173,32,32
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str12 _str12 A[17:17]c
_str13::
.blkb 17
.area idata
.byte 32,32,52,52,188,252,197,204,202,185,211,195,214,208,161,173
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e str13 _str13 A[17:17]c
_exit1::
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e exit1 _exit1 c
_exit2::
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e exit2 _exit2 c
_number1::
.blkb 1
.area idata
.byte 1
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e number1 _number1 c
_enter1::
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile AVRSTUDY.C
.dbsym e enter1 _enter1 c
.area text(rom, con, rel)
.dbfile AVRSTUDY.C
.dbfunc e delay _delay fV
; i -> R20,R21
; j -> R22,R23
; ms -> R16,R17
.even
_delay::
rcall push_gset2
.dbline -1
.dbline 36
.dbline 38
clr R20
clr R21
rjmp L436
L433:
.dbline 39
.dbline 40
clr R22
clr R23
rjmp L440
L437:
.dbline 41
.dbline 41
lds R24,_exit1
cpi R24,1
brne L441
.dbline 41
.dbline 41
ldi R22,1141
ldi R23,4
.dbline 41
movw R20,R16
.dbline 41
L441:
.dbline 41
L438:
.dbline 40
subi R22,255 ; offset = 1
sbci R23,255
L440:
.dbline 40
cpi R22,117
ldi R30,4
cpc R23,R30
brlo L437
.dbline 42
L434:
.dbline 38
subi R20,255 ; offset = 1
sbci R21,255
L436:
.dbline 38
cp R20,R16
cpc R21,R17
brlo L433
.dbline -2
L432:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 i
.dbsym r j 22 i
.dbsym r ms 16 i
.dbend
.dbfunc e Int0 _Int0 fV
.even
_Int0::
rcall push_lset
.dbline -1
.dbline 46
.dbline 47
in R24,0x3f
andi R24,127
out 0x3f,R24
.dbline 48
ldi R16,100
ldi R17,0
rcall _delay
.dbline 49
ldi R24,1
sts _exit1,R24
.dbline 50
sts _enter1,R24
.dbline 51
bset 7
.dbline -2
L443:
rcall pop_lset
.dbline 0 ; func end
reti
.dbend
.dbfunc e Int1 _Int1 fV
.even
_Int1::
rcall push_lset
.dbline -1
.dbline 55
.dbline 56
in R24,0x3f
andi R24,127
out 0x3f,R24
.dbline 57
ldi R16,100
ldi R17,0
rcall _delay
.dbline 59
lds R24,_number1
cpi R24,7
brsh L445
.dbline 59
.dbline 59
subi R24,255 ; addi 1
sts _number1,R24
.dbline 59
rjmp L446
L445:
.dbline 60
.dbline 60
ldi R24,1
sts _number1,R24
.dbline 60
L446:
.dbline 62
bset 7
.dbline -2
L444:
rcall pop_lset
.dbline 0 ; func end
reti
.dbend
.dbfunc e Init_int _Init_int fV
.even
_Init_int::
.dbline -1
.dbline 66
.dbline 68
clr R2
out 0x35,R2
.dbline 69
cbi 0x11,2
.dbline 70
sbi 0x12,2
.dbline 71
cbi 0x11,2
.dbline 72
cbi 0x11,3
.dbline 73
in R24,0x12
ori R24,12
out 0x12,R24
.dbline 74
bset 7
.dbline 75
in R24,0x3b
ori R24,192
out 0x3b,R24
.dbline -2
L447:
.dbline 0 ; func end
ret
.dbend
.area lit(rom, con, rel)
L449:
.byte 'P,8
.byte 23,18
.byte 2,4
.byte 9
L450:
.byte 1,1
.byte 1,1
.byte 1,1
.byte 1
.area text(rom, con, rel)
.dbfile AVRSTUDY.C
.dbfunc e main _main fV
; data -> R20,R21
; settime -> y+9
; gettime -> y+2
; i -> R10,R11
.even
_main::
sbiw R28,16
.dbline -1
.dbline 79
.dbline 80
ldi R24,<L449
ldi R25,>L449
movw R30,R28
adiw R30,9
ldi R16,7
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
rcall asgncblk
.dbline 81
ldi R24,<L450
ldi R25,>L450
movw R30,R28
adiw R30,2
ldi R16,7
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
rcall asgncblk
.dbline 82
clr R20
clr R21
.dbline 83
rcall _spi_init
.dbline 84
rcall _Init_int
.dbline 85
rcall _LcmInit
.dbline 86
ldi R16,10
ldi R17,0
rcall _Delay
.dbline 87
rcall _twi_init
.dbline 88
ldi R24,255
out 0x18,R24
.dbline 89
sbi 0x18,1
.dbline 90
rcall _DS1302_portinit
rjmp L452
L451:
.dbline 94
.dbline 95
ldi R24,<L454
ldi R25,>L454
std y+1,R25
std y+0,R24
clr R18
clr R16
rcall _PutStr
.dbline 96
ldi R24,<_str1
ldi R25,>_str1
std y+1,R25
std y+0,R24
clr R18
clr R16
rcall _PutStr
.dbline 97
ldi R16,10
ldi R17,0
rcall _Delay
.dbline 98
ldi R24,<_str2
ldi R25,>_str2
std y+1,R25
std y+0,R24
clr R18
ldi R16,3
rcall _PutStr
.dbline 99
ldi R16,10
ldi R17,0
rcall _Delay
rjmp L456
L455:
.dbline 101
.dbline 102
movw R16,R28
subi R16,254 ; offset = 2
sbci R17,255
rcall _DS1302_getT
.dbline 103
movw R16,R28
subi R16,254 ; offset = 2
sbci R17,255
rcall _Disp_time
.dbline 104
ldi R16,100
ldi R17,0
rcall _delay
.dbline 105
L456:
.dbline 100
lds R2,_exit1
tst R2
breq L455
.dbline 106
clr R2
sts _exit1,R2
.dbline 107
sts _exit2,R2
.dbline 108
sts _enter1,R2
.dbline 109
ldi R24,1
sts _number1,R24
.dbline 110
rcall _LcmInit
.dbline 111
ldi R16,10
ldi R17,0
rcall _delay
rjmp L459
L458:
.dbline 113
.dbline 114
lds R20,_number1
clr R21
cpi R20,1
ldi R30,0
cpc R21,R30
breq L464
cpi R20,2
ldi R30,0
cpc R21,R30
breq L465
cpi R20,3
ldi R3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -