mirror of
https://github.com/plctlab/riscv-operating-system-mooc.git
synced 2025-11-16 12:34:47 +00:00
20 lines
429 B
ArmAsm
20 lines
429 B
ArmAsm
# Add
|
|
# Format:
|
|
# ADD RD, RS1, RS2
|
|
# Description:
|
|
# The contents of RS1 is added to the contents of RS2 and the result is
|
|
# placed in RD.
|
|
|
|
.text # Define beginning of text section
|
|
.global _start # Define entry _start
|
|
|
|
_start: # Label, not really required
|
|
li x6, 1 # x6 = 1
|
|
li x7, 2 # x7 = 2
|
|
add x5, x6, x7 # x5 = x6 + x7
|
|
|
|
stop:
|
|
j stop # Infinite loop to stop execution
|
|
|
|
.end # End of file
|