rem
Remainder
Sets t1 to the remainder of t2 divided by t3, as signed integers.
Used in
- Arithmetic, logic and bitsRISC-V assembly
- Multiply and divide, with the remainderRISC-V assembly
- A subroutine with its arguments in registersRISC-V assembly
- A jump tableRISC-V assembly
- Print a nonnegative number in bases 2–36RISC-V assembly
- A bouncing ballRISC-V assembly
- Arithmetic, logic and bitsAssembly basics
Forms
rem , ,
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, 18
li t1, 5
# t0=18, t1=5; rem writes 3 to t2.
rem t2, t0, t1