Question: 4. Write the LMC program that reads in four numbers (one at a time) and places them in memory locations 55,56,57,58 symbolically denoted by variables

 4. Write the LMC program that reads in four numbers (one

4. Write the LMC program that reads in four numbers (one at a time) and places them in memory locations 55,56,57,58 symbolically denoted by variables a,b,c, and d, respectively, in the C\# like program segment below. The LMC program should subtract the second number from the first number and add the third number and the fourth number to the difference (e:=a+bc+d). Next, the program should store the result in memory location 59 , symbolically denoted by variable e, 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 the C\# pseudocode below. The LMC instructions start at address 00 . int a, b, c, d, e; read a, b, c, d; e:=a+b-c+d; print e; What addresses represent the program area and the data area, respectively? Program area: Data area

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!