============================ Added LMC Coding Exercise #1 ============================ idallen@ncf.ca 1. Download the Enhanced LMC Simulator. Test it with a very simple program, e.g. assemble this into code and enter it in the LMC mailboxes: LDA ONE ADD ONE OUT HLT ONE DAT 001 Press "RESET COUNTER" and then "GO". See 002 in the output slot? Good. What happens if you forget to push RESET and you push GO a second time? Now try this charming little infinte loop (push HALT to stop it): TOP ADD ONE OUT JMP TOP ONE DAT 001 2. Read the web page named with the button "LMC Control" under the Notes&Homework button on the course home page. Note in particular the structure of a WHILE loop, and how similar it is to an IF statement. 3. Translate the following pseudocode algorithm fragment into the LMC mnemonics and data items that make up a complete LMC program: x = 953 while x >= 66 x = x * 2 - 10 endwhile output x My program turned out to be 14 instructions plus 4 data items (3 constants and one variable). Your version may differ slightly. 4. Hand-assemble the mnemonics into LMC numeric codes starting at zero. (Number the instructions; make a label table; generate codes.) 5. Enter the numeric codes into the LMC simulator and run the program. (Note that since the program reads no input and has only one output, you don't need to use NEXT I/O. Just hit GO!) What is the final (only) value output by running the program? (Testing Hint #1: If you change 66 to 953, the output value is 896.) (Testing Hint #2: If you change 66 to 896, the output value is 782.) Hand in: a) The five-column (plus comments) program listing from Step 4. b) The value output by running the program.