1
0
Fork 0
experiments/machine/riscv-asm/main.s

19 lines
376 B
ArmAsm

.global _start
_start:
addi a7, x0, 64 # syscall write
addi a0, x0, 1 # stdout fd
la a1, str_helloworld # load label into reg: a1
addi a2, x0, 13 # length of string
ecall # call kernel
beqz x0, _exit # branch if = to zero
_exit:
addi a7, x0, 93 # syscall exit
addi a0, x0, 0 # exit code
ecall # call kernel
str_helloworld:
.ascii "Hello World!\n"