Question: Write an LMC program (one program) that reads in two numbers, stores them in memory locations 40 and 41, finds the larger of the two
Write an LMC program (one program) that reads in two numbers, stores them in memory locations 40 and 41, finds the larger of the two numbers, stores the larger number in memory location 42, and outputs the larger number. Note that the LMC instructions start at address 00. You may trace in your memory or on paper the program execution for the two scenarios below:
scenario 1: you enter 5 and 7; and
scenario 2: you enter 7 and 5.
In both cases, your program should output 7.
Does your program
Memory locations returns 7? Circle Yes or No!
Address Instruction 40 41 42
00 ??? Scenario 1 5 7 7 Yes/No
01 ??? Scenario 2 7 5 7 Yes/No
02 ???
03 ???
Address
40 DAT
41 DAT
42 DAT
What range of addresses represents the program area?
What range of the addresses represents the data area?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
