diff --git a/risc-v/Makefile b/risc-v/Makefile new file mode 100644 index 0000000..b0e47f4 --- /dev/null +++ b/risc-v/Makefile @@ -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 diff --git a/risc-v/a.out b/risc-v/a.out new file mode 100644 index 0000000..e69de29 diff --git a/risc-v/hello b/risc-v/hello new file mode 100755 index 0000000..f175cbe Binary files /dev/null and b/risc-v/hello differ diff --git a/risc-v/hello.o b/risc-v/hello.o new file mode 100644 index 0000000..bef5cf2 Binary files /dev/null and b/risc-v/hello.o differ diff --git a/risc-v/hello.s b/risc-v/hello.s new file mode 100644 index 0000000..b9212f0 --- /dev/null +++ b/risc-v/hello.s @@ -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"