1. MIPS is a load/store architecture. What does this mean?
2. MIPS requires that most data to be aligned. What does this mean?
3. What are the restrictions on label names in MIPS?
4. What does this assembler directive accomplish?
stuff: .byte 'a','b','c','d','e','g'
5. What do these assembler directives accomplish?
stuff: .space 15
stuff2: .word 0:10
6. Since MIPS instructions are all one word (4 bytes), it is easy to compute
the address of the next instruction even if the instructions vary by number
of operands. Give the addresses of the next two instructions after addi.
Address Instruction
0x00400024 addi $t2, $t3, 5
__________ la $a0, mystuff
__________ b target
7. It is easy to encode MIPS instructions since there are so few instruction
types (I, R and J). The encoding format for this type
I instruction with opcode 8
Addi is opcode 8, rt is register target, rs is
register source, and imm is the immediate value.
What is the binary encoding of this addi instruction?
(The opcode for addi is 8. See quick guide for register numbers. )
8. Pseudoinstructions are macros added to MIPS to make life
easier for the programmer. The assembler translates pseudos
into actual instructions; e.g., this pseudo:
move $t1, $s3 # $t1 = $s3
is really, under the covers, an add operation. Provide the
equivalent MIPS add. Why provide a macro for a single instruction?
9. Most pseudoinstructions are macros for multiple MIPS instructions. For
example, the bgt pseudo is really three instructions: beq, slt and bne.
Explain the meaning of the bgt below and translate it into its
equivalent three MIPS instructions beq, slt and bne.
bgt $t0, $s2, Label
10. Using Appen A-10 or the quick guide as a reference, write a brief comment
for each line of MIPS code below. Then explain what the code is doing.
Assume that $s2 holds the starting address of an array of five integers
1,2,3,4,5.