© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
S. SmithRISC-V Assembly Language ProgrammingMaker Innovations Serieshttps://doi.org/10.1007/979-8-8688-0137-2_2

2. Loading and Adding

Stephen Smith1  
(1)
Gibsons, BC, Canada
 

The goal of this chapter is to load various integer values into the CPU and perform basic addition and subtraction operations on these values. This sounds simple, but at the low level of Assembly Language, this can get complicated. In this chapter, we will go step-by-step through the various forms of the add, sub, and Shift instructions, to lay the groundwork on how all instructions work, especially in the way they handle parameters. This is so that in subsequent chapters, we can proceed ...

Get RISC-V Assembly Language Programming: Unlock the Power of the RISC-V Instruction Set now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.