Computer Science: Assembly Language for x86 Processors VS 2017 [C++] Fibonacci N
ID: 3871518 • Letter: C
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 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.
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, don’t 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.
-------------------------------------------------------------------------------
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 .. .Explanation / Answer
USING EAX REGISTER
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.