c.sb
Store unsigned byte, 16-bit encoding
This instruction is defined by:
-
anyOf:
-
Zcb, version >= 0
-
Zce, version >= 0
-
This instruction is included in the following profiles:
Synopsis
Stores a 8-bit value from register rs2 into memory.
It computes an effective address by adding the zero-extended offset, to the base address in register rs1.
It expands to sb rs2, offset(rs1)
.
Decode Variables
Bits<2> imm = {$encoding[5], $encoding[6]};
Bits<3> rs2 = $encoding[4:2];
Bits<3> rs1 = $encoding[9:7];
Execution
-
IDL
if (implemented?(ExtensionName::C) && (CSR[misa].C == 1'b0)) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
XReg virtual_address = X[rs1 + 8] + imm;
write_memory<8>(virtual_address, X[rs2 + 8][7:0], $encoding);