riscv stuff

This commit is contained in:
Win 2024-06-10 11:58:46 +07:00
parent c092b3437e
commit 7e8d8fcf4c
5 changed files with 20 additions and 0 deletions

4
risc-v/Makefile Normal file
View File

@ -0,0 +1,4 @@
default:
rm -rf hello
riscv64-linux-gnu-as hello.s -o hello.o
riscv64-linux-gnu-gcc -o hello hello.s -nostdlib -static

0
risc-v/a.out Normal file
View File

BIN
risc-v/hello Executable file

Binary file not shown.

BIN
risc-v/hello.o Normal file

Binary file not shown.

16
risc-v/hello.s Normal file
View File

@ -0,0 +1,16 @@
.global _start
_start:
# STDOUT FD = 1
addi a7, zero, 64
addi a0, zero, 1
la a1, helloworld
addi a2, zero, 13
ecall
addi a7, zero, 93
addi a0, zero, 13
ecall
helloworld:
.ascii "Hello World\n"