Files
riscv-operating-system-mooc/code/asm/mv/test.s
2021-04-01 20:02:31 +08:00

21 lines
523 B
ArmAsm

# Move (Register to Register)
# Format:
# MV RD, RS
# Description:
# The contents of RS is copied into RD.
# MV is a pseudoinstruction, and is assembled identically to:
# ADDI RD, RS, 0
#
.text # Define beginning of text section
.global _start # Define entry _start
_start: # Label, not really required
li x6, 30 # x6 = 30
mv x5, x6 # x5 = x6
addi x5, x6, 0 # these two instructions assemble into the same thing!
stop:
j stop # Infinite loop to stop execution
.end # End of file