Write MIPS assembly code that stores the 32constant value 0

Write MIPS assembly code that stores the 32-constant value
( 0010 0000 0000 0001 0100 1001 0010 0100 )2 to register $9.

Solution

Ans) The Hexadecimal equivalent fro the given 32-bit contant is

(0010 0000 0000 0001 0100 1001 0010 0100 )2

   2 0 0 1 4 9 2 4 = (20014924)16--Hexadecimal Equivalent

Break the above 32 bit constant in to 2 6-bit values and perform the following code

---------------------

-------------------------------

Explanation

MIPS instruction called lui which stands for \"load upper immediate\" .It loads the upper 16 bits of Register with the 16 bit immediate, and the lower 16 bits with all 0\'s

ori performs bit wise OR operation

After 1 st instruction upper 16 bit of constant is loaded to the register ,for the second instruction lower 16 bits will be added to that

Write MIPS assembly code that stores the 32-constant value ( 0010 0000 0000 0001 0100 1001 0010 0100 )2 to register $9.SolutionAns) The Hexadecimal equivalent f

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site