Assignment 3, due Feb 6
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!
TITLE "hw3.a by Douglas W. Jones, Jan. 29, 2015" ; -- another demo of the MP1 data structure NULL = 0 ; declare the value used for NULL pointers INT ARRAY ; make ARRAY visible to the test program ARRAY: W ITEM1 ; array points to the record ITEM1 W ITEM2 ; array points to the record ITEM1 W NULL ; array, a null pointer ; -- the records: ITEM1: W TEXT1 ; pointer to text H 8, 1 ; X = 8, Y = 1 ITEM2: W TEXT2 H 2, 1 ; X = 2, Y = 1 TEXT1: ASCII "world", 0 TEXT2: B 83 ; * H #7075 ; * W -#FFFF8D9B ; * END
a) What are the values of the identifiers defined by this code (NULL, ARRAY, ITEM1, ITEM2, TEXT1 and TEXT2)? (1 point)
b) Rewrite the 3 lines of code that are commented with stars to use an equivalent ASCII directive. (For full credit, make sure this directive assembles the correct number of bytes into memory; the obvious answer may fall short.) (1 point)
c) Are any of the byte, halfword or word directives used in the above code non-aligned? If so, which ones? (0.5 points)