Chapter 2: 25 (page 169)
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?
Short Answer
2.25.1
The most appropriate instruction format will be “I type” for implementing the given MIPS instruction set.
2.25.2
The MIPS instructions sequence that performs as same as the given MIPS instructions sequence:
LOOP : slt $t3, $0, $t2
beq $t3, $0, Exit
sub $t2, $t2, 1
EXIT: