============================== How to use the Next I/O Button ============================== -IAN! idallen@ncf.ca The LMC simulators without input/output queues will not stop to let you supply multiple input values or to write down multiple output values. Once you click "GO", the simulator will run to the end of the program. Whatever input value is in the input box will be used for *all* IN (500) instructions, and only the last value output (via OUT - 600) will be left in the output box. Everything else will happen too fast for you to see. This is seldom what you want. Usually, you want the simulator to read different input values, and you want to see *all* the separate output values, not just the last one. Enabling this is the function of the Next I/O button. When you reset the simulator and push Next I/O instead of GO, the simulator runs until *after* the next I/O operation (IN or OUT), then it stops. This lets you change the value in the input box and/or write down the value in the output box. Then, you push Next I/O again. You must pre-load the input slot with the number you want the LMC to use *before* you push Next I/O. The LMC stops *after* reading the number into the calculator, not before. You will always be feeding your input values into the simulator *before* your program needs them. Example: 00 IN 01 STO A 02 OUT 03 IN 04 STO B 05 OUT 06 LDA A 07 ADD B 08 OUT 09 HLT - push RESET - counter goes to zero - put 001 in the input box (pre-load it for the next IN) - push Next I/O - LMC stops at 01, after executing the IN instruction at mailbox 00 - the calculator now contains the "001" from the input box - put 002 in the input box (pre-load it for the next IN) - push Next I/O - LMC stops at 03, after executing the OUT instruction at mailbox 02 - the output box now contains "001" - write down the first output value - push Next I/O - LMC stops at 04, after executing the IN instruction at mailbox 03 - the calculator now contains the "002" from the input box - push Next I/O - LMC stops at 06, after executing the OUT instruction at mailbox 05 - the output box now contains "002" - write down the second output value - push Next I/O - LMC stops at 09, after executing the OUT instruction at mailbox 08 - the output box now contains "003" - write down the third output value - push Next I/O - the LMC stops at 10, after executing the HLT at mailbox 09