This guide provides a thorough introduction to programming in 32-bit RISC-V assembly language, focusing on the RV32I base integer instruction set. It starts with content from this cheat sheet and expands it into a complete, structured reference. The guide is organized for easy navigation, with clear sections, tables for listings, explanations, examples, and notes. It draws from official specifications and tutorials to ensure accuracy and completeness. Beginners can follow sequentially, while experienced users can reference specific sections.
Key assumptions:
- We use the GNU Assembler (GAS) syntax, common for RISC-V tools.
- Examples assume a bare-metal or simple simulator environment (e.g., RARS, Spike, or QEMU).
- RV32I is the base; extensions like M (multiply/divide) are noted but not required unless specified.
- Code snippets are testable in simulators; error handling and overflows are ign