mul
Multiply
Multiplies t2 by t3 and stores the low register-width bits of the product in t1.
Used in
- Arithmetic, logic and bitsRISC-V assembly
- Arrays and stringsRISC-V assembly
- jal, ret and the calling conventionRISC-V assembly
- ecallRISC-V assembly
- The bitmap display and the keyboard registersRISC-V assembly
- Multiply and divide, with the remainderRISC-V assembly
- Stack arguments and a stack frameRISC-V assembly
- Recursion: factorial and FibonacciRISC-V assembly
- A jump tableRISC-V assembly
- A 2D arrayRISC-V assembly
Forms
mul , ,
Operands
t1- Any integer register,
x0tox31, or its named alias, such aszero,t0ort6. t2- An integer register. It may be the same register as
t1. t3- An integer register. It may be the same register as
t1.
.text
li t0, 13
li t1, 5
# t0=13, t1=5; mul writes 65 to t2.
mul t2, t0, t1