Created 10/05/02; edited 02/17/2008, 07/20/2015


Quiz on Memory Access

Instructions: For each question, choose the single best answer. Make your choice by clicking on its button. You can change your answers at any time. When the quiz is graded, the correct answers will appear in the box after each question.



1. What operation copies data from main memory into a general purpose register?

A.    load
B.    store
C.    move
D.    add

2. Which one of the following addresses is word aligned?

A.    0x01234567
B.    0x00FA0700
C.    0x77000003
D.    0x00000042

3. Say that four bytes in main storage contain bits that represent a 32-bit integer. What is the address is used for this integer?

A.    The address of the byte with the highest address of the four.
B.    The address of each byte is used.
C.    Only one byte at a time can be addressed.
D.    The address of the byte with the lowest address of the four.

4. Here is a 32-bit pattern: 0x00224477. This pattern is to be stored in main memory using bytes at addresses 0x10000000, 0x10000001, 0x10000002, and 0x10000003. On a big endian processor, what bit pattern is contained in address 0x10000000?

A.    0x00
B.    0x22
C.    0x44
D.    0x77

5. A lw is to load register $5 from location 0x0040000C in memory. Register $10 contains 0x00400000. Write the assembly language instruction:

A.    lw $10,0x0C($10)
B.    lw $10,0x0C($5)
C.    lw $5,0x0C($10)
D.    lw $5,0x0C(400000)

6. Register $10 contains 0x10000000. Beginning at that address there are five integers in a row. Write the instruction that loads the last integer into register $7.

A.    lw $7, 50($10)
B.    lw $7, 20($10)
C.    lw $7, 16($10)
D.    lw $7, 40($10)

7. Register $5 contains the address 0x10000100. Write the instruction that loads the four bytes that precede this address into register $7.

A.    lw $7, 4($5)
B.    lw $7, -4($5)
C.    lw $5, 4(-$5)
D.    lw $7, 0($5-4)

8. Write the assembly instruction that fills register $10 with 0x10000000

A.    lui $10, 0x1000
B.    lui $10, 0x10000000
C.    ori $10, $0, 0x10000000
D.    ori $10, $10, 0x1000

9. Say that somehow register $10 has been loaded with the address 0x10000000. Write the instruction that alters $10 so that it contains 0x100000F0.

A.    ori $10, $0, 0x00F0
B.    or $10, $10, 0x00F0
C.    ori $10, $10, 0x00F0
D.    andi $10, $10, 0x00F0

10. Examine the following program fragment.

## fragment.asm

        .text
        .... program statements ...
    
        .data
    
value:  .word 23
result: .word 97

Assuming that SPIM starts the data section at address 0x10000000, what address does symbolic address result represent?

A.    0x10000004
B.    0x10000000
C.    0x10000003
D.    0x00000097

11. Refer back to the previous fragment. We want register $8 to contain the address of the first byte in the data section. What instruction does this?

A.    lui $8,1000
B.    lui $8,$8,0x1000
C.    lui $8,0x10000000
D.    lui $8,0x1000

12. Refer back to the previous fragment. Assume that register $8 contains the address 0x10000000. What instruction stores the contents of register $4 into location result?

A.    sw $4,4($8)
B.    sw $4,0($8)
C.    sw $4,0x0($8)
D.    sw $4,$0x05($8)

   The number you got right:       Percent Correct:       Letter Grade:   


If you have returned here from another page, or have re-loaded this page, you will need to click again on each of your choices for the grading program to work correctly. You may want to press the SHIFT KEY while clicking to clear the old answers.

Click here