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 2: Write an ARMv7 assembly program that calculates the first 15 numbers of the Fibonacci sequence and performs the following tasks:
1. Store the Fibonacci sequence for the first 15 numbers in an array in memory.
2. Sum only the even Fibonacci numbers and store the result in RO.
3. Count the number of even Fibonacci numbers in the sequence and store the count in R1.
4. Find the largest Fibonacci number in the sequence and store it in R2.
Additional Requirements:
1. 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 0x100 location.
2. Use conditional instructions to check if a number is even.
3. Use pointers for storing and accessing array elements.
Extra Credit Assignment
Example Calculation
The first 15 Fibonacci numbers are:
\([0,1,1,2,3,5,8,13,21,34,55,89,144,233,377]\).
- Even numbers: [0,2,8,34,144].
- Sum of even numbers: \(0+2+8+34+144=188\).
- Count of even numbers: 5.
- Largest Fibonacci number: 377.
Expected Output:
- RO =188(sum of even Fibonacci numbers),
- R1=5(count of even Fibonacci numbers),
- R2=377(largest Fibonacci number).
Problem 2 : Write an ARMv 7 assembly program that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!