ori $0,$9,0x32
Incorrect. It says to put the result into register $0 (which is always zero and can't be loaded with anything else).
The assembler part of the SPIM simulator does not write an error message for the above mistaken instruction. But the instruction does not change register zero when executed.
Here is a tiny program that bitwise ORs two patterns. First one pattern is loaded into register $8, then the register is ORed with an immediate operand. The result goes into register $10.
## Program to bitwise OR two patterns .text .globl main main: ori $8,$0,0x0FA5 # put first pattern into register $8 ori $10,$8,0x368F # or ($8) with second pattern. Result to $10. ## End of file
Soon we will assemble and run the program. You can do this now, if you want (remember you can use copy-and-paste from this page to your text editor). First, let us predict the result.