The following program will demonstrate the ADD and SUB instructions of the LMC instruction set.
Running the program: when prompted, INPUT a set of three numbers. The program should add the first two numbers and output the answer, then subtract the first number from the third and output the answer.
first DAT 0 INP
1 STA 9
3 ADD 9
6 SUB 9
9 DAT 0
- This content is restricted to subscribers