mv
Move
Copies the value of t2 into t1.
Used in
- The stack and spRISC-V assembly
- jal, ret and the calling conventionRISC-V assembly
- ecallRISC-V assembly
- Moving values aroundRISC-V assembly
- The bigger of two numbersRISC-V assembly
- The largest elementRISC-V assembly
- Length of a stringRISC-V assembly
- Reverse a string in placeRISC-V assembly
- Even or odd, count the set bits, multiply by shiftingRISC-V assembly
- A subroutine with its arguments in registersRISC-V assembly
Forms
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.
# mv copies a prepared value; t0=12 and t2 shows the result.
.text
li t0, 12
# t0=12; mv copies it, so t2 becomes 12.
mv t2, t0