Wite a MIPS code that returns the right-justified version of the given value. Right justification is (in this case) the process of removing all zeros from the right side of the value For example 2976 (hex 0xBA0), in binary, is 0b101110100000 Given 2976 as it's argument, function should return 0b1011101 which is 93 (hex 0x5D) For example 983040 (hex 0xF0000), in binary, is 0b11110000000000000000 Given 983040 as it's argument, should return 0b1111 which is 15 (hex 0xF) Your program can assume that all integers will fit in a MIPS register. You may define and call your own functions if you wish. Your solution must be in MIPS only. Your solution must not be in C, C++, Python, or any other language. No error checking is necessary or required.
Wite a MIPS code that returns the right-justified version of the given value. Right justification is (in this case) the process of removing all zeros from the right side of the value For example 2976 (hex 0xBA0), in binary, is 0b101110100000 Given 2976 as it's argument, function should return 0b1011101 which is 93 (hex 0x5D) For example 983040 (hex 0xF0000), in binary, is 0b11110000000000000000 Given 983040 as it's argument, should return 0b1111 which is 15 (hex 0xF)
Your program can assume that all integers will fit in a MIPS register. You may define and call your own functions if you wish. Your solution must be in MIPS only. Your solution must not be in C, C++, Python, or any other language. No error checking is necessary or required.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images