Question: Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read

Using the MARIE computer assembly language, write a program that computes the following expression: z = a * b * c. The computer will read in the input values a, b, and c from the keyboard and the final result (z) have to be displayed. In addition, every time an input value is read in, it must be displayed on the screen. Remember that the instruction set does not have an instruction to execute multiplication. The program must be tested on MARIE simulator.

ORG 100 INPUT /Input value A from keyboard into AC Store A /Store contents of AC at address A INPUT /Input value B from keyboard into AC Store B /Store contents of AC at address B INPUT C /Input value C from keyboard into AC Store C /Store contents of AC at address C

/multiplication tmp= A * B loopB, Load tmp /Load tmp Add A /tmp=tmp+A Store tmp /store new tmp Load B /Load B Subt one /Decrement B Store B /store new B Skipcond 400 /if B=0, skip next instruction Jump loopB /else next loopB /multiplication Z= tmp * C loopC, Load Z /Load Z Add tmp /Z=Z+tmp Store Z /store new Z Load C /Load C Subt one /Decrement C Store C /store new C Skipcond 400 /if C=0, skip next instruction Jump loopC /else next loopC Load Z /Load Z Output /Output value Z (in AC) to display Halt /Terminate program A, DEC 0 B, DEC 0 C, DEC 0 one, DEC 1 /value for decrement tmp, DEC 0 Z, DEC 0

This is the current code, but was deducted points for not showing the input values on the final display. Can someone please fix code to include such and to also fix any other issues you may see. Thanks!

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!