Professional Documents
Culture Documents
How To Use LMC
How To Use LMC
http://peterhigginson.co.uk/LMC/
3. Assembled
1. Enter your
code appears
code in this
here.
window.
Tabs/spaces are
automatic.
2. Click
assemble into
RAM to load
program.
5. If an input is
required, enter
4. Click RUN to here.
6. Click reset to run program.
clear registers.
Click ‘Run’.
Note, there are no prompts in LMC. When a program needs an input it stops and waits for you to
enter a number in the input window.
You can click ‘Reset’ to clear the registers ready for the program to be run again.
DAT is used to declare a variable and can be used as a constant if given a value.
Commands
Mnemonic Instruction
INP
STA 67
3. INP
4. ADD 57
5. OUT
6. HLT
INP
8. STA 67
9. ADD 67
10. OUT
11. HLT
INP
STA 67
NUM DAT
INP
STA 54
NUM DAT
INP
STA 87
NUM DAT
OUT
HLT
13. Input two numbers and output the first number minus the second.
INP
STA 67
INP
STA 54
LDA 67
SUB 54
OUT
HLT