Advertisement
foreverfugazi

hamming decode

Sep 12th, 2024
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. .data
  2. uncoded_num: .word 0xa13
  3. decoded_num: .word 0
  4.  
  5. .text
  6. main:
  7. la x1, uncoded_num
  8. lw x2, 0(x1)
  9. andi x3, x2, 1
  10. srli x4, x2, 1
  11. andi x4, x4, 1
  12. srli x5, x2, 3
  13. andi x5, x5, 1
  14. srli x6, x2, 7
  15. andi x5, x5, 1
  16. srli x7, x2, 2
  17. andi x7, x7, 1
  18. srli x8, x2, 4
  19. andi x8, x8, 0x07
  20. srli x9, x2, 8
  21. andi x9, x9, 0x0f
  22. slli x7, x7, 0
  23. slli x8, x8, 1
  24. slli x9, x9, 4
  25. or x10, x7, x8
  26. or x10, x10, x9
  27. sb x10, 4(x1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement