LMC Input and Output Instructions

The following program will demonstrate the input and output instructions of the LMC.  The first instruction will copy a three-digit number from the In Box to the accumulator, and the second instruction will copy the value of the accumulator to the Out Box.

Program

INP
OUT
HLT

What you should do

  1. Click on the "LMC Simulator Applet" link to start the LMC simulator.
  2. Clear the Message Box and all of the LMC mailboxes -- click the "Clear Messages" button and the "Clear" button if necessary.
  3. Copy the three-line program above and paste it into the Message Box
  4. Click on the "Compile Program" button.
  5. Click on the "Run" button.
  6. When prompted, enter a three-digit number in the "In-Box", and press the "Enter" button.

What you should see