Assignment 3, due Sept 17

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

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!

  1. Real Homework!

  2. A problem: From chapter 3 of the notes, do exercise a) with the starting address 9170710 (that is the address you get from the due date for this assignment, 09/17/07). (0.5 points)

  3. A problem: Is the address used as a starting address above in the Hawk's RAM, ROM, input-output area, or unused area? (0.5 points)

  4. Background: You may find http://www.divms.uiowa.edu/help/msstart/ to be useful. If you work in room 301 MLH, you will have direct access to the computers. If you want to work over the Internet, see http://www.divms.uiowa.edu/help/msstart/remote.html for advice. From a Mac or a Linux, you will be able to use the lab machines directly using the ssh command from a terminal window. From a windows machine, you will want to use SecureCRT, available as a free download from http:https://helpdesk.its.uiowa.edu/software/signin.htm.

    To run a program through the SMAL assembler, you will have to edit the file .cshrc in your home directory on the lab machines. You can use any text editor on these machines. Change the file so it looks like this:

    # KEEP THESE TWO LINES FIRST !!
    source /etc/CSHRC
    
    # Add personal Customizations here.
    alias smal ~dwjones/smalstuff/smal32.intel -U ~dwjones/hawk
    alias link ~dwjones/hawk/link
    alias hawk ~dwjones/hawk/hawk.intel
    

    The last 3 lines above, starting with the word alias are the lines you will need to add. After doing this, log out and back in again in order to activate the smal, link and hawk commands.

    To print SMAL assembly listing files in room 301 MLH, lp -o landscape FILENAME seems to work well, substituting the appropriate file name. There are a myriad of ways to copy files from the lab machines to a remote machine, and an even greater myriad of ways to print them remotely. In general, try for printing in a fixed font in landscape format.

    A Problem: Login on a Division of Mathematical Sciences machine in room 301 or remotely at linux.cs.uiowa.edu, and then follow the directions above for activating the tools we will need in this course. Having done that, create a file called HW3.a containing the text of the meaningless example from the figure in Chapter 3 entitled Rewriting the example for improved readability. Make one change to this: Change the title from A meaningless example to your name.

    Assemble your file HW3.a using the smal HW3.a command. This will produce a listing file called HW3.l. HW3.l is an unformatted text file. Print it out legibly and turn in the printout. (1 point)

  5. Background: Edit the meaningless example you modified above. It contains two consecutive B directives. Add a third byte containing the ASCII value 'A' right after them.

    a) What alignment problems does this cause? (1/2 point)

    b) Insert the appropriate ALIGN directives to solve these alignment problems, assemble the result, and turn in the assembly listing as above. (1/2 point)