Question: Write an assembly language program to find the maximum of y = 3x^4-10x^2-15x for the range -4 x 6, by stepping one by one through

Write an assembly language program to find the maximum of y = 3x^4-10x^2-15x for the range -4 x 6, by stepping one by one through the range. During each iteration, print out a message stating the current value of x and the corresponding value of y. After all iterations, print out a final message stating the max value of y and the corresponding value of x that generated y_max If there are multiple values of x that generate y_max you only need to indicate one of them. Also, make sure to define the values of the coefficients 3, 10 and 15 as constants al,a2, and a 3- the TA may change these values to further test your code. Try to eliminate as many nop instructions as possible and also try to minimize the length of your code. You may run the program using gdb to verify correctness. Make sure to pay close attention to the requirements above. For input of X = -4, output y - 668 For input of,=-3, output y-198 For input of x,= 6, output y- 3438 the maximum output value is y =3438. when input x - 6 Requirements Follow the requirements as described above. Make sure to comment your code. Name your source file 'lastname2.m' and store it in your class account. [It is a.m file rather than a.s file since you will have macro definitions.] Nano. Compute.m, will create the buffer for you to enter your code. To expand the macros and to create the.s assembly code file, run: m4 compute.m greaterthan compute.s To compile your code and create the executable, run: gcc -o compute compute.s Write an assembly language program to find the maximum of y = 3x^4-10x^2-15x for the range -4 x 6, by stepping one by one through the range. During each iteration, print out a message stating the current value of x and the corresponding value of y. After all iterations, print out a final message stating the max value of y and the corresponding value of x that generated y_max If there are multiple values of x that generate y_max you only need to indicate one of them. Also, make sure to define the values of the coefficients 3, 10 and 15 as constants al,a2, and a 3- the TA may change these values to further test your code. Try to eliminate as many nop instructions as possible and also try to minimize the length of your code. You may run the program using gdb to verify correctness. Make sure to pay close attention to the requirements above. For input of X = -4, output y - 668 For input of,=-3, output y-198 For input of x,= 6, output y- 3438 the maximum output value is y =3438. when input x - 6 Requirements Follow the requirements as described above. Make sure to comment your code. Name your source file 'lastname2.m' and store it in your class account. [It is a.m file rather than a.s file since you will have macro definitions.] Nano. Compute.m, will create the buffer for you to enter your code. To expand the macros and to create the.s assembly code file, run: m4 compute.m greaterthan compute.s To compile your code and create the executable, run: gcc -o compute compute.s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
