Here, we summarize the RV32I instructions of the RISC-V ISA and OS calls that are most important for this book. The official RISC-V reference [17] provides further details on the RV32I instruction set.
| Mnem | Args | Semantics | Comment |
|
|
Add two registers | ||
|
|
Add register with immediate | ||
|
|
Subtract two registers | ||
|
|
Multiply two registers | ||
|
|
Divide two registers | ||
|
|
Remainder of division | ||
|
|
| Mnem | Args | Semantics | Comment |
|
|
Bitwise and | ||
|
|
Bitwise and with immediate | ||
|
|
Bitwise or | ||
|
|
Bitwise or with immediate | ||
|
|
Bitwise xor | ||
|
|
Bitwise xor with immediate | ||
|
|
Bitwise complement | ||
|
|
Shift left by | ||
|
|
Shift left by | ||
|
|
Unsigned shift right by | ||
|
|
Unsigned shift right by | ||
|
|
Signed shift right by | ||
|
|
Signed shift right by |
| Mnem | Args | Semantics | Comment |
|
|
Load immediate / constant | ||
|
|
Load upper immediate | ||
|
|
Add upper immediate to pc | ||
|
|
Load address of symbol | ||
|
|
Load word | ||
|
|
Load half word with sign extension | ||
|
|
Load half word with zero extension | ||
|
|
Load byte with sign extension | ||
|
|
Load byte with zero extension | ||
|
|
Store word | ||
|
|
Store half word | ||
|
|
Store byte |
| Mnem | Args | Semantics | Comment |
|
|
Set less than | ||
|
|
Set less than immediate | ||
|
|
Set less than unsigned | ||
|
|
Set less than immediate unsigned |
| Mnem | Args | Semantics | Comment |
|
|
Branch if equal | ||
|
|
Branch if not equal | ||
|
|
Branch if less (signed) | ||
|
|
Branch if less (unsigned) | ||
|
|
Branch if greater or equal (signed) | ||
|
|
Branch if greater or equal (unsigned) | ||
|
|
Branch if greater (signed) | ||
|
|
Branch if greater (unsigned) | ||
|
|
Branch if less or equal (signed) | ||
|
|
Branch if less or equal (unsigned) | ||
|
|
Branch if equal to zero | ||
|
|
Branch if not equal to zero | ||
|
|
Branch if less than zero | ||
|
|
Branch if greater or equal to zero | ||
|
|
Branch if greater than zero | ||
|
|
Branch if less or equal to zero |
| Mnem | Args | Semantics | Comment |
|
|
Jump and link | ||
|
|
Jump and link indirect | ||
|
|
Unconditional jump | ||
|
|
Indirect jump | ||
|
|
Call subroutine | ||
|
|
Return from subroutine |
| Mnem | Args | Semantics | Comment |
|
|
Invoke operating system | ||
|
|
No operation / no-op | ||
|
|
Copy register |