lui

Operands

$reg, [imm / HI(id)]

Variants

  • Load upper immediate : Places the 16-bit immediate into the upper 16 bits of $t1 and clears the lower 16 bits to 0. Used to build a full 32-bit constant: first 'lui $t1,upper16' then 'ori $t1,$t1,lower16'. Example: to load 0x12345678 use 'lui $t1,0x1234' then 'ori $t1,$t1,0x5678'. lui $t1,100
  • Load Upper Address : Set $t1 to the upper 16 bits of label's address, adjusted so that a following %lo lands on the label. Pairs with an instruction taking %lo(label)($t1) lui $t1,%hi(label)

Load upper immediate : Places the 16-bit immediate into the upper 16 bits of $t1 and clears the lower 16 bits to 0. Used to build a full 32-bit constant: first 'lui $t1,upper16' then 'ori $t1,$t1,lower16'. Example: to load 0x12345678 use 'lui $t1,0x1234' then 'ori $t1,$t1,0x5678'.

Loading...