next up previous
Next: About this document ... Up: CS2813 Homework 3 Previous: Memory

MIPS machine code

  1. Play assembler. Show the machine code for
    lw $2, 20($3)
    add $6,$3, $0
    lw $3, 24($3)
    sub $4,$3,$2
    addi $4,$4,20
    sll $5,$3,2
    nor $5,$5,$0
    sw $4, 20($6)
    sw $5, 24($6)
    

    Show your result both the ``decimal'' format (eg middle of page 65) and also as hexadecimal numbers.

  2. Play CPU and trace the execution of the program above. After each instruction, explain which register(s) or memory location(s) change, and what their new values are.

    Suppose that register 3 initially contains 1234 (base 10), and that memory addresses 1250-1256 store 22 (base 10) and 1257-1300 store 44 (base 10).



Owen Kaser 2007-10-22