Written assignments are not worth as much as lab assignments, but are designed to give you some extra practice on lecture material and on some of the type of questions you may see on course exams.
You are allowed to work with one or two classmates of your choice, but no groups larger than three (just split up if you have a large group). You may also work alone. However, I suggest working together to compare answers and submit a single joint solution.
If you work with a partner(s) only one of you should submit yor joint solution (and make sure all of your names are on it).
Start by copying over a file that you will print out with your solution to question 1:
cd cd cs31 mkdir written_hw cd written_hw mkdir hw01 cd hw01 cp ~newhall/public/cs31/hw01/* . ls README diss.sIf you work with partners you can share solutions by emailing the diss.s file back and forth (or printing out hard copies for each of you).
You will solve 2 problems: the first can be written up in the diss.s file and then printed out, or you can print out diss.s and write your answers on the print out. To print on our system:
lpr diss.sYou can insert page break characters (CNTL-L) into your ascii file to make good choices for page breaks in your print out. The diss.s has an example page break character between parts a and b.
Questions:
x is at R[%ebp]-4 y is at R[%ebp]-8 z is at R[%ebp]-12
int hamster, bunny, gerbil; hamster = 12; bunny = 90; gerbil = hamster - bunny; while(hamster < bunny){ hamster *= 2; gerbil += hamster; }You will do this in two steps, and show both steps:
hamster is at R[%ebp]-4 bunny is at R[%ebp]-8 gerbil is at R[%ebp]-12To receive partial credit annotate your IA32 code with comments describing to which part(s) of the C code it corresponds.
Submit a printout/hard-copy of your answers by the due date. Make sure your name(s) are clearly printed on what you hand in, and if you work with a partner(s), please only submit a single joint solution, and please staple all your pages together.
To print out a file on our system:
lpr filename