I'm just learning about the Little Man Computer CPU simulator, and am using a version online here: http://peterhigginson.co.uk/lmc/
The instruction set used by the simulator is the same as the one here, I believe: https://en.wikipedia.org/wiki/Little_man_computer#Instructions.
I have got confused right at the beginning of my learning due to the way the instruction
INP is handled.
If I have a program with just 1 line -
INP and then watch the simulation, I see that the code
901 is fetched into the CPU, and split into
9 in the instruction register and
01 in the address register.
I am having trouble understanding how the
01 part can be considered to reference a memory location, as the value which is input goes straight onto the accumulator.
My initial theory is that the instruction/memory (or opcode/address) split doesn't apply to the
HLT commands, but only to the remaining ones (ADD, STA etc.), but that the simulator is not built to account to this distinction.
However, I don't have enough experience to know is that is a reasonable assumption or if I am missing something conceptually.
Any clarification much appreciated.