Question: 1. Converting pseudo-instructions MIPS assembly language provides opcode mnemonics for instructions that are not part of the instruction set architecture. These pseudo-instructions can be generated
| 1. Converting pseudo-instructions |
MIPS assembly language provides opcode mnemonics for instructions that are not part of the instruction set architecture. These pseudo-instructions can be generated using a sequence of one or more true MIPS instructions. Find a true-instruction equivalent for each of the following pseudo-instructions (some are official MIPS pseudo-instructions, others are made up). For each pseudoinstruction, its meaning is explained below it. Each of these can be implemented using only one real MIPS instruction.
For entering answers, each instruction is broken up into four fields; enter the value of each of the missing fields.
a. isNeg $9, $8
Set $9 to 1 if $8 is a negative value, 0 otherwise. Assume that the value in register $8 is treated as a signed 32-bit number in twos-complement notation. HINT: Use a logical operation, not a division or multiplication or comparison operation.
Real MIPS instruction: __________ $9, __________, __________
b. not $8
Reg[8] ~Reg[8] Put the bitwise complement of $8 into $8 (i.e., flip each bit of $8)
__________ __________, $0, __________
c. neg $8, $9 Reg[8] -Reg[9] Put the negative of (i.e., 2s complement of) $9 into $8 Real MIPS instruction: __________ __________, __________, __________
d. decr $8 Reg[8] Reg[8] - 1 Decrement $8 by 1. Real MIPS instruction: __________ __________, __________, __________
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
