Cosc 2150 Assignment 3
Due: Feb 6, 2009
Write the assembly language code in the Simplified IAS, test it with the simulator. Make
sure you test your assembly code and that ALL paths work correctly. Question 1 is worth
20 points and question 2 is worth 10 points.
1. I suggest you test your code with what is listed as well as a=0, b=3 and a=2, b=5 just to
make sure everything works correctly.
But don’t turn in these tests, only the code as listed below.
main () {
int a=1,b=3,c;
if ( (a >0) && ( b <4) ) {
if (b > 2) {
c = 5 + b;
} else {
c = b;
}
} else {
if (a == 1) {
c = 1;
} else {
c = a - b;
}
}
}
2.
main () {
int a, c=0;
for (a=5; a <=15; a=a+5) {
c = c + ( a/5 + 2);
}
c = c * 2;
}
Turn in:
A printed report, which includes the following
1. title page:
Cosc 2150
Homework #3
y o u r N a m e
in large font at the top of the page. At the bottom of the page, include a non-empty statement of help
delivered and help received. It is OK to state that no help was given or received. It is NOT ok to omit the
statement of help.
1.Turn in a printed copy of the compiled code, execution of the code, and memory section for each
problem. You MUST use comments or lose 5 points per problem.