Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write below code in MASM 8086. Step1: Write an assembly procedure which computes

ID: 3764383 • Letter: W

Question

Write below code in MASM 8086.

Step1: Write an assembly procedure which computes the following:

   int myfib(n) /* n is a positive integer */

   if (n<=3) return 1;

/* else */

return myfib(n-1)+myfib(n-2)+myfib(n-3);

NOTE THAT THE ABOVE FUNCTION IS RECURSIVE. YOUR PROCEDURE NEEDS TO BE RECURSIVE AND COMPUTE EXACTLY AS DESRIBED IN MYFIB(). NO CREDIT WILL BE GIVEN IF YOUR PROCEDURE IS NOT RECURSIVE. NO CREDIT WILL BE GIVEN IF YOUR PROGRAM IS CROSS-ASSEMBLED FROM ANOTHER LANGUAGE.

YOU DECIDE ON WHICH REGISTERS TO USE (FOR PARAMETER PASSING AND RETURNED VALUES, ETC).

Step 2: After completing Step 1, write an assembly program that computes and displays in a separate line the following:

i    myfib(i)

for all integer i, from i=1 to 15.

The initial part of the output will look as the following:

1        1

2        1

3        1

4        3

5        5

6        9

7        17

Explanation / Answer

try this also

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote