Pseudo InstructionsMIPS also provides several instructions that make it easier to program in assembly, but which are not directly translated into a machine code instruction. These are known as pseudo instructions. A pseudo instruction can be used in an assembly language program and is recognized by the assembler. When used, the assembler will convert the pseudo instruction to one or more real machine code instructions. For example, MIPS provides a move instruction move $t3, $t2 which takes two registers and copies the contents of the second register to the first register. This is a pseudo instruction that is actually implemented using the add instruction addi $t3, $t2, 0 By including the pseudo instructions, programmers can use instructions that are more familiar to them for common operations without having to remember how to implement those operations. Question 1.
The load immediate instruction is actually a pseudo instruction that is provided for convenience. How can the li $t2, 58 how would it be implemented using real MIPS instructions? The addi $t2, $zero, 58 Question 2.
The MIPS neg $t0, $t1 it negates the value in register $t1 and stores it into register $t0. That is, it performs $t0 = -$t1
How would this pseudo instruction be implemented using real MIPS instructions? The sub $t0, $zero, $t1
|