CS 200 - lab #1

The lab is due (hard copy of lab report) at the beginning of class on 10/15.
What should be submitted:

Explanation
For this lab you are required to explain and annotate compiler generated assembly code. The source code you are to use is the following simple C program:
#include < stdio.h >

main()
{
	char str[50];

	printf("enter string: ");
	scanf("%s",str);
	printf("string: %s\n",str);
}

You should assemble the C code using gcc and -O2 optimation. To generate assembly output, use the -S option.

Lab Report
Your report should include:

Note: To get full credit for this lab you must demonstrate that you understand every line of assembly output.

I suggest the following resources: