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.

 Write MIPS code for the following C statement using a LUI/ORI combination: $t1 = 400000;Solutionlui loads upper 16-bit in given register and make other lower 1

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site