go to previous page   go to home page   go to next page hear noise

Answer:

No. Because the 16-bit pattern is zero-extended to 32 bits, the resulting pattern is never a two's-complement negative integer.


General OR Immediate Instruction

Here is a description of the ori instruction used as a bitwise OR instruction:

ori  d,s,const     # register d <-- bitwise OR of const
                   #                with the contents of register $s
                   #                const is 16-bits, so
                   #                0x0000 ... const ... 0xFFFF

The parts of the instruction must appear in the correct order, and const must be within the specified range. If the immediate operand in the assembly language shows less than 16 bits (as does 0x2 in the previous example) then the assembler expands it to the required sixteen bits. If the assembly language specifies more than sixteen bits, then the assembler writes an error message.

The const part of the assembly language instruction can be a positive decimal or a hexadecimal constant. The assembler translates the constant into a 16-bit pattern in the machine instruction. For example, the following two assembly language instructions translate into the same machine language instruction:

ori  $5,$4,0x10
ori  $5,$4,16

QUESTION 5:

Is the following instruction correct?

ori  $0,$9,0x32