Homework 2

22C:18, Spring 1996

Due Tuesday Jan. 30, 1996, in discussion

Douglas W. Jones

  1. Convert the following string to ASCII, and show how it would be stored in consecutive words of memory by an M68000 system, starting at address $1000. Your answer should show the contents of each word of memory in hexadecimal.
    	This is the string!
    

  2. Suppose you had an M68000 based system where bit 29 of the program counter was broken, so that, no matter what value you tried to store in the program counter, that bit would always report the value zero. Despite this failure, you find that, when you turn on your system, it still starts up correctly and runs for a brief while without problems. From this, you can conclude something about where the startup (or bootstrap) code is stored in memory. State your conclusions!

  3. The DEC PDP-8 was the first computer ever sold on a retail cash and carry basis (this happened in 1968; the architecture was introduced in 1965). This machine had word addressing, a 12 bit word, and an 15 bit memory address. The character set used for textual I/O on this machine was 8 bit ASCII.

    Part A: What is the maximum memory you can attach to this machine, in words?

    Part B: How many characters of text could you store in the memory of this machine? (for this part, ignore the problem of where the program would have to be stored if you actually filled the memory with text.)

    Part C: Propose a format for the efficient storage of consecutive bytes of ASCII data in memory on this machine.

    Part D: If a program uses a word as an array index, what is the maximum size of the array that program could directly address?

  4. On an M68000, data register D3 contains the value $01234567. Give the hex value for each of the following:

    Part A: (D3.W)
    Part B: (D3.B)
    Part C: MSW of D3
    Part D: LSB of D3

  5. Translate the following M68000 instructions to machine code, giving the result as a string of consecutive byte values in hex:

    Part A: ADDI #40,$002FFF
    Part B: MOVE $0004FF,D0
    Part C: SUBI.W #5,D2
    Part D: MOVE D0,$000001