Write MIPS code for the following C statement using a LUIORI
Write MIPS code for the following C statement using a LUI/ORI combination: $t1 = 400000;
Solution
lui loads upper 16-bit in given register and make other lower 16- bits as 0. So,
lui $t1, 0x0040 #it will store upper 2 bytes as 0040 and lower 2 bytes as 0000
Since, we need 0000 in lower 2 bytes. Therefore, there is no need of ORI instruction.
Hope it helps, do give your response.
