Microsoft Visual C++ Assembly language Problem 3. Write a program that uses a loop to calculate the...

90.2K

Verified Solution

Question

Programming

Microsoft Visual C++ Assembly language

Problem 3. Write a program that uses a loop tocalculate the first seven values of the Fibonacci number sequence,described by the following formula: Fib(1) = 1, Fib(2) = 2, …Fib(n) = Fib(n-1) + Fib(n-2). Place each value in the EAX registerand display it with a call DumpRegs statementinside the loop

For example:

Fib(1) = 1,

Fib(2) = 2,

Fib(3) = Fib(1) + Fib(2) = 3,

Fib(4) = Fib(2) + Fib(3) = 5,

Fib(5) = Fib(3) + Fib(4) = 8,

Fib(6) = Fib(4) + Fib(5) = 13,

Fib(7) = Fib(5) + Fib(6) = 21

Below is an assembly program template that you can refer, andcomplete the programming by filling in the codes into the specifiedplace:

TITLE Midterm Programming Question 3

Comment !

Description: Write a program that uses a loop to calculate thefirst

seven values in the Fibonacci number sequence { 1,1,2,3,5,8,13}.

Place each value in the EAX register and display it with a

call DumpRegs statement inside the loop.

!

INCLUDE Irvine32.inc

.code

main PROC

please fill in your code here

           exit

main ENDP

END main

Please submit the source code of your assembly file (i.e. .asm)and the screenshot to show that your program works well

Answer & Explanation Solved by verified expert
4.1 Ratings (536 Votes)
CodeINCLUDE Irvine32inccodemain PROC mov eax1 call    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students