Chapter 2: Q14E (page 167)
Question: Provide the type and assembly language instruction for the following binary value:
Short Answer
R-type, add $s0, $s0, $s0
Chapter 2: Q14E (page 167)
Question: Provide the type and assembly language instruction for the following binary value:
R-type, add $s0, $s0, $s0
All the tools & learning materials you need for study success - in one app.
Get started for freeAssume \(t0 holds the value 0x00101000. What is the value of \)t2 after the following instructions?
slt \(t2, \)0, \(t0
bne \)t2, \(0, ELSE
j DONE
ELSE: addi \)t2,$t2, 2
DONE:
lbu \(t0, 0(\)t1)
sw \(t0, 0(t2)
Assume that the register \)t1 contains the address and the register \(t2 contains the address
. Note the MIPS architecture utilizes big-endian addressing. Assume that the data (in hexadecimal) at the address
is
. What value is stored at the address pointed to by register \)t2?
Question: For each function call, show the contents of the stack after the function call is made. Assume the stack pointer is originally at address 0x7ff ff ff c, and follow the register conventions as specified in Figure 2.11.
Question 2.4 [5] For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are assigned to registers \(s0, \)s1, \(s2, \)s3, and \(s4, respectively. Assume that the base address of the arrays A and B are in registers \)s6 and \(s7, respectively.
sll \)t0, \(s0, 2 # \)t0 = f * 4
add \(t0, \)s6, \(t0 # \)t0 = &A[f]
sll \(t1, \)s1, 2 # \(t1 = g * 4
add \)t1, \(s7, \)t1 # \(t1 = &B[g]
lw \)s0, 0(\(t0) # f = A[f]
addi \)t2, \(t0, 4
lw \)t0, 0(\(t2)
add \)t0, \(t0, \)s0
sw \(t0, 0(\)t1)
Question: Provide the type, assembly language instruction, and binary representation of instruction described by the following MIPS fields: op=0, rs=3, rt=2, rd=3, shamt=0, funct=34
What do you think about this solution?
We value your feedback to improve our textbook solutions.