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.outunless 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: |
---|