|
CSE Home | About Us | Search | Contact Info |
Homework # 1- MIPS Assembly Language IntroductionAssigned: 3/27/2007Due:4/3/2007 at 5pm IntroductionThis assignment will introduce you to the MIPS assembly language. To gain some familiarity with this, you will have GCC compile some provided C functions into MIPS assembly and comment the assembly produced to show how it lines up with the code. This provides you a chance to see how programs written in a high-level language like you are used to can be broken down into the simpler instructions required by the processor.Getting the assemblyWe have provided you with three functions that you will compile into assembly code and comment:
Commenting the codeNow that you have the .s files along with the original .c files, you will be able to add comments to the .s files in order to show the correspondence. There will not be a line-by-line correspondence between the original C code and the assembly due to the fact that a line of C may require multiple assembly instructions to correctly implement. So, for this assignment, you will be identifying the segments of assembly that correspond to each line of code in the C program and marking them with comments. Here's an example of what you should do:Original C code:Notice that the comments indicating the corresponding line are inserted before the assembly code for that line. The compiler's code will not be as tidy as this example, but try to segment it to match the original C code as best possible. You can ignore any code that isn't an instruction on the green card (For example: .frame, .mask, etc.). Do this for all the functions that you are provided. TurninOnce you have commented all the files, submit them for grading via turnin. Place the three .s files in a location accessible via UNIX, and log into attu via SSH. Change your directory so that you are in the same directory as the files that you wish to submit. Once there, run "turnin -c cse378 -p hw1 add.s loop.s strcpy.s" to submit the files for grading. You do not need to zip the files up or compress them in any other way, as this will be handled by turnin.A few notes about turnin:
|
Computer Science & Engineering University of Washington Box 352350 Seattle, WA 98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to Shen] |