Question: Computer Science: Assembly Language for x86 Processors VS 2017 [C++] Fibonacci Numbers I need help for Second one.(DumpMem) Write a program that uses a loop
Computer Science: Assembly Language for x86 Processors
VS 2017 [C++]
Fibonacci Numbers
I need help for Second one.(DumpMem)
Write a program that uses a loop to calculate the first 12 values in the Fibonacci number sequence { 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.
![Computer Science: Assembly Language for x86 Processors VS 2017 [C++] Fibonacci Numbers](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f32b563fad0_37366f32b55b1d23.jpg)
Second, Please modify this code to save each Fibonacci number into memory, a BYTE array. Call DumpMem to display result without DumpRegs. Also call WriteString to show "First 12 Fibonacci numbers:"

As a basic rule, if you can use registers, dont use memory either direct or indirect operands. In this exercise, there are enough registers to use. Only operation for memory is to move 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.
-------------------------------------------------------------------------------
INCLUDE Irvine32.inc Message TEXTEQU .data array BYTE DUP (?) first BYTE Message, 0dh, 0ah .code main1 proc mov eax, 1 mov ecx, 11 mov ebx, 0 mov edx, 0 mov edx, OFFSET first call WriteString mov esi,OFFSET array mov ecx,LENGTHOF array mov ebx,TYPE array call DumpMem call Crlf F1: mov edx, ebx mov ebx, eax add eax, edx Loop F1 call WaitMsg invoke ExitProcess,0 main1 endp end main1
RAX=OOOOOOO! ESI=00000000 EIP-0040103A EBX=7FFDP000 EDI=00000000 EFL-00000246 ECK-00000000 RDX=0040100A RBP=0012FF94 ESP=00|2FF8C CP-0 SP-0 ZF=1 OP-0 AF-0 PP-1 RAK-00000090 ESI=00000000 EIP-00401052 EBX=00000037 EDI=00000000 EFL-00000216 ECX=00000001 RDX=00000059 RBP=0012FF94 ESP=0012FF8C CF-0 SF-0 ZF-0 OF-0 AF-1 PF-1 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
