📄 fffff.s
字号:
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R10
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
xcall empy32f
xcall _sin
movw R2,R16
movw R4,R18
ldi R16,<L28
ldi R17,>L28
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R10
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
xcall empy32f
push R2
push R3
push R4
push R5
xcall _cos
pop R5
pop R4
pop R3
pop R2
movw R6,R16
movw R8,R18
ldi R16,2
ldi R17,0
movw R18,R12
xcall empy16s
movw R24,R16
ldd R0,y+41
ldd R1,y+42
add R24,R0
adc R25,R1
movw R30,R24
ldd R16,z+0
ldd R17,z+1
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R18,R12
; stack offset 4
ldd R0,y+28
ldd R1,y+29
add R18,R0
adc R19,R1
ldi R16,2
ldi R17,0
xcall empy16s
movw R30,R16
; stack offset 4
ldd R0,y+43
ldd R1,y+44
add R30,R0
adc R31,R1
ldd R16,z+0
ldd R17,z+1
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
st -y,R5
st -y,R4
st -y,R3
st -y,R2
xcall empy32fs
xcall sub32fs
movw R18,R12
; stack offset 4
ldd R0,y+28
ldd R1,y+29
add R18,R0
adc R19,R1
ldi R16,2
ldi R17,0
xcall empy16s
movw R30,R16
; stack offset 4
ldd R0,y+45
ldd R1,y+46
add R30,R0
adc R31,R1
ldd R16,z+0
ldd R17,z+1
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
st -y,R9
st -y,R8
st -y,R7
st -y,R6
xcall empy32fs
xcall add32f
xcall fp2int
movw R30,R24
std z+1,R17
std z+0,R16
.dbline 38
ldi R16,<L28
ldi R17,>L28
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R10
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
xcall empy32f
xcall _cos
movw R2,R16
movw R4,R18
ldi R16,<L28
ldi R17,>L28
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R10
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
xcall empy32f
push R2
push R3
push R4
push R5
xcall _sin
pop R5
pop R4
pop R3
pop R2
movw R6,R16
movw R8,R18
movw R18,R12
ldd R0,y+24
ldd R1,y+25
add R18,R0
adc R19,R1
ldi R16,2
ldi R17,0
xcall empy16s
movw R24,R16
ldd R0,y+39
ldd R1,y+40
add R24,R0
adc R25,R1
movw R30,R28
ldd R20,z+0
ldd R21,z+1
ldd R22,z+2
ldd R23,z+3
st -y,R23
st -y,R22
st -y,R21
st -y,R20
movw R30,R24
ldd R16,z+0
ldd R17,z+1
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
st -y,R5
st -y,R4
st -y,R3
st -y,R2
xcall empy32fs
xcall sub32fs
movw R18,R12
; stack offset 4
ldd R0,y+28
ldd R1,y+29
add R18,R0
adc R19,R1
ldi R16,2
ldi R17,0
xcall empy16s
movw R30,R16
; stack offset 4
ldd R0,y+45
ldd R1,y+46
add R30,R0
adc R31,R1
ldd R16,z+0
ldd R17,z+1
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
st -y,R9
st -y,R8
st -y,R7
st -y,R6
xcall empy32fs
xcall sub32f
xcall fp2int
movw R30,R24
std z+1,R17
std z+0,R16
.dbline 39
ldi R16,<L28
ldi R17,>L28
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R10
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
xcall empy32f
xcall _sin
movw R2,R16
movw R4,R18
ldi R16,<L28
ldi R17,>L28
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R10
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
xcall empy32f
push R2
push R3
push R4
push R5
xcall _cos
pop R5
pop R4
pop R3
pop R2
movw R6,R16
movw R8,R18
movw R30,R28
ldd R20,z+4
ldd R21,z+5
ldd R22,z+6
ldd R23,z+7
st -y,R23
st -y,R22
st -y,R21
st -y,R20
movw R30,R28
; stack offset 4
ldd R20,z+12
ldd R21,z+13
ldd R22,z+14
ldd R23,z+15
st -y,R23
st -y,R22
st -y,R21
st -y,R20
st -y,R5
st -y,R4
st -y,R3
st -y,R2
xcall empy32fs
xcall add32fs
movw R18,R12
; stack offset 4
ldd R0,y+28
ldd R1,y+29
add R18,R0
adc R19,R1
ldi R16,2
ldi R17,0
xcall empy16s
movw R30,R16
; stack offset 4
ldd R0,y+45
ldd R1,y+46
add R30,R0
adc R31,R1
ldd R16,z+0
ldd R17,z+1
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
st -y,R9
st -y,R8
st -y,R7
st -y,R6
xcall empy32fs
xcall sub32f
xcall fp2int
movw R2,R16
movw R18,R12
ldd R0,y+24
ldd R1,y+25
add R18,R0
adc R19,R1
ldi R16,2
ldi R17,0
xcall empy16s
movw R30,R16
ldd R0,y+41
ldd R1,y+42
add R30,R0
adc R31,R1
std z+1,R3
std z+0,R2
.dbline 40
L25:
.dbline 34
ldi R16,2
ldi R17,0
ldd R18,y+24
ldd R19,y+25
xcall empy16s
add R12,R16
adc R13,R17
L27:
.dbline 34
movw R24,R12
cpi R24,16
ldi R30,0
cpc R25,R30
brge X1
xjmp L24
X1:
.dbline 41
L18:
.dbline 30
movw R24,R14
adiw R24,1
movw R14,R24
L20:
.dbline 30
ldd R24,y+24
ldd R25,y+25
sbiw R24,1
cp R24,R14
cpc R25,R15
brlt X2
xjmp L17
X2:
.dbline 42
L11:
.dbline 26
ldd R24,y+27
ldd R25,y+28
adiw R24,1
std y+28,R25
std y+27,R24
.dbline 26
ldi R24,4
ldi R25,0
ldd R0,y+27
ldd R1,y+28
cp R24,R0
cpc R25,R1
brlt X3
xjmp L10
X3:
.dbline 43
; { TR=dataR[k]; TI=dataI[k]; temp=dataR[k+b];
; dataR[k]=dataR[k]+dataR[k+b]*cos(qq*p)+dataI[k+b]*sin(qq*p);
; dataI[k]=dataI[k]-dataR[k+b]*sin(qq*p)+dataI[k+b]*cos(qq*p);
; dataR[k+b]=TR-dataR[k+b]*cos(qq*p)-dataI[k+b]*sin(qq*p);
; dataI[k+b]=TI+temp*sin(qq*p)-dataI[k+b]*cos(qq*p);
; } /* END for (3) */
; } /* END for (2) */
; } /* END for (1) */
; for(i=0;i<32;i++)
clr R0
std y+26,R0
xjmp L32
L29:
.dbline 44
; { /* 只需要32次以下的谐波进行分析 */
.dbline 45
; w[i]=sqrt(dataR[i]*dataR[i]+dataI[i]*dataI[i]);
ldi R24,2
ldd R0,y+26
mul R24,R0
movw R2,R0
movw R30,R2
ldd R0,y+39
ldd R1,y+40
add R30,R0
adc R31,R1
ldd R4,z+0
ldd R5,z+1
movw R30,R2
ldd R0,y+41
ldd R1,y+42
add R30,R0
adc R31,R1
ldd R6,z+0
ldd R7,z+1
movw R18,R6
movw R16,R6
xcall empy16s
movw R6,R16
movw R18,R4
movw R16,R4
xcall empy16s
add R16,R6
adc R17,R7
xcall int2fp
push R2
push R3
xcall _sqrt
pop R3
pop R2
ldi R24,<_w
ldi R25,>_w
movw R30,R2
add R30,R24
adc R31,R25
xcall fp2int
std z+1,R17
std z+0,R16
.dbline 46
; if(!i)
ldd R0,y+26
tst R0
brne L33
.dbline 47
; {
.dbline 48
; w[i]=w[i]/64;
ldi R24,2
mul R24,R0
movw R2,R0
ldi R24,<_w
ldi R25,>_w
add R2,R24
adc R3,R25
ldi R18,64
ldi R19,0
movw R30,R2
ldd R16,z+0
ldd R17,z+1
xcall div16s
movw R30,R2
std z+1,R17
std z+0,R16
.dbline 49
; }
L33:
.dbline 50
L30:
.dbline 43
ldd R0,y+26
inc R0
std y+26,R0
L32:
.dbline 43
ldd R24,y+26
cpi R24,32
brsh X4
xjmp L29
X4:
.dbline 51
; }
; w[0]=w[0]/2;
ldi R18,2
ldi R19,0
lds R16,_w
lds R17,_w+1
xcall div16s
sts _w+1,R17
sts _w,R16
.dbline -2
L1:
adiw R28,29
xcall pop_gset5
adiw R28,4
.dbline 0 ; func end
ret
.dbsym l x6 22 I
.dbsym l x5 20 I
.dbsym l x4 18 I
.dbsym l xx 16 I
.dbsym l x3 14 I
.dbsym l x2 12 I
.dbsym r x1 12 I
.dbsym r x0 10 I
.dbsym l L 27 I
.dbsym r j 14 I
.dbsym l temp 8 D
.dbsym l TI 4 D
.dbsym l TR 0 D
.dbsym l i 26 c
.dbsym r p 10 I
.dbsym l b 24 I
.dbsym r k 12 I
.dbsym l dataI 41 pI
.dbsym l dataR 39 pI
.dbend
.dbfunc e main _main fV
.even
_main::
.dbline -1
.dbline 55
; } /* END FFT */
;
; void main ()
; {
.dbline 56
; FFT(dataR,dataI);
ldi R18,<_dataI
ldi R19,>_dataI
ldi R16,<_dataR
ldi R17,>_dataR
xcall _FFT
L36:
.dbline 57
L37:
.dbline 57
xjmp L36
X5:
.dbline -2
L35:
.dbline 0 ; func end
ret
.dbend
.area bss(ram, con, rel)
.dbfile D:\HJN\Design\AVR\fft\fffff.c
_w::
.blkb 64
.dbsym e w _w A[64:32]I
_dataI::
.blkb 32
.dbsym e dataI _dataI A[32:16]I
.area lit(rom, con, rel)
L28:
.word 0xfda,0x3ec9
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -