Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. .data
  2. packets:
  3. p1: .word 0x4500003c 0x1c464000 0x4006b1e6 0xac100a63 0xac100a0c
  4. p2: .word 0x45000030 0x44224000 0x80060000 0x8c7c19ac 0xae241e2b
  5. p3: .word 0x45000030 0x44224000 0x8006442e 0x8c7c19ac 0xae241e2b
  6. p4: .word 0x45000031 0x44224000 0x8006442e 0x8c7c19ac 0xae241e2b
  7.  
  8. .text
  9.  
  10. j main #starting point of the program
  11. check: #here I will do the main check for the loop
  12. lw $t1,($s0)
  13. srl $t2, $t1, 16
  14. and $t3, $t1, 0x0000FFFF
  15. add $s1, $s1, $t2
  16. add $s1, $s1, $t3
  17. #down below happens the same but for different hex forms of the packets
  18. lw $t6,($s2)
  19. srl $t8, $t9, 16
  20. and $t4, $t9, 0x0000FFFF
  21. add $s3, $s3, $t8
  22. add $s3, $s3, $t9
  23. jr $ra
  24. main:
  25. la $s0 packets #fetch address of the packet buffer
  26. li $t0, 0
  27. la $s2 packets
  28. li $t5, 0
  29. loop:
  30. bgt $t0, 4, end
  31. addi $t0, $t0, 1
  32. bgt $t5, 4, end #check for the 2nd packet checksum
  33. addi $t5, $t5, 5
  34. jal check
  35. addi $s0, $s0,4
  36. addi $s5, $s5, 4
  37.  
  38. j loop
  39. end:
  40. nop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement