MIPS β€” Practice

The CO2 half of the paper. Try each, then reveal. Verify your encodings with the Live Encoder.

M.1Draw the three MIPS instruction formats with field widths.
M.2Draw all five MIPS addressing modes with an example each.
M.3bigEncode: lw $s0,32($s1); add $s0,$s0,$s2; sw $s0,36($s1). (lw=100011, sw=101011, add funct=100000)
M.4bigTranslate to MIPS with bne, then to machine code: if (i!=j) h=i+j; else h=i-j; (h=$s2,i=$s3,j=$s4).
M.5Convert sub $s0,$s1,$s2 to machine code. (opcode 000000, funct 100000, as given.)
M.6Address of the last byte and last word in MIPS-32.
M.7Address of the last word in MIPS-64 (everything similar to MIPS-32).
M.8Max value of offset in lw $s1,offset($s2), and the machine instruction for it.
M.9beq $s0,$s1,Label with PC=200, $s0=$s1=8, offset=1. New PC?