Question: Write a program that uses a loop to calculate the rst seven values of the Fibonacci number sequence, described by the following formula: Fib(1) =

Write a program that uses a loop to calculate the rst seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n 1) + Fib(n 2).

Make your series start with the values 1 and 1; then let each successive number be the sum of the two previous numbers. Modify the original directions as follows: generate the first thirty-two (rather than seven) numbers in the series; also define an uninitialized array of 32 doublewords in memory and fill it with the 32-bit values in the series as you compute them. Call Irvines DumpRegs procedure after each value is generated so the registers will be displayed to the screen; in addition, after the last number is generated, call Irvines DumpMem procedure to display the final contents of the thirty-two doubleword values in your array. Use MAKE16, MAKE32, or a Visual Studio project as appropriate to assemble your program and link its object code to the Irvine library procedures. Run your program and test it to make sure it generates correct output (hint: counting 1 and 1 as the first and second values, the 32nd value in the series is 2,178,309 decimal or 00213D05h). Capture and print out a screen shot(s) showing the results of the program (you may have to scroll up/down to see all the output).

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!