CSC 220 Program #1

"Sending out an S.O.S"

Program #1 is:

  • due Tuesday October 18, 2005

  • worth 10 points, or 10% of your grade

Description

Your mission is to implement a "sum of squares" algorithm in Intel assembly. This is the simple program I handed out in class as a MIPS example. Its the one that prints the sum of the squares of numbers from 1 to 100. Please make the following minor (ha!) modifications:

  • Query the user for a number and use that, rather than 100, as the limit for your sum of squares.
  • Limit the maximum number that the user can specify above to, let's say, 1000. If the user specifies a number greater than 1000, then issue an error message and exit
  • Please place the actual summing part of your program in a separate function... something like:

int sum_of_squares( int n)

So, your program should query the user for "n", call sum_of_squares(), and then print the answer. So, the program should include a loop, a function call, an if statement, using scanf() and printf(), local variables, and more! This should be a nice start in our journey toward learning assembly language programming.

  

Logistics

Please place your completed code in the k: drive. This should include:

  • *.s assembly language files
  • *.exe executable file(s)
  • README.txt describing the status of your program... specifically identifying any problems that you were unable to overcome.

You must comment your code. Uncommented programs will face fierce and heavy penalties. Tell me what each block of assembly code is meant to accomplish. Also, please use meaningful names for labels, so that your code is easier to follow. Of course, programs that don't even compile will face a very difficult judgment as well.

And BTW, if we have any math-oriented smarty-pants types... please use a loop to figure the answer as in the sample program, and not a formula. Ha!