Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Understand how emergent change occurs.

Answered: 1 week ago