Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. STRUCTURE   MatrixFloatRow4,0
  2.     FLOAT       r_col0
  3.     FLOAT       r_col1
  4.     FLOAT       r_col2
  5.     FLOAT       r_col3
  6.     LABEL       MatrixFloatRow4_SIZEOF
  7.  
  8.     STRUCTURE   MatrixFloat44,0
  9.     STRUCT      mat_row0,MatrixFloatRow4_SIZEOF
  10.     STRUCT      mat_row1,MatrixFloatRow4_SIZEOF
  11.     STRUCT      mat_row2,MatrixFloatRow4_SIZEOF
  12.     STRUCT      mat_row3,MatrixFloatRow4_SIZEOF
  13.     LABEL       MatrixFloat44_SIZEOF
  14.  
  15. _AddMatrix44:
  16.     PRESERVE
  17.    
  18.     ;a0 = ptr to left  matrix
  19.     ;a1 = ptr to right matrix
  20.     ;results will be stored in MatrixBufferResult
  21.  
  22.     move.l  mathieeesingbas_base,a6
  23.  
  24.     ;Move these so they don't get clobbered.
  25.     move.l  a0,a2
  26.     move.l  a1,a3
  27.     lea MatrixBufferResult,a4
  28.  
  29.     move.l  mat_row0,d4
  30.  
  31.     move.w  #3,d3 ;loop counter
  32.  
  33. .addNextRow
  34.     ;Add a row.
  35.     move.l  (r_col0,a2,d4),d0   ; matrix_left[d4/sizeof(row)][0]
  36.     move.l  (r_col0,a3,d4),d1   ;matrix_right[d4/sizeof(row)][0]
  37.     jsr IEEESPAdd(a6)
  38.     move.l  d0,(r_col0,a4,d4)
  39.  
  40.     move.l  (r_col1,a2,d4),d0   ; matrix_left[d4/sizeof(row)][1]
  41.     move.l  (r_col1,a3,d4),d1   ;matrix_right[d4/sizeof(row)][1]
  42.     jsr IEEESPAdd(a6)
  43.     move.l  d0,(r_col1,a4,d4)
  44.  
  45.     move.l  (r_col2,a2,d4),d0   ; matrix_left[d4/sizeof(row)][2]
  46.     move.l  (r_col2,a3,d4),d1   ;matrix_right[d4/sizeof(row)][2]
  47.     jsr IEEESPAdd(a6)
  48.     move.l  d0,(r_col2,a4,d4)
  49.  
  50.     move.l  (r_col3,a2,d4),d0   ; matrix_left[d4/sizeof(row)][3]
  51.     move.l  (r_col3,a3,d4),d1   ;matrix_right[d4/sizeof(row)][3]
  52.     jsr IEEESPAdd(a6)
  53.     move.l  d0,(r_col3,a4,d4)
  54.  
  55.     add.l   MatrixFloatRow4_SIZEOF,d4 ;advance to next row
  56.     dbra    d3,.addNextRow
  57.  
  58.     RESTORE
  59.     RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement