Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone help with out with the solution for the question?? I need it to run on Big Endian 7. QUESTION 2 (50 marks) Write
Can anyone help with out with the solution for the question?? I need it to run on Big Endian 7.
QUESTION 2 (50 marks) Write an ARM assembly language function (subroutine) that takes a data value stored in register r0 and returns a value in r0 as well. The function calculates y - a x x+bxx + c where a, b, and c are signed integer parameters built into the function (i.e., they are not passed to it) and are defined in the memory using three DCD assembly directives. If the value of y is greater than a value d (where d is another parameter defined in the memory using a DCD assembly directive), the function will return the value of d. Otherwise, it will return the value of y. The input value (i.e, the value of r0) is a signed integer value. Apart from r0, no other registers may be modified by this subroutine, i.e., if you want to use any register as a working register, you have to store its value in a safe place first prior changing it, and to restore this value before returning from the function. After implementing the function, write an assembly program which loads the value of x from the memory to rO and calls your function. The value of x is defined in the memory using a DCD assembly directive. Once the control is returned back from the function, the program will double the returned value and store this doubled value in rl Your code should be highly optimized. Use as few instructions as possible (as little as 14 assembly instructions only, for both the program and the function, NOT including assembly directives or data definitions)!! Define the data of this program in a separate DATA area Examplel: if a -5, b-6, c-7, d-90, and x -i, Example2: itf Examples: if then the returned value in r0 should be 70 and the value in r1 will be 140. a -5, b-6, c-7, d-50, and x -i, then the returned value in r0 should be 50 and the value in rl wl be 100. a --5, b-6, c 7, d-10, and x- 3, then the returned value in r0 should be -20 and the value in rl will be -40. QUESTION 2 (50 marks) Write an ARM assembly language function (subroutine) that takes a data value stored in register r0 and returns a value in r0 as well. The function calculates y - a x x+bxx + c where a, b, and c are signed integer parameters built into the function (i.e., they are not passed to it) and are defined in the memory using three DCD assembly directives. If the value of y is greater than a value d (where d is another parameter defined in the memory using a DCD assembly directive), the function will return the value of d. Otherwise, it will return the value of y. The input value (i.e, the value of r0) is a signed integer value. Apart from r0, no other registers may be modified by this subroutine, i.e., if you want to use any register as a working register, you have to store its value in a safe place first prior changing it, and to restore this value before returning from the function. After implementing the function, write an assembly program which loads the value of x from the memory to rO and calls your function. The value of x is defined in the memory using a DCD assembly directive. Once the control is returned back from the function, the program will double the returned value and store this doubled value in rl Your code should be highly optimized. Use as few instructions as possible (as little as 14 assembly instructions only, for both the program and the function, NOT including assembly directives or data definitions)!! Define the data of this program in a separate DATA area Examplel: if a -5, b-6, c-7, d-90, and x -i, Example2: itf Examples: if then the returned value in r0 should be 70 and the value in r1 will be 140. a -5, b-6, c-7, d-50, and x -i, then the returned value in r0 should be 50 and the value in rl wl be 100. a --5, b-6, c 7, d-10, and x- 3, then the returned value in r0 should be -20 and the value in rl will be -40Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started