Front Matter....2
1. Getting Started....22
2. Loading and Adding....43
3. Tooling Up....61
4. Controlling Program Flow....80
5. Thanks for the Memories....98
6. Functions and the Stack....120
7. Linux Operating System Services....144
8. Programming GPIO Pins....159
9. Interacting with C and Python....182
10. Multiply and Divide....203
11. Floating-Point Operations....221
12. Optimizing Code....243
13. Reading and Understanding Code....252
14. Hacking Code....266
Back Matter....276
Gain the skills required to dive into the fundamentals of the RISC-V instruction set architecture. This book explains the basics of code optimization, as well as how to interoperate with C and Python code, thus providing the starting points for your own projects as you develop a working knowledge of assembly language for various RISC-V processors.
The RISC-V processor is the new open-source CPU that is quickly gaining popularity and this book serves as an introduction to assembly language programming for the processor in either 32- or 64-bit mode. You’ll see how to write assembly language programs for several single board computers, including the Starfive Visionfive 2 and the Espressif ESP32-C3 32-bit RISC-V microcontroller. The book also covers running RISC-V Linux with the QEMU emulator on and Intel/AMD based PC or laptop and all the tools required to do so.
Moving on, you’ll examine the basics of the RISC-V hardware architecture, all the groups of RISC-V assembly language instructions and understand how data is stored in the computer’s memory. In addition, you’ll learn how to interface to hardware such as GPIO ports. With RISC-V Assembly Language Programming you’ll develop enough background to use the official RISC-V reference documentation for your own projects.
Those who have already learned to program in a higher-level language like Python, Java, C# or even C and now wish to learn Assembly Language programming.