Assignment 3, due Sep 9
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!
. = 0 W 1234567890 H #02D2, #4996 W 2#01001001100101100000001011010010 W 8#11145401322 B #D2, 2, 8#226, 32#29
A Problem: Which of the above lines, if any, assemble the same value into a word of memory? (0.5 points)
ASCII "Two",CR,LF,"lines",NUL
A Problem: Give SMAL definitions for the symbols CR, LF, and NUL that would make this string assemble correctly. This problem is closely related to exercise i) in Chapter 3 of the notes. (0.5 points)
. = 0 A: W 0 B = . - 3 C = D + #FFFFFFFF D = A + 3 E: B 0
A Problem: What are the values of the 5 identifiers A, B, C, D and E. (0.5 points)
Hints: You can get this by understanding the code (strongly recommended). You can check your answer using the SMAL assembler, either by dumping the symbol table (you get to research how to do this) or by modifying the program to use these values so you can see them in the assembler listing (you get to research how to do this).