Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2. ORG $1000
  3. START:
  4. CLR.W D1
  5. MOVE.W NUM1,D2
  6. MOVE.W NUM2,D3
  7. MOVE.W NUM3,D4
  8.  
  9. BSR.S SUM
  10. MOVE.W D4,D5
  11.  
  12. CLR.W D2
  13. CLR.W D3
  14. CLR.W D4
  15.  
  16. MOVE.W NUM4,D2
  17. MOVE.W NUM5,D3
  18. MOVE.W NUM6,D4
  19.  
  20. BSR.S SUM
  21. SUB.W D5,D4
  22. MOVE.W D4,RESULT
  23.  
  24. MOVE.W RESULT,D1
  25. MOVE.W #3,D0
  26. TRAP #15
  27.  
  28. BRA EXIT
  29.  
  30. SUM:
  31. ADD.W D2,D3
  32. ADD.W D3,D4
  33.  
  34. RTS
  35. EXIT:
  36. SIMHALT
  37.  
  38. * VAR
  39. NUM1 DC.W 5
  40. NUM2 DC.W 5
  41. NUM3 DC.W 5
  42. NUM4 DC.W 2
  43. NUM5 DC.W 2
  44. NUM6 DC.W 1
  45. RESULT DC.W 0
  46. END START
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement