Advertisement
eniallator

LMC Power Program

Mar 11th, 2016
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. INP # LMC Program which will take 2 inputs and output the first input to the power of the second input
  2. STA num
  3. STA addNum
  4. BRP numPos
  5. ADD one
  6. BRA numAll
  7. numPos SUB one
  8. numAll STA OGnum
  9. INP
  10. BRP powPos
  11. ADD one
  12. BRA powAll
  13. powPos SUB one
  14. powAll STA power
  15. outLoop LDA power
  16. BRZ endProg
  17. inLoop LDA num
  18. BRZ endLoop
  19. LDA output
  20. ADD addNum
  21. STA output
  22. LDA num
  23. BRP inPos
  24. ADD one
  25. BRA inAll
  26. inPos SUB one
  27. inAll STA num
  28. BRA inLoop
  29. endLoop LDA OGnum
  30. STA num
  31. LDA output
  32. STA addNum
  33. LDA power
  34. BRP outPos
  35. ADD one
  36. BRA outAll
  37. outPos SUB one
  38. outAll STA power
  39. BRA outLoop
  40. endProg LDA output
  41. OUT
  42. HLT
  43. hund DAT 100
  44. one DAT 1
  45. num DAT
  46. OGnum DAT
  47. addNum DAT
  48. power DAT
  49. output DAT 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement