Advertisement
foreverfugazi

wowow

Oct 24th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #MAtrix Addition
  2. .data
  3. mat1: .word 3,3,3,3,3,3,3,3,3
  4. mat2: .word 3,3,3,3,3,3,3,3,3
  5. .equ size,3*3
  6. res: .zero 36
  7.  
  8. .text
  9. li x4,size
  10. la x1, mat1
  11. la x2,mat2
  12. la x3, res
  13.  
  14. addition:
  15. lw x8, 0(x1)
  16. lw x9, 0(x2)
  17. add x10, x8, x9
  18.  
  19. sw x10, 0(x3)
  20. addi x1, x1, 4
  21. addi x2, x2, 4
  22. addi x3, x3, 4
  23. addi x4,x4,-1
  24. bne x4, x0, addition
  25.  
  26. j exit
  27. exit: nop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement