CSE378 Autumn 2003
Miniquiz #3 Solutions
Translate each word of MIPS machine code (given in hex) into an equivalent
assembly-language instruction. Use symbolic names when possible and
appropriate. 4 pts. each.
3424000c
ori $4, $1, 12
or
ori $a0, $at, 12
0810001c
j 0x00400070
or
j 4194416
The opcode is 000010, which is j. The address is formed by
taking the other 26 bits: 0x10001c, and shifting them left by 2 (same as
multiplying by 4), which you need to do to get the address word-aligned:
0x10001c << 2 = 0x00400070. The shifting by 2 part can be done
quickly by writing out 10001c in binary, then adding two 0 bits at the end
(that's what left shift does), then converting the number back
to hex.
0000000
sll $0, $0, 0 which is equivalent to nop