The S-type (store) instruction operates on two registers and one immediate operand. There are two immediate fields that together form a 12-bit signed immediate value. Figure 1 illustrates the instruction format for an S-type instruction, showing how the register, opcode, and immediate fields are segregated.

Figure 1: Instruction Format

Figure 1: Instruction Format

  • Opcode: The opcode or operation code is a 7-bit field that defines the type of operation to be performed.
  • Function Field: This 3-bit funct3 field, known as the control bits, determines the specific operation to be executed such as store byte (sb), store half (sh) and store word (sw).
  • Registers: The register rs1 is the base address of source register and rs2 is the value to be stored to memory.
  • Immeditate Field: The two immediate fields together make up 12-bit signed offset number for the base address in rs1.

Below is table that describes the list of S-type instructions.

funct3opcodeDescriptionInstruction
0000100011 (35)store bytesb rs2, imm(rs1)
0010100011 (35)store halfsh rs2, imm(rs1)
0100100011 (35)store wordsw rs2, imm(rs1)