Risc-V-Asm/main.s

13 lines
419 B
ArmAsm
Raw Normal View History

2024-04-01 11:09:45 +02:00
.section .text
.globl _start
_start:
# Call the hello function
lui a0, %hi(_hello) # Load upper immediate of _hello address
addi a0, a0, %lo(_hello) # Add lower immediate of _hello address
jalr ra, a0, 0 # Jump and link to _hello, ra is return address
# Exit the program
li a7, 10 # syscall number for exit
ecall # Make the system call to exit