Question: Question 4 ( 2 0 % ) : Write an Assembly program that is composed of the following procedures / subroutines and instructions a .

Question 4(20%): Write an Assembly program that is composed of the following
procedures/subroutines and instructions
a. A Compute procedure that takes a variable, called n, and computes the
following equation:
A=i=0n(2i-5)
You need to use LOOP to compute A. You are not allowed to use the MUL
instruction to implement this function. Instead, you need to use the SHL
instructions.
b. In the main procedure, add the necessary instructions and memory allocations
to call the Compute procedure. In particular, the variables n and A should be
declared in the data segment without initialization. The main function should
set the value of n to 13 and compute the value of A by calling the Compute
function. You need to ensure that the result is correct.
Hent: after running the code, the variable A should store the decimal value of 16313.
Question 4 ( 2 0 % ) : Write an Assembly program

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 Programming Questions!