Add function to set a register to an arbitrary 32-bit value
Unfortunately, while "sethi" can be approximated with a 16-bit imediate load and a shift by immediate, there's no way to then OR the destination register with a 16-bit immediate. This means if we want to set a register without using any temporary registers, we need to load the 16-bit immediate, shift the destination left by 4, add the next nybble to the destination, and then repeat that shift-by-4-and-add-nybble sequence another three times to finish the 32-bit load.
Loading
Please register or sign in to comment