Docsity

CSC 3210 Assignment 2: Assembly Language Program to Find Maximum Value - Prof. Anu G. Bour, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
CSC 3210 – Assignment 2
Summer 2008
due Thursday, July 3rd at 10:00 a.m.
Program Description:
Write an assembly language program to find the maximum of
y = x6 – 14x2 - 56x
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 ymax. If there are multiple
values of x that generate ymax, you only need to indicate one of them. Also, make sure to
define the values of the coefficients 14 and 56 as constants a1 and a2 – 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.
Requirements:
1. Follow the requirements as described above.
2. 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.]
pico compute.m will create the buffer for you to enter your code.
3. To expand the macros and to create the .s assembly code file, run:
gm4 compute.m > compute.s
4. Be sure to include the following information as comments in the header of your
source file:
/* doe2.m
Author: John Doe
Account: jdoe1
Class: CSC 3210
Program #2
Due date: June 28, 2007
Description: (Give a brief description of what your program does.)
*/
5. Follow program standards as presented in your book. Pay special attention to
comments, identifier style, and consistent (tab) indentation.
pf2

Partial preview of the text

Download CSC 3210 Assignment 2: Assembly Language Program to Find Maximum Value - Prof. Anu G. Bour and more Assignments Computer Architecture and Organization in PDF only on Docsity!

CSC 3210 – Assignment 2 Summer 2008 due Thursday, July 3rd^ at 10:00 a.m. Program Description: Write an assembly language program to find the maximum of y = x^6 – 14x^2 - 56x 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 ymax. If there are multiple values of x that generate ymax , you only need to indicate one of them. Also, make sure to define the values of the coefficients 14 and 56 as constants a1 and a2 – 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. Requirements:

  1. Follow the requirements as described above.
  2. 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.] pico compute.m will create the buffer for you to enter your code.
  3. To expand the macros and to create the .s assembly code file, run: gm4 compute.m > compute.s
  4. Be sure to include the following information as comments in the header of your source file: /* doe2.m Author: John Doe Account: jdoe Class: CSC 3210 Program # Due date: June 28, 2007 Description: (Give a brief description of what your program does.) */
  5. Follow program standards as presented in your book. Pay special attention to comments, identifier style, and consistent (tab) indentation.
  1. Document your code. In assembly language, good documentation is very important. For most instructions following main: , add a comment to the end of the line.
  2. Submit your program (lastname2.m) by using the submit script by the date and time indicated above. ./submit doe2.m hw