COSC 065 Hardware Systems

Fall 2006

Homework Assignment #4

Basic Intel Assembly Language

Due: Friday, Dec 01, 12:00PM CST
Work may be completed in groups of two students. I strongly recommend that you take the time to meet with your partner in person and work together on these projects, rather than work separately and try to integrate at the last minute.
Background:

Your work on Intel assembly language must be assembled and run on Pascal (pascal.mscs.mu.edu).

Assemble your programs on Pascal using the command:

gcc <myfile.S>

Run your programs on Pascal using the command:

./a.out
unless you have used the "-o" option to gcc to change the name of your assembled executable.

Few rules govern the format of assembly language programs. Make an effort to keep your programs readable and well-documented; sometimes the professor gives partial credit if he can tell what you were trying to do, even if it doesn't quite make it.
Q1 - Stats

Write an assembler program that reads in integers from the user until a zero is entered. Print the total, the average (total divided by number of items, truncated to an integer), the highest integer seen, and the lowest integer seen.

The professor has provided an example program for your reference, runnable on Morbius as ~brylow/cosc065/bin/hw4-stats.

You may assume that overflow and underflow do NOT occur.
Q2 - Exponent

Write an assembler program that reads two positive integers, x and y, and prints x to the y power. Your program should continue asking for integers until it has gotten two positive numbers.

The professor has provided an example program for your reference, runnable on Morbius as ~brylow/cosc065/bin/hw4-exp.

You may assume that overflow and underflow do NOT occur.
Q3 - Celsius to Fahrenheit

Write an assembler program that reads a positive integer, and converts that integers from a temperature on the Celsius scale to a temperature on the Fahrenheit scale. You need only use integer precision for the conversion.

The professor has provided an example program for your reference, runnable on Morbius as ~brylow/cosc065/bin/hw4-ctof.

You may assume that overflow and underflow do NOT occur.
What to turn in:

  • E-mail your three assembly source files to the professor, with a subject header "COSC 065 HW#8".
  • Be certain to put both team member names on work submitted. It would be courteous to carbon-copy your teammate when e-mailing the final submission.
    Back