home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 202.lha / FFT / index.asm < prev    next >
Encoding:
Assembly Source File  |  1988-12-28  |  1.2 KB  |  40 lines

  1. \ Nick Didkovsky
  2.  
  3. \ This word calculates a storage address given a column number and a
  4. \ XVECTOR descriptor (used in FFT.JF).  
  5. \ Coded in assembler for speed.
  6. \ 72000 calls of this word coded in forth takes 18.68 seconds
  7. \ The same number of calls to the word coded in assembler takes 4.36 seconds!
  8.  
  9. \ Using this in place of forth-coded [I] will reduce time of an FFT.H on a 2048
  10. \ data point sample from 12 seconds to 9 seconds, and will reduce the IFFT.H
  11. \ from 10 seconds to 6.6 seconds.
  12.  
  13. \ Only use this file if you have JForth v1.212 or greater, as it uses 
  14. \ MODULES  to link in to the assembler.  Comment out the definition of [I]
  15. \ in the file FFT.JF, and start that file of by include?'ing this one.
  16.  
  17. DECIMAL
  18. HASH.OFF
  19.  
  20. ANEW TASK-I_ASM
  21.  
  22. ASM [I]    ( index vec_desc -- addr_of_entry )
  23.     MOVE.L    $0(ORG,TOS.L),D0 ( store num-of-entries in D0)
  24.     CMP.L     (DSP),D0
  25.     BGE    2$
  26.     JSR    $2F94(ORG)    ( ABORT!)
  27. 2$:    CMP.L    #$1,(DSP)
  28.     BGE    3$
  29.     JSR    $2F94(ORG)    ( ABORT!)
  30. 3$:    ADD.L   #$10,TOS        ( index ok, get to data part of xvector)
  31.     MOVE.L    (DSP),D0        ( index)
  32.     SUBQ.L    #$1,D0          ( index-1)
  33.     MOVEQ.L #$8,D1
  34.     MULS    D1,D0        ( index*8)
  35.     ADD.L    D0,TOS        ( addr_of_entry)
  36.     ADDQ.L    #$4,DSP         ( nip)    
  37. END-CODE
  38.  
  39. hash.on
  40.