The following guide should help clarify the grading rubric.
David
Each problem was worth 25 points.
(1) As stated in the question, syntax was worth a lot. Those who
worked hard on the homeworks and labs should have had no issue with
this question. Here are the point values for the more common
mistakes:
-- Not using parentheses (4 points)
-- Using a $ on a constant (2 points)
-- Not following register conventions (4 points)
-- Using labels incorrectly (3 points)
-- Negative constants (3 points)
-- Screwing up the subtraction (4 points)
(2) Each blank was worth 1 point, with the exception of the
representation of -8, 2^15, and the two blanks above mystery_done.
Those were worth 2 points.
To calculate -8, you can start at -1 and count down to -8 using your
fingers. The more general method is -8 - -1 == 7. 4294967295 - 7 ==
4294967288.
I was looking for the instruction "halt" in the second blank, but I
also accepted "ret" since that mapped more clearly onto the X86.
(3) If it wasn't fairly obvious, use of the article "the" implied that
these questions pertained to questions (1) and (2). It was not our
intent to trick you, but it seemed to have happened to a few people
anyway.
A. You needed to evaluate the C code for the input of constant 7.
B. If you reviewed the previous test, and actually did A., hopefully
you got this question.
C. Left shifts. Your answer had to improve performance beyond making
an instruction or two faster to get credit on this question.
D. Right shifts. I know this question could have been written a bit
better, so I also accepted other, more general answers that involved
improving the clarity of any Y86 code.
E. Remember factorial from hw1? I think some of you created a formula
based on your Y86 code. I would have preferred to ask about the Y86,
but since your answers to the Y86 version were bound to vary, we had
to ask about the X86.
(4)
I tried to mark corrections so that you knew what we would be looking
for on the final. There were a lot of things that I did not deduct
points for, because they seemed really specific to a particular
format. Hopefully between 4.1 and 4.2, you have an idea what's
considered a clear answer and will know how to answer such a question
on ths final. Please see me if you have questions.
(4.1) (12 points)
The ideal answer to A was 0x7600000200. There was no need to take
into account endian'ness, because we didn't associate the bytes with
memory addresses.
Execute phase should have been:
Bch <-- cond (cc, 6), and the PC update should have used the value
Bch, not 0 or 1.
4.2 (13 points)
Don't forget to set the condition codes in the execute phase.