Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INP # LMC Program which will take 2 inputs and output the first input to the power of the second input
- STA num
- STA addNum
- BRP numPos
- ADD one
- BRA numAll
- numPos SUB one
- numAll STA OGnum
- INP
- BRP powPos
- ADD one
- BRA powAll
- powPos SUB one
- powAll STA power
- outLoop LDA power
- BRZ endProg
- inLoop LDA num
- BRZ endLoop
- LDA output
- ADD addNum
- STA output
- LDA num
- BRP inPos
- ADD one
- BRA inAll
- inPos SUB one
- inAll STA num
- BRA inLoop
- endLoop LDA OGnum
- STA num
- LDA output
- STA addNum
- LDA power
- BRP outPos
- ADD one
- BRA outAll
- outPos SUB one
- outAll STA power
- BRA outLoop
- endProg LDA output
- OUT
- HLT
- hund DAT 100
- one DAT 1
- num DAT
- OGnum DAT
- addNum DAT
- power DAT
- output DAT 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement