Assignment 5, due Sep 23
Part of
the homework for 22C:60 (CS:2630), Fall 2011
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (usually Friday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
Also assume that each month object is made up of three consecutive one-word fields, the length of the month in days during a normal year, the length of the month in days during a leap year, and a pointer to the name of the month.
A problem: Write SMAL Hawk code (a fragment of a main program) to print out the name of the month (1.0 points).
L1: BR L3 L2: JUMP L4 L3: BR L1 L4: JUMP L2
a) Show the equivalent machine-language code as a sequence of 16-bit halfwords. (0.5 points)
b) Why does the answer to the above question not depend on the assembly origin? (0.5 points)