Motorola DSP56000 Macro Cross Assembler Version 2.01 89-02-13 11:20:35 goertzel.asm Page 1 1 2 section goertzel 3 opt mu,cc,mex,nomd 4 include 'StdDefs' 716 xdef goe_it 717 718 ;*********************************************************************************************** 719 ; 720 ; Perform one iteration of Goertzel algorithm for four channels 721 ; 722 ;*********************************************************************************************** 723 724 P:0000 0D0000 [4 - 4] goe_it jsr $40,y0 ; start offset into table 000040 807 P:003A 46F450 [4 - 146] add y0,a #>$ff,y0 ; add to form access offset 0000FF 808 P:003C 200056 [2 - 148] and y0,a ; limit to 8 bits 809 P:003D 200060 [2 - 150] add x1,a ; add table start address 810 P:003E 21D100 [2 - 152] move a,r1 ; and use for access 811 P:003F 57F400 [4 - 156] move #0.5,b ; scale factor 400000 812 P:0041 5EE900 [4 - 160] move y:(r1+n1),a ; read table entry 813 P:0042 200022 [2 - 162] asr a ; divide by 2 814 P:0043 20001C [2 - 164] sub a,b ; window function coefficient calculated 815 P:0044 1CF000 [4 - 168] move b,x1 y:fiddle,y0 ; shift into y0.... 000000 816 P:0046 2000E0 [2 - 170] mpy x1,y0,a ; and scale coefficient 817 P:0047 5E0000 [2 - 172] move a,y: