Question
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
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.
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