So, according to a few sources I've looked at, it's not possible to use a 32-bit immediate in 32-bit mips, because machine instructions are 32-bit and immediate values are stored within the machine instructions. As far as I know, the largest an immediate can be is 16-bits, to leave room for the rest of the instruction. But in MARS 4.5 mips, this instruction works fine (using default settings):
.text
ori $t1, $0, 0xffffffff #load 32-bit pattern into $t1
This assembles and runs fine, which baffles me as I think it shouldn't for aforementioned reasons (how can 32-bit machine code hold a 32-bit immediate?). My best guess is ori in MARS actually runs a pseudo-instruction when the immediate field is above 0xffff that lui's and ori's to load regularly, but I'm not sure. Can someone shed some light on this?
addi
sign extend the immediate, soaddi $t1, $0, 0xffffffff
does work. Incidentally, that's an instruction the assembler could have used instead ofori
here. – Jester