Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ADD — add registers

add rd, rs1, rs2

Computes rd = rs1 + rs2. Available in RV32I and RV64I. Overflow wraps modulo XLEN; it does not trap and no carry/overflow flags are produced.

add a0, a1, a2        # a0 = a1 + a2

x86 connection: closest to lea dst, [src1 + src2] when you need flag-neutral addition. Unlike two-operand x86 add, neither source must be overwritten.

Related: ADDI, SUB.