home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_10 / DEVPAC56.ZIP / MATMULT2.S56 < prev    next >
Text File  |  1993-12-20  |  1KB  |  61 lines

  1.  
  2. ;    MATMULT2.S56 Matrix multiplication for the Atari Falcon
  3. ;    part of the HiSoft DevpacDSP tutorial.
  4. ;    (c) Copyright HiSoft 1993
  5. ;      All rights reserved.
  6. ;    Matrix multiplication for the Atari Falcon
  7. ;
  8.  
  9. N    equ     4
  10.  
  11.     org    P:$40
  12. start
  13.  
  14. ; first set the modulo registers corresponding to all the
  15. ; R registers we are going to use to disable modulo addresssing
  16.     move    #-1,M0
  17.     move    #-1,M1
  18.     move    M0,M4
  19.     move    M0,M5
  20.     move    M0,M6
  21.     move    #bbuffer,R5
  22.     move    #cbuffer,R6
  23.     move    #N,N0    
  24.     move    #N,N5
  25.     do    #N,iloop
  26.     move    #abuffer,R1    
  27.     do    #N,jloop
  28.     move    R5,R4        
  29.     clr    a        R1,R0
  30.     do    #N,kloop
  31.     move    X:(R0)+N0,X0    Y:(R4)+,Y0
  32.     mac    x0,y0,A
  33. kloop
  34.     move    (R1)+
  35. ; Now store A in two DSP words
  36.     move    A2,Y:(R6)+        
  37.     move    A1,Y:(R6)+
  38. jloop
  39.     lua    (R5)+N5,R5
  40. iloop
  41.  
  42. forever    jmp    forever ;        just hang
  43.  
  44.     org     X:$40
  45. abuffer    dc     .07483626,.184443,.7055502,.1768224 
  46.     dc     .5215743,.6521941,.4704354,.455802 
  47.     dc     .8373808,.519858,.09587825,.379077 
  48.     dc     .371908,.3766014,.202421,.8229417 
  49.  
  50.  
  51.     org    Y:$1000
  52. bbuffer
  53.     dc     .1410046,.1712484,.3422694,.3676988 
  54.     dc     .807768,.6713575,.7668441,.2701154 
  55.     dc     .7455041,.7600289,.6523577,.9965845 
  56.     dc     .9586045,.6935848,.911911,.528457 
  57.  
  58. ; the results
  59. cbuffer    ds    N*N*2
  60.  
  61.     end