Assignment 3, due Sept 10

Part of the homework for 22C:60, Fall 2004
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, and unless there is what insurance companies call "an act of God" - something outside your control; the only exceptions to this rule will be by advance arrangement.

  1. Here is a bit of SMAL assembly code, intended to place data in the Hawk memory:
    		TITLE	"Exercise 1"
    
    	.	=	#10000
    	TEN	=	10
    		B	TEN
    		H	TEN + 1
    	ADDR:	W	-TEN
    		W	ADDR
    		END
    

    a) Assemble this code fragment, by hand, that is, not using the SMAL assembler, and show what values it puts in each byte of memory. Show your answer as a sequence of byte-address -- value pairs, showing all addresses and values in hexadecimal:

    	byte: value
    	byte: value
    	byte: value
    

    b) The above bit of assembly code fails to meet the alignment constraints of the Hawk machine. Rewrite this code with ALIGN directives in the right place. This will require including the line USE "hawk.macs" in your code because the ALIGN directive is not predefined.

  2. Do, from Chapter 4, exercises e) and g).