© 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_10

10. Multiply and Divide

Stephen Smith1  
(1)
Gibsons, BC, Canada
 

In this chapter, we return to using mathematics. Addition, subtraction, and a collection of bit operations on the CPU registers have already been covered, so now, instructions for multiplication and division will be given in this chapter.

These instructions are part of the RISC-V M extension that adds integer multiplication and division to the standard base integer instructions studied so far. This means that not all RISC-V CPUs contain these instructions. If missing, they can be simulated ...

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.