Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Use the image to answer these questions. For ths problem, assume that $t1 hol

ID: 3680915 • Letter: 1

Question

1. Use the image to answer these questions. For ths problem, assume that $t1 holds the address 0x10010008.

Give the value in $t2 after each of the following.   Show your answer as 8 hexadecimal digits with a leading 0x.

lw $t2, 0($t1) ------------

lw $t2, 8($t1) ------------

lw $t2, -8($t1) ------------

2. Use the image to answer the following questions. Be sure to represent your answers as 8 hexadecimal digits with the leading 0x.

a. What is the address of the value 0xFFFFFFFF?

b. What is the address of the value 0x00000017

c. What value is at address 0x10000004?

d. What value is at address 0x10000014?

3. The data segment of a program starts at 0x10010000. Write the MIPS assembly lanugage code to do the following. Do not use pseudo-instructions.

a. put the address of the start of the data segment in $t0

b. read the word at the beginning of the data segment into $t1

c. add 1 to the value in $t1

d. write the value back into memory at the same location (where it was read).

00000017 000000cO FEFEFFFF 10000008 17000000 00000001 0x10010010 0x1001000C 0x10010008 0x10010004 0x10010000

Explanation / Answer

Given, $t1 holds the address 0x10010008.

lw $t2, 0($t1) ------------ Fetch the value from the address 0x10010008, into $t2. Therefore, after executing this instruction, $t2 will hold 0x10000008.

lw $t2, 8($t1) ------------ Fetch the value from the address 0x10010008 + 8, i.e., (from 0x10010010)into $t2. Therefore, after executing this instruction, $t2 will hold 0x000000C0.

lw $t2, -8($t1) ------------ Fetch the value from the address 0x10010008 - 8, i.e., (from 0x10010000)into $t2. Therefore, after executing this instruction, $t2 will hold 0x00000001.

2.

a. What is the address of the value 0xFFFFFFFF?  0x10010010

b. What is the address of the value 0x00000017?   0x1001001C

c. What value is at address 0x10000004? 0x00000001

d. What value is at address 0x10000014? 0x000000C0