Advertisement
tari

test_branch.asm

Apr 17th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. cmp $0, const # 0 < 20
  2. beq stop
  3. bge stop
  4. bgt stop
  5. blt lt1
  6. b stop
  7. lt1:
  8. bne lt2
  9. b stop
  10. lt2:
  11. ble lt3
  12. b stop
  13. lt3:
  14.  
  15. lw $1, const
  16. cmp $1, const # 20 = 20
  17. bne stop
  18. bgt stop
  19. blt stop
  20. beq eq1
  21. b stop
  22. eq1:
  23. ble eq2
  24. b stop
  25. eq2:
  26. bge eq3
  27. b stop
  28. eq3:
  29.  
  30. addi $1, $1, 1
  31. cmp $1, const # 21 > 20
  32. blt stop
  33. ble stop
  34. beq stop
  35. bgt gt1
  36. b stop
  37. gt1:
  38. bge gt2
  39. b stop
  40. gt2:
  41. bne gt3
  42. b stop
  43. gt3:
  44.  
  45. lw $2, const
  46. stop:
  47. halt
  48. const: word 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement