Chapter 2: 41 (page 172)
If the current value of the PC is 0x00000600, can you use a single jump instruction to get to the PC address as shown in Exercise 2.39?
Short Answer
No, since the range is 0xFFFFE604 ~ 0X00020600
Chapter 2: 41 (page 172)
If the current value of the PC is 0x00000600, can you use a single jump instruction to get to the PC address as shown in Exercise 2.39?
No, since the range is 0xFFFFE604 ~ 0X00020600
All the tools & learning materials you need for study success - in one app.
Get started for freeQuestion: [5] Consider the following MIPS loop:
LOOP: slt \(t2, \)0, \(t1
beq \)t2, \(0, DONE
subi \)t1, \(t1, 1
addi \)s2, \(s2, 2
j LOOP
DONE:
2.26.1 [5] <§2.7> Assume that the register \)t1 is initialized to the value 10. What is the value in register \(s2 assuming \)s2 is initially zero?
2.26.2 [5] <§2.7> For each of the loops above, write the equivalent C code routine. Assume that the registers \(s1, \)s2, \(t1, and \)t2 are integers A, B, i, and temp, respectively.
2.26.3 [5] <§2.7> For the loops written in MIPS assembly above, assume that the register $t1 is initialized to the value N. How many MIPS instructions are executed?
The following instruction is not included in the MIPS instruction set:
rpt $t2, loop # if(R[rs]>0) R[rs]=R[rs]−1, PC=PC+4+BranchAddr
2.25.1 [5] <§2.7> If this instruction were to be implemented in the MIPS
instruction set, what is the most appropriate instruction format?
2.25.2 [5] <§2.7> What is the shortest sequence of MIPS instructions that
performs the same operation?
For the MIPS assembly instructions in Exercise 2.4, rewrite the assembly code to minimize the number if MIPS instructions (if possible) needed to carry out the same function.
Rewrite the loop from Exercise 2.29 to reduce the number of MIPS instructions executed
Question: For the following C statement, what is the corresponding MIPS assembly code? 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.
What do you think about this solution?
We value your feedback to improve our textbook solutions.