Assignment 3, due Sept 12

Part of the homework for 22C:60, Fall 2008
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Remember to write your name on what you turn in! Homework must be turned in on paper and in class!

Homework

  1. Background: The following SMAL assembly code creates a single word in memory by filling the 4 consecutive bytes of that word one at a time.
            B       #D8
            B       "0"
            B       139
            B       " " >> 6
    

    a) That word can be expressed as a single 32-bit quantity. Give that quantity in binary. (Suggestion: You may be able to use the SMAL assembler to help solve this problem, but you need not do so.) (0.5 points)

    b) Give the decimal representation of the binary number from part a, where that number is interpreted as a 32-bit two's complement integer. (Hint: If you get it right, you will see that the answer can be interpreted as a representation of the due date of the assignment.) (0.5 points)

  2. Problem: Write SMAL code to assemble a data structure, in memory, that is described by the following English text. The array Months contains 12 entries, indexed from 0 to 12, where each entry contains two words. The first word of each entry is an integer giving the length of the month, in days, and the second word of each entry gives the memory address of the name of the month, where month names are null-terminated strings. (Ignore leap years! Suggestion: Use the SMAL assembler to check your result for syntax errors.) (2.0 points)

Machine Problem I, due Sept 22

Take the working Hello World program from Chapter 5 of the notes. Get it to work, and then make the following changes to the program:

This isn't really a programming problem, since you aren't really programming yet, just manipulating a pre-existing program. The purpose of this assignment is to get you using the tools for this course.

Submit your SMAL Hawk assembly source file through Icon.

Half credit will be given for cleanly formatted properly commented source code, regardless of whether it works correctly. Half credit will be given for the correct operation of your program, regardless of looks.