I am currently working a program that runs the Collatz Conjecture.
I am confused how to represent 2^32 - 1
or 0xFFFFFFFF
into a single register. I am currently using
#lui $s5, 0xFFFF # 2^32 - 1 stored in $s5
#ori $s5, $s5, 0xFFFF # storing 0xFFFFFFF in $s5
li $s5, 0xFFFFFFFF # pseudo instruction of above
addu $s6, $0, $s5
To get the unsigned value of 0xFFFFFFFF
into register $s6
. When I run the program through gdb debugger I am getting the 2's complement of 0xFFFFFFFF
-1
in register $s6
and not the true unsigned value of 0xFFFFFFFF
. I am confused on how to represent the unsigned value of 0xFFFFFFFF
into the $s6
register. I am running my code on a ci20 machine not a simulator. Any help or suggestion would be greatly appreciated.