home *** CD-ROM | disk | FTP | other *** search
File List | 1987-05-14 | 13.2 KB | 397 lines |
-
-
-
- Motorola DSP56000 Macro Cross Assembler Version 1.00 05-14-87 11:35:33 fft.asm Page 1
-
-
-
- 1 page 132,66,3,3
- 2 opt nomd,mex,cre,cex,mu,rc
- 3
- 4 include 'sintab'
- 5 ;
- 6 ; sintab - macro to generate twiddle factor lookup tables for
- 7 ; Decimation in Time FFT
- 8 ;
- 9 ; cosine value in X memory
- 10 ; -sine value in Y memory
- 11 ;
- 12 ; points - number of points (4 - 32768, power of 2)
- 13 ; twiddle - start of sine/cosine table
- 14 ;
- 15
- 37 include 'ditfft'
- 127 ;
- 128 ; Main program to call the FFT macro
- 129 ;
- 130 ; N point complex DIT FFT
- 131 ; M FFT passes
- 132 ; Data starts at address 0
- 133 ; Twiddle factor table starts at address N
- 134 ;
- 135 ; Command line example for a 16 point FFT:
- 136 ;
- 137 ; asm56000 -b -l -dPOINTS '16' -dPASSES '4' fft
- 138 ;
- 139
- 140 00000010 points equ 16
- 141 00000004 passes equ 4
- 142 00000010 twiddle equ 16
- 143 00000000 reset equ 0
- 144 00000000 data equ 0
- 145 00000100 start equ $100
- 146
- 147 sintab points,twiddle
- 148 +
- 149 + 3.141593 PI equ 3.141592654
- 150 + 00000008 ENT equ points/2
- 151 + 0.392699 FREQ equ PI/@cvf(ENT)
- 152 +
- 153 + X:0010 org x:twiddle
- 154 + 00000000 count set 0
- **** 159 [fft.asm 26]: WARNING --- Floating point value outside fractional domain
- 159 d+ X:0010 7FFFFF dc @cos(@cvf(count)*FREQ)
- 160 + 00000001 count set count+1
- 161 d+ X:0011 7641AF dc @cos(@cvf(count)*FREQ)
- 162 + 00000002 count set count+1
- 163 d+ X:0012 5A8279 dc @cos(@cvf(count)*FREQ)
- 164 + 00000003 count set count+1
- 165 d+ X:0013 30FBC5 dc @cos(@cvf(count)*FREQ)
- 166 + 00000004 count set count+1
- 167 d+ X:0014 000000 dc @cos(@cvf(count)*FREQ)
- 168 + 00000005 count set count+1
- 169 d+ X:0015 CF043B dc @cos(@cvf(count)*FREQ)
-
-
-
-
-
-
- Motorola DSP56000 Macro Cross Assembler Version 1.00 05-14-87 11:35:33 fft.asm Page 2
-
-
-
- 170 + 00000006 count set count+1
- 171 d+ X:0016 A57D87 dc @cos(@cvf(count)*FREQ)
- 172 + 00000007 count set count+1
- 173 d+ X:0017 89BE51 dc @cos(@cvf(count)*FREQ)
- 174 + 00000008 count set count+1
- 175 +
- 176 + Y:0010 org y:twiddle
- 177 + 00000000 count set 0
- 182 d+ Y:0010 000000 dc -@sin(@cvf(count)*FREQ)
- 183 + 00000001 count set count+1
- 184 d+ Y:0011 CF043B dc -@sin(@cvf(count)*FREQ)
- 185 + 00000002 count set count+1
- 186 d+ Y:0012 A57D87 dc -@sin(@cvf(count)*FREQ)
- 187 + 00000003 count set count+1
- 188 d+ Y:0013 89BE51 dc -@sin(@cvf(count)*FREQ)
- 189 + 00000004 count set count+1
- 190 d+ Y:0014 800000 dc -@sin(@cvf(count)*FREQ)
- 191 + 00000005 count set count+1
- 192 d+ Y:0015 89BE51 dc -@sin(@cvf(count)*FREQ)
- 193 + 00000006 count set count+1
- 194 d+ Y:0016 A57D87 dc -@sin(@cvf(count)*FREQ)
- 195 + 00000007 count set count+1
- 196 d+ Y:0017 CF043B dc -@sin(@cvf(count)*FREQ)
- 197 + 00000008 count set count+1
- 198 +
- 199
- 200 P:0000 org p:reset
- 201 P:0000 0C0100 jmp start
- 202
- 203 P:0100 org p:start
- 204 ditfft points,passes,data,twiddle
- 205 + ;
- 206 + ; Radix 2 Decimation in Time In-Place Fast Fourier Transform Routine
- 207 + ;
- 208 + ; Complex input and output data
- 209 + ; Real data in X memory
- 210 + ; Imaginary data in Y memory
- 211 + ; Normally ordered input data
- 212 + ; Bit reversed output data
- 213 + ; Twiddle factors lookup table
- 214 + ; Cosine value in X memory
- 215 + ; -Sine value in Y memory
- 216 + ;
- 217 + ; Macro Call - ditfft points,passes,data,twiddle
- 218 + ;
- 219 + ; points number of points (4-32768, power of 2)
- 220 + ; passes number of fft passes (log2 points)
- 221 + ; data start of data buffer
- 222 + ; twiddle start of sine/cosine table
- 223 + ;
- 224 + ; Alters Data ALU Registers
- 225 + ; x1 x0 y1 y0
- 226 + ; a2 a1 a0 a
- 227 + ; b2 b1 b0 b
- 228 + ;
- 229 + ; Alters Address Registers
-
-
-
-
-
-
- Motorola DSP56000 Macro Cross Assembler Version 1.00 05-14-87 11:35:33 fft.asm Page 3
-
-
-
- 230 + ; r0 n0 m0
- 231 + ; r1 n1 m1
- 232 + ; n2
- 233 + ;
- 234 + ; r4 n4 m4
- 235 + ; r5 n5 m5
- 236 + ; r6 n6 m6
- 237 + ;
- 238 + ; Alters Program Control Registers
- 239 + ; pc sr
- 240 + ;
- 241 + ; Uses 6 locations on System Stack
- 242 + ;
- 243 + ; Authors - Kevin Kloker and Garth Hillman
- 244 + ; Latest Revision - Jan. 20, 1986
- 245 + ;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Motorola DSP56000 Macro Cross Assembler Version 1.00 05-14-87 11:35:33 fft.asm Page 4
-
-
-
- 247 + P:0100 381000 move #points,n0 ;initialize butterflies per group
- 248 + P:0101 3A0100 move #1,n2 ;initialize groups per pass
- 249 + P:0102 3E0400 move #points/4,n6 ;initialize twiddle offset
- 250 + P:0103 05F420 move #-1,m0 ;initialize address modifiers
- FFFFFF
- 251 + P:0105 0461A0 move m0,m1 ;for linear addressing
- 252 + P:0106 0464A0 move m0,m4
- 253 + P:0107 0465A0 move m0,m5
- 254 + P:0108 0500A6 move #0,m6 ;initialize twiddle factor address modifier
- 255 + ;for reverse carry (bit reversed) addressing
- 256 + ;
- 257 + ; Perform all FFT passes with triple nested DO loop
- 258 + ;
- 259 + P:0109 060480 do #passes,_end_pass
- 000126
- 260 + P:010B 230C00 move n0,a1 ;divide butterflies per group by two
- 261 + P:010C 300023 lsr a #data,r0 ;and initialize A input pointer
- 262 + P:010D 219800 move a1,n0 ;update butterflies per group
- 263 + P:010E 221400 move r0,r4 ;initialize A output pointer
- 264 + P:010F 044811 lua (r0)+n0,r1 ;initialize B input pointer
- 265 + P:0110 045115 lua (r1)-,r5 ;initialize B output pointer
- 266 + P:0111 361000 move #twiddle,r6 ;initialize twiddle factor pointer
- 267 + P:0112 231900 move n0,n1 ;initialize pointer offsets
- 268 + P:0113 231C00 move n0,n4
- 269 + P:0114 231D00 move n0,n5
- 270 +
- 271 + P:0115 06DA00 do n2,_end_grp
- 000123
- 272 + P:0117 C4C100 move x:(r1),x1 y:(r6),y0 ;lookup -sine value
- 273 + P:0118 CB8500 move x:(r5),a y:(r0),b ;dummy load of a
- 274 + P:0119 44CE00 move x:(r6)+n6,x0 ;lookup cosine value
- 275 +
- 276 +
- 277 + P:011A 06D800 do n0,_end_bfy
- 000121
- 278 + P:011C 4FD9EA mac x1,y0,b y:(r1)+,y1 ;Radix 2 DIT butterfly kernel
- 279 + P:011D CA1DCB macr x0,y1,b a,x:(r5)+ y:(r0),a ;with constant twiddle factor
- 280 + P:011E 8F8016 subl b,a x:(r0),b b,y:(r4)
- 281 + P:011F 8AB8AA mac x1,x0,b x:(r0)+,a a,y:(r5)
- 282 + P:0120 45E1BF macr -y1,y0,b x:(r1),x1
- 283 + P:0121 CF1C16 subl b,a b,x:(r4)+ y:(r0),b
- 284 + _end_bfy
- 285 + P:0122 D92D00 move a,x:(r5)+n5 y:(r1)+n1,y1 ;dummy load of x1 and y1
- 286 + P:0123 D58800 move x:(r0)+n0,x1 y:(r4)+n4,y1
- 287 + _end_grp
- 288 + P:0124 234C00 move n2,a1
- 289 + P:0125 200033 lsl a ;multiply groups per pass by two
- 290 + P:0126 219A00 move a1,n2 ;update groups per pass
- 291 + _end_pass
- 292 end
- 0 Errors
- 1 Warnings
-
-
-
-
-
-
-
-
-
-
- Motorola DSP56000 Macro Cross Assembler Version 1.00 05-14-87 11:35:33 fft.asm Page 5
-
-
-
- Define symbols:
-
- Symbol Definition
-
- PASSES........'4'
- POINTS........'16'
-
-
- Macros:
-
- Name Definition Section
- Line
-
- ditfft........38
- sintab........16
-
-
- Symbols:
-
- Name Type Value Section Attributes
-
- ENT...........int 00000008 GLOBAL
- FREQ..........fpt 0.392699 GLOBAL
- PI............fpt 3.141593 GLOBAL
- count.........int 00000008 SET GLOBAL
- data..........int 00000000 GLOBAL
- passes........int 00000004 GLOBAL
- points........int 00000010 GLOBAL
- reset.........int 00000000 GLOBAL
- start.........int 00000100 GLOBAL
- twiddle.......int 00000010 GLOBAL
-
-
- Symbol cross-reference listing:
-
- Name Line number (* is definition)
- ENT........... 150* 151 155 178
- FREQ.......... 151* 159 161 163 165 167 169 171 173 182 184 186 188 190
- 192 194 196
- PI............ 149* 151
- count......... 154* 159 160 160* 161 162 162* 163 164 164* 165 166 166* 167
- 168 168* 169 170 170* 171 172 172* 173 174 174* 177* 182 183
- 183* 184 185 185* 186 187 187* 188 189 189* 190 191 191* 192
- 193 193* 194 195 195* 196 197 197*
- data.......... 144* 261
- passes........ 141* 259
- points........ 140* 150 247 249
- reset......... 143* 200
- start......... 145* 201 203
- twiddle....... 142* 153 176 266
-
-
-
-
-
-
-
-
-
-
-
-
- Motorola DSP56000 Macro Cross Assembler Version 1.00 05-14-87 11:35:33 fft.asm Page 6
-
-
-
- Memory Utilization Report
-
-
- X Memory
-
- Start End Length Type Label Section Overlay Address
- 0000 000F 16 UNUSED
- 0010 0017 8 CONST
- 0018 FFFF 65512 UNUSED
-
-
- Y Memory
-
- Start End Length Type Label Section Overlay Address
- 0000 000F 16 UNUSED
- 0010 0017 8 CONST
- 0018 FFFF 65512 UNUSED
-
-
- L Memory
-
- Start End Length Type Label Section Overlay Address
- 0000 FFFF 65536 UNUSED
-
-
- P Memory
-
- Start End Length Type Label Section Overlay Address
- 0000 0000 1 CODE
- 0001 00FF 255 UNUSED
- 0100 0126 39 CODE
- 0127 FFFF 65241 UNUSED
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-