Risc-V-Asm/hello.s

17 lines
484 B
ArmAsm
Raw Normal View History

2024-04-01 11:09:45 +02:00
.section .text
.globl _hello
_hello:
# Write the string "Hello, World!\n" to stdout
la a0, msg # Load the address of the string into a0
li a7, 4 # syscall number for write
li a1, 13 # Length of the string
li a2, 1 # File descriptor: stdout
ecall # Make the system call to write
ret # Return from the function
.section .data
msg:
.ascii "Hello, World!\n"