📄 main.s
字号:
andi R24,1
brne L70
.dbline 162
;
;
in R24,0x12
ori R24,16
out 0x12,R24
.dbline 164
;
;
ldi R16,1
xjmp L61
L62:
.dbline 167
;
;
;
.dbline 168
;
clr R16
.dbline -2
L61:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r RxBuf 22 pc
.dbend
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/TWI.C
.dbfunc e delay _delay fV
; x -> R20,R21
; y -> R22,R23
; z -> R16,R17
.even
_delay::
xcall push_gset2
.dbline -1
.dbline 15
.dbline 17
movw R20,R16
xjmp L77
L74:
.dbline 18
ldi R22,1100
ldi R23,4
xjmp L81
L78:
.dbline 18
L79:
.dbline 18
subi R22,1
sbci R23,0
L81:
.dbline 18
cpi R22,0
cpc R22,R23
brne L78
X2:
L75:
.dbline 17
subi R20,1
sbci R21,0
L77:
.dbline 17
cpi R20,0
cpc R20,R21
brne L74
X3:
.dbline -2
.dbline 19
L73:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r x 20 i
.dbsym r y 22 i
.dbsym r z 16 i
.dbend
.dbfunc e TWI_init _TWI_init fV
.even
_TWI_init::
.dbline -1
.dbline 28
.dbline 29
ldi R24,34
sts 112,R24
.dbline 30
clr R2
sts 113,R2
.dbline 31
ldi R24,68
sts 116,R24
.dbline -2
.dbline 32
L82:
.dbline 0 ; func end
ret
.dbend
.dbfunc e TWI_start _TWI_start fc
.even
_TWI_start::
.dbline -1
.dbline 42
.dbline 43
ldi R24,164
sts 116,R24
L84:
.dbline 44
L85:
.dbline 44
lds R2,116
sbrs R2,7
rjmp L84
.dbline 45
ldi R16,1
.dbline -2
L83:
.dbline 0 ; func end
ret
.dbend
.dbfunc e TWI_stop _TWI_stop fV
.even
_TWI_stop::
.dbline -1
.dbline 49
.dbline 50
ldi R24,148
sts 116,R24
.dbline -2
.dbline 51
L87:
.dbline 0 ; func end
ret
.dbend
.dbfunc e TWI_writeB _TWI_writeB fc
; ack -> R20
; c -> R16
.even
_TWI_writeB::
xcall push_gset1
.dbline -1
.dbline 63
.dbline 64
ldi R20,1
.dbline 65
sts 115,R16
.dbline 66
ldi R24,132
sts 116,R24
L89:
.dbline 67
L90:
.dbline 67
lds R2,116
sbrs R2,7
rjmp L89
.dbline 68
lds R24,113
andi R24,248
cpi R24,24
breq L92
.dbline 69
clr R20
L92:
.dbline 70
mov R16,R20
.dbline -2
L88:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r ack 20 c
.dbsym r c 16 c
.dbend
.dbfunc e TWI_readB _TWI_readB fc
; ack -> R16
.even
_TWI_readB::
.dbline -1
.dbline 81
.dbline 82
tst R16
breq L95
.dbline 83
ldi R24,196
sts 116,R24
xjmp L98
L95:
.dbline 85
ldi R24,132
sts 116,R24
L97:
.dbline 86
L98:
.dbline 86
lds R2,116
sbrs R2,7
rjmp L97
.dbline 87
lds R16,115
.dbline -2
L94:
.dbline 0 ; func end
ret
.dbsym r ack 16 c
.dbend
.dbfunc e TWI_page_write _TWI_page_write fc
; i -> R20
; arr -> R22,R23
; n -> R10
; addr -> R20
; devadd -> R12
.even
_TWI_page_write::
xcall push_gset4
mov R20,R18
mov R12,R16
ldd R10,y+8
ldd R22,y+10
ldd R23,y+11
.dbline -1
.dbline 106
.dbline 108
xcall _TWI_start
.dbline 109
mov R16,R12
xcall _TWI_writeB
.dbline 110
mov R16,R20
xcall _TWI_writeB
.dbline 111
ldi R20,1
xjmp L104
L101:
.dbline 112
.dbline 115
movw R30,R22
ldd R16,z+0
xcall _TWI_writeB
.dbline 116
subi R22,255 ; offset = 1
sbci R23,255
.dbline 117
L102:
.dbline 111
inc R20
L104:
.dbline 111
cp R10,R20
brsh L101
.dbline 118
xcall _TWI_stop
.dbline 119
ldi R16,80
ldi R17,0
xcall _delay
.dbline -2
.dbline 120
L100:
xcall pop_gset4
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r arr 22 pc
.dbsym r n 10 c
.dbsym r addr 20 c
.dbsym r devadd 12 c
.dbend
.dbfunc e TWI_write _TWI_write fc
; n_tmp -> R14
; arr -> R20,R21
; n -> R22
; addr -> R10
; devadd -> R12
.even
_TWI_write::
xcall push_gset5
mov R10,R18
mov R12,R16
sbiw R28,4
ldd R22,y+14
ldd R20,y+16
ldd R21,y+17
.dbline -1
.dbline 138
.dbline 140
mov R24,R10
clr R25
andi R24,7
andi R25,0
ldi R25,8
mov R14,R25
sub R14,R24
.dbline 141
cp R14,R22
brsh L109
tst R14
breq L109
.dbline 142
.dbline 143
std y+2,R20
std y+3,R21
std y+0,R14
mov R18,R10
mov R16,R12
xcall _TWI_page_write
.dbline 144
add R10,R14
.dbline 145
sub R22,R14
.dbline 146
mov R2,R14
clr R3
add R20,R2
adc R21,R3
.dbline 147
xjmp L109
L108:
.dbline 149
.dbline 150
std y+2,R20
std y+3,R21
ldi R24,8
std y+0,R24
mov R18,R10
mov R16,R12
xcall _TWI_page_write
.dbline 151
mov R24,R10
subi R24,248 ; addi 8
mov R10,R24
.dbline 152
subi R22,8
.dbline 153
subi R20,248 ; offset = 8
sbci R21,255
.dbline 154
L109:
.dbline 148
cpi R22,8
brsh L108
.dbline 155
tst R22
breq L111
.dbline 156
std y+2,R20
std y+3,R21
std y+0,R22
mov R18,R10
mov R16,R12
xcall _TWI_page_write
L111:
.dbline -2
.dbline 157
L105:
adiw R28,4
xcall pop_gset5
.dbline 0 ; func end
ret
.dbsym r n_tmp 14 c
.dbsym r arr 20 pc
.dbsym r n 22 c
.dbsym r addr 10 c
.dbsym r devadd 12 c
.dbend
.dbfunc e TWI_read _TWI_read fc
; i -> R20
; arr -> R22,R23
; n -> R10
; addr -> R12
; devadd -> R20
.even
_TWI_read::
xcall push_gset4
mov R12,R18
mov R20,R16
ldd R10,y+8
ldd R22,y+10
ldd R23,y+11
.dbline -1
.dbline 175
;
;
;
;
;
;
;
.dbline 177
;
;
xcall _TWI_start
.dbline 178
;
mov R16,R20
xcall _TWI_writeB
.dbline 179
;
mov R16,R12
xcall _TWI_writeB
.dbline 180
;
xcall _TWI_start
.dbline 181
;
mov R16,R20
ori R16,1
xcall _TWI_writeB
.dbline 182
;
ldi R20,1
xjmp L117
L114:
.dbline 183
.dbline 184
ldi R16,1
xcall _TWI_readB
movw R30,R22
std z+0,R16
.dbline 185
subi R22,255 ; offset = 1
sbci R23,255
.dbline 186
L115:
.dbline 182
inc R20
L117:
.dbline 182
mov R24,R10
subi R24,1
cp R24,R20
brsh L114
.dbline 187
;
;
;
;
;
clr R16
xcall _TWI_readB
movw R30,R22
std z+0,R16
.dbline 188
;
xcall _TWI_stop
.dbline -2
.dbline 189
;
L113:
xcall pop_gset4
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r arr 22 pc
.dbsym r n 10 c
.dbsym r addr 12 c
.dbsym r devadd 20 c
.dbend
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290.c
.dbfunc e ZLG7290_WriteReg _ZLG7290_WriteReg fV
; dat -> y+6
; RegAddr -> R20
.even
_ZLG7290_WriteReg::
st -y,r19
st -y,r18
xcall push_gset1
mov R20,R16
sbiw R28,4
.dbline -1
.dbline 23
.dbline 24
movw R24,R28
adiw R24,6
std y+2,R24
std y+3,R25
ldi R24,1
std y+0,R24
mov R18,R20
ldi R16,112
xcall _TWI_write
.dbline -2
.dbline 25
L118:
adiw R28,4
xcall pop_gset1
adiw R28,2
.dbline 0 ; func end
ret
.dbsym l dat 6 I
.dbsym l dat 6 c
.dbsym r RegAddr 20 c
.dbend
.dbfunc e ZLG7290_ReadReg _ZLG7290_ReadReg fV
; dat -> R22,R23
; RegAddr -> R20
.even
_ZLG7290_ReadReg::
xcall push_gset2
movw R22,R18
mov R20,R16
sbiw R28,4
.dbline -1
.dbline 38
.dbline 39
std y+2,R22
std y+3,R23
ldi R24,1
std y+0,R24
mov R18,R20
ldi R16,112
xcall _TWI_read
.dbline -2
.dbline 40
L119:
adiw R28,4
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r dat 22 pc
.dbsym r RegAddr 20 c
.dbend
.dbfunc e ZLG7290_cmd _ZLG7290_cmd fV
; buf -> y+4
; cmd1 -> R20
; cmd0 -> R22
.even
_ZLG7290_cmd::
xcall push_gset2
mov R20,R18
mov R22,R16
sbiw R28,6
.dbline -1
.dbline 53
.dbline 55
std y+4,R22
.dbline 56
std y+5,R20
.dbline 57
movw R24,R28
adiw R24,4
std y+2,R24
std y+3,R25
ldi R24,2
std y+0,R24
ldi R18,7
ldi R16,112
xcall _TWI_write
.dbline -2
.dbline 58
L120:
adiw R28,6
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym l buf 4 A[2:2]c
.dbsym r cmd1 20 c
.dbsym r cmd0 22 c
.dbend
.dbfunc e ZLG7290_SegOnOff _ZLG7290_SegOnOff fV
; cmd -> R20
; b -> R22
; seg -> R20
.even
_ZLG7290_SegOnOff::
xcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 73
.dbline 75
andi R20,63
.dbline 76
tst R22
breq L123
.dbline 76
ori R20,128
L123:
.dbline 77
mov R18,R20
ldi R16,1
xcall _ZLG7290_cmd
.dbline -2
.dbline 78
L122:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r cmd 20 c
.dbsym r b 22 c
.dbsym r seg 20 c
.dbend
.dbfunc e ZLG7290_Download _ZLG7290_Download fV
; cmd1 -> R22
; cmd0 -> R20
; dat -> y+8
; f -> y+6
; dp -> R10
; addr -> R20
.even
_ZLG7290_Download::
xcall push_gset3
mov R10,R18
mov R20,R16
.dbline -1
.dbline 94
.dbline 97
andi R20,15
.dbline 98
ori R20,96
.dbline 99
ldd R22,y+8
andi R22,31
.dbline 100
mov R24,R10
cpi R24,1
brne L126
.dbline 100
ori R22,128
L126:
.dbline 101
ldd R24,y+6
cpi R24,1
brne L128
.dbline 101
ori R22,64
L128:
.dbline 102
mov R18,R22
mov R16,R20
xcall _ZLG7290_cmd
.dbline -2
.dbline 103
L125:
xcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r cmd1 22 c
.dbsym r cmd0 20 c
.dbsym l dat 8 c
.dbsym l f 6 c
.dbsym r dp 10 c
.dbsym r addr 20 c
.dbend
.area vector(rom, abs)
.org 32
jmp _extint0
.area text(rom, con, rel)
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290.c
.area data(ram, con, rel)
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290.c
_FlagINT::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290.c
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290_avr.c
.dbsym e FlagINT _FlagINT i
_flag::
.blkb 2
.area idata
.word 0
.area data(ram, con, rel)
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290_avr.c
.dbsym e flag _flag i
.area text(rom, con, rel)
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290_avr.c
.dbfunc e interrupt_init _interrupt_init fV
.even
_interrupt_init::
.dbline -1
.dbline 19
.dbline 20
sei
.dbline 21
ldi R24,128
out 0x39,R24
.dbline 22
out 0x3a,R24
.dbline 23
cbi 0x2,7
.dbline 24
sbi 0x3,7
.dbline -2
.dbline 25
L130:
.dbline 0 ; func end
ret
.dbend
.dbfunc e extint0 _extint0 fV
.even
_extint0::
st -y,R24
st -y,R25
in R24,0x3f
st -y,R24
.dbline -1
.dbline 32
.dbline 33
ldi R24,1
ldi R25,0
sts _FlagINT+1,R25
sts _FlagINT,R24
.dbline -2
.dbline 34
L131:
ld R24,y+
out 0x3f,R24
ld R25,y+
ld R24,y+
.dbline 0 ; func end
reti
.dbend
.dbfunc e delay1 _delay1 fV
; x -> R20,R21
; y -> R22,R23
; t -> R16,R17
.even
_delay1::
xcall push_gset2
.dbline -1
.dbline 45
.dbline 47
movw R20,R16
xjmp L136
L133:
.dbline 48
ldi R22,1200
ldi R23,4
xjmp L140
L137:
.dbline 48
L138:
.dbline 48
subi R22,1
sbci R23,0
L140:
.dbline 48
cpi R22,0
cpc R22,R23
brne L137
X4:
L134:
.dbline 47
subi R20,1
sbci R21,0
L136:
.dbline 47
cpi R20,0
cpc R20,R21
brne L133
X5:
.dbline -2
.dbline 49
L132:
xcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r x 20 i
.dbsym r y 22 i
.dbsym r t 16 i
.dbend
.dbfunc e SystemInit _SystemInit fV
.even
_SystemInit::
.dbline -1
.dbline 56
.dbline 57
xcall _TWI_init
.dbline 58
xcall _interrupt_init
.dbline 59
ldi R16,30
ldi R17,0
.dbline -2
.dbline 60
L141:
.dbline 0 ; func end
xjmp _delay1
.dbend
.dbfunc e ClearAll _ClearAll fV
; x -> R20
.even
_ClearAll::
xcall push_gset1
sbiw R28,3
.dbline -1
.dbline 67
.dbline 69
clr R20
xjmp L146
L143:
.dbline 70
.dbline 71
ldi R24,31
std y+2,R24
clr R2
std y+0,R2
clr R18
mov R16,R20
xcall _ZLG7290_Download
.dbline 72
L144:
.dbline 69
inc R20
L146:
.dbline 69
cpi R20,8
brlo L143
.dbline -2
.dbline 73
L142:
adiw R28,3
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r x 20 c
.dbend
.area lit(rom, con, rel)
L148:
.byte 238,62
.byte 156,'z
.byte 158,142
.byte 246,'n
.byte 32,'p
.byte 14,28
.byte 58,206
.byte 230,10
.area text(rom, con, rel)
.dbfile E:\PQ-1A\我的AVR\新建文件夹\无线模拟/zlg7290_avr.c
.dbfunc e Test_DispBuf _Test_DispBuf fV
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -