Question: Homework 5 Please complete the implementation of the two functions given in the questions section below. After you complete the homework rename the file Hw5_AsmFunctionsArm.S
Homework 5
Please complete the implementation of the two functions given in the questions section below.
After you complete the homework rename the file Hw5_AsmFunctionsArm.S to Hw5_yourredID.S and submit only this file on blackboard. Do not include main.c or add contents ofmain.c to this file.
QUESTION: Write an assembly language function to compute the sum of the first N numbers between 0 and N. N is passed as an argument to the function. The function will be called as shown below
IntsumofFirstNNumbers(int N)
QUESTION: Write an assembly language function to accept two integer arguments N1 and N2 and compute the sum of all even numbers between them. An Even number is evently divisible by 2. Please remember , you can divide a number by two by shifting the number to the right. Similarly you can multiply a number by two by shifting the number to the left.
Youcanthentestifanumberis evenby: If ((number >> 1)<<1) = = number
then the number is even. Otherwise the number is old.
The function will be called as :
int sumofEvenNumbers(int N1, int N2)
Note: You may use the Homework2 as reference for the C program logic and implement the same in assembly. Also, pay attention to the return values and make appropriate changes.
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
