Question: Problem 2 : Write an ARMv 7 assembly program that calculates the first 1 5 numbers of the Fibonacci sequence and performs the following tasks:
Problem : Write an ARMv assembly program that calculates the first numbers of the Fibonacci sequence and performs the following tasks:
Store the Fibonacci sequence for the first numbers in an array in memory.
Sum only the even Fibonacci numbers and store the result in RO
Count the number of even Fibonacci numbers in the sequence and store the count in R
Find the largest Fibonacci number in the sequence and store it in R
Additional Requirements:
Use a loop to generate the Fibonacci sequence and store it in the memory.
You can not use the dcd command to store value in the memory. You have to generate a loop and use the STR command to store the value in the memory. You can start your array in the memory from x location.
Use conditional instructions to check if a number is even.
Use pointers for storing and accessing array elements.
Extra Credit Assignment
Example Calculation
The first Fibonacci numbers are:
Even numbers:
Sum of even numbers:
Count of even numbers:
Largest Fibonacci number:
Expected Output:
RO sum of even Fibonacci numbers
Rcount of even Fibonacci numbers
Rlargest Fibonacci number
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
