Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

VS 2017 (C/C++) / Assembly Language / INCLUDE Irvine32.inc Fibonacci_Numbers (Chapter 4, Pr 5, Modified) Write a program that uses a loop to calculate the

VS 2017 (C/C++) / Assembly Language / INCLUDE Irvine32.inc

image text in transcribed

Fibonacci_Numbers (Chapter 4, Pr 5, Modified) Write a program that uses a loop to calculate the first 12 values in the Fibonacci number sequence f 1,1,2,3,5,8,13,21,34,55,89,144). First, place each value in the EAX register and display it with a call DumpRegs statement inside the loop RAX-00000001 ESI-00000000 EBX=7TDr000 EDI-00000000 ECX-00000000 EBP-0012F94 EDX=0040100A ESP-0012FF8C EAX 00000090 EBX 00000037 ECX 00000001 EDX 00000059 ESI-00000000 EDI-00000000 EBP-00127794 ESP-012FF8C Press any key to continue Second, modify your code to save each Fibonacci number into memory, a BYTE array. You call DumpMem to display your result without DumpRegs. Also call WriteString to show "First 12 Fibonacci numbers: First 12 Fibonacci numbers: Dump of offset 00405020 01 01 02 03 05 08 OD 15 22 37 59 90 Press any key to continue As a basic rule, if you can use registers, don't use memory either indexed or indirect operands. In this exercise, there are enough registers to use. Only operation for memory is to move once a calculated Fibonacci number into your Fibonacci array. If well designed, only 4 or 5 instructions necessary in the loop body. When done, submit the final implementation without DumpRegs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions