TYPES

HOME

R-format

I-format

J-format

The different fields are:

op: operation of the instruction
rs, rt, rd: the source and destination register specifiers
shamt: shift amount
funct: selects the variant of the operation in the “op” field
address / immediate: address offset or immediate value
target address: target address of the jump instruction

Three instruction formats used

  • R type – for instructions with three operands specified in registers (e.g. add $3, $5, $6)

  • I type – for instructions where one operand is an immediate value (16 bits)

  • J type – for instructions where one operand is an address such as Jump instructions or memory instructions.


Here the

J-format: used for j and jal

I-format: used for instructions with immediates, lw and sw (since the offset counts as an immediate), and the branches (beq and bne), (but not the shift instructions)

R-format: used for all other instructions