Question: Consider the following program, this program has two functions, the main function and one subroutine function called multiplication. Write an equivalent program, using the MARIE
Consider the following program, this program has two functions, the main function and one subroutine function called multiplication. Write an equivalent program, using the MARIE assembly language. void main () { int product1, product2: Product 1 = multiplication (3, 5): Print_int(proudct1): product2 = multiplication (-4, -6): Print_int(proudct2): } int multiplication (int x, int y) { int i, tempprod = 0, num = y: if (y 0) tempprod = tempprod + x: else tempprod = tempprod - x: } return tempprod: }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
