I want to create a code that ask the user to input a number n, then ask for n inputs and store them all in different addresses so they can be read as instructions to be executed.
However, I'm stuck, because I don't know how to store n inputs in n different adresses. So far I am able to ask for an input n and then ask for n inputs, but they are all stored in the same address.
Here is my code:
IN
STO N
loopTop
IN
STO NBS
LDA N
SUB ONE
STO N
BRZ done
BR loopTop
done
OUT
HLT
ONE
DAT 001
N
DAT 000
NBS
DAT 000
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…