Search code examples
assemblymipsmips32

How to put biggest 32bit integer into a register file


I need to put the biggest int to a register file which is(+2147483647) (0x7FFFFFFF)

.data

 input : .word 0x7FFFFFFF #+ infinity

 .text
  la $a0, input

  move $t0, $a0

the input label can hold this value however, I cant transfer it to $a0 and $a0 becomes 268500992.

lui $a0, 0x7FFF
ori $a0, 0xFFFF

can work but I need to take argument from .data segment. Can you guys offer me a solution.


Solution

  • move $t0, $a0 copies the value of $a0 into $t0. So what you're getting is the address of input, not the value at that address.

    What you want is to load a word (32 bits) from memory, i.e. lw $t0, ($a0).