Question
Write the LMC program which reads in three numbers (one at a time) and places them in memory locations 15, 16, and 17 symbolically denoted
Write the LMC program which reads in three numbers (one at a time) and places them in memory locations 15, 16, and 17 symbolically denoted by variables a, b, and c, respectively. The LMC program should subtract the first two numbers and add the third number to the difference (d:=a-b+c). Next the program should store the result in memory location 18, symbolically denoted by variable d, and print it out. Write the LMC instructions in the mnemonic form. Note that your LMC program will actually implement the following statements written in C# pseudocode below. int a,b,c,d; read a, b, c; d:=a-b+c; print d; address LMC instructions (use mnemonics)
00 IN
01
02
03
04
05
06
07
08
09
10
11
.
.
15 DAT .
16 DAT .
17 DAT .
18 DAT .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started