home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 326.lha / KFFT_v1.1 / fftmisc < prev    next >
Text File  |  1989-12-23  |  785b  |  26 lines

  1. \ Miscelaneous Support Words for KFFT - also in fft.asm
  2. \ Jerry Kallaus  02/14/89
  3. \
  4.  
  5. anew task-miscfft
  6.  
  7. : 2** ( n -- 2**n )  1 swap +shift  both ;
  8.  
  9. : NOT.TOS  $ 4687 w, ; immediate
  10. : COMP not.tos  both ;
  11.  
  12. : NSBITS ( value -- num-significant-bits-plus-1-sign-bit )
  13.     dup 0< if comp then  dup     
  14.         if                       ( exception: return 0 if 0 )
  15.            0 30 -do dup i bit-set? if drop i 2+ leave then 1 -loop
  16.         then ;
  17.  
  18. \ OR magnitudes of array of n cells starting at addr
  19.  
  20. : OR.ABS.ARRAY ( addr ncells -- or-magnitude-bits-of-array )
  21.     0 -rot 0 DO  dup>r @ dup 0< if comp then or r> cell+ loop drop ;
  22.  
  23. : ASHIFT.ARRAY ( addr ncells nbits -- , shift ncells at addr by nbits )
  24.     ?DUP IF  -rot 0  DO 2dup dup>r @ swap ashift r> ! cell+  LOOP  THEN
  25.     2drop  ;
  26.