Question: This program has to run In LC3 machine simulator as assembly language Extra Credit (10%): Write an LC3 program that includes-a main function (code located

This program has to run In LC3 machine simulator as assembly language

This program has to run In LC3 machine simulator as assembly language

Extra Credit (10%): Write an LC3 program that includes-a main function (code located at the top of your program)- a function MULT that calculates the product of two non-negative numbers The main function should load two values from variables named FACT1 and FACT2, initialized to 3 and 8. Call MULT using those values, store the result in a variable named PRODUCT. The function MULT must be a close translation of the code shown below. It must be recursive and make use of the stack for local variables (when saving register values, for example). Use registers to send parameters and return values. The callee must save and restore registers as necessary There is a simpler recursive version of multiply, but you must implement this one. int mult (intn, int m) if (n1) else if (m1) else returnm; return n; return mult (n-1, m-1)+n+m-1 Name your program Mult.asm Extra Credit (10%): Write an LC3 program that includes-a main function (code located at the top of your program)- a function MULT that calculates the product of two non-negative numbers The main function should load two values from variables named FACT1 and FACT2, initialized to 3 and 8. Call MULT using those values, store the result in a variable named PRODUCT. The function MULT must be a close translation of the code shown below. It must be recursive and make use of the stack for local variables (when saving register values, for example). Use registers to send parameters and return values. The callee must save and restore registers as necessary There is a simpler recursive version of multiply, but you must implement this one. int mult (intn, int m) if (n1) else if (m1) else returnm; return n; return mult (n-1, m-1)+n+m-1 Name your program Mult.asm

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!