Advertisement
yoshi_squashy

LMC - Multiplication function

Sep 2nd, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. INP
  2. STA base
  3. INP
  4. SUB one
  5. STA mValue
  6. BRP posiMLoop
  7.  
  8. LDA mValue
  9. ADD one
  10. BRZ zeroMulti
  11.  
  12. LDA mValue
  13. SUB mValue
  14. SUB mValue
  15. SUB two
  16. STA mValue
  17. BRA negiMLoop
  18.  
  19. posiMLoop LDA total
  20. ADD base
  21. STA total
  22. LDA mValue
  23. SUB one
  24. STA mValue
  25. BRP posiMLoop
  26.  
  27. LDA total
  28. OUT
  29. HLT
  30.  
  31. zeroMulti LDA zero
  32. OUT
  33. HLT
  34.  
  35. negiMLoop LDA total
  36. ADD base
  37. STA total
  38. LDA mValue
  39. SUB one
  40. STA mValue
  41. BRP negiMLoop
  42.  
  43. LDA total
  44. SUB total
  45. SUB total
  46. OUT
  47. HLT
  48.  
  49. base DAT
  50. mValue DAT
  51. total DAT
  52. zero DAT 0
  53. one DAT 1
  54. two DAT 2
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement