From 7e8d8fcf4c0f91f554dce28e1540862894be2940 Mon Sep 17 00:00:00 2001 From: winsdominoes Date: Mon, 10 Jun 2024 11:58:46 +0700 Subject: [PATCH] riscv stuff --- risc-v/Makefile | 4 ++++ risc-v/a.out | 0 risc-v/hello | Bin 0 -> 1472 bytes risc-v/hello.o | Bin 0 -> 1264 bytes risc-v/hello.s | 16 ++++++++++++++++ 5 files changed, 20 insertions(+) create mode 100644 risc-v/Makefile create mode 100644 risc-v/a.out create mode 100755 risc-v/hello create mode 100644 risc-v/hello.o create mode 100644 risc-v/hello.s 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 0000000000000000000000000000000000000000..f175cbe7c365b59f07339f0950c50ec80c1c80bb GIT binary patch literal 1472 zcmbtUziSjh6n^(BIVD8`7K)9?6%uesj@%KuT)4d`$f=wnf-vl_Bn$hC-MM&Ls7)l; zC>&^Mqu7|jGG%HT|BSRE*81M=yxi@DwaJ5-@69*gd~OTT`c>U}9!_UXZKaM)1Pj7A<{OR5r*P&X|KjP0C@9&pdy#%%6 z`p;TRr|h=ldEvFkVeHu#JNJ=@-Nf31QV-Kwyw_fHo6)N9o6(9eDBEsEO<_}K5%KX#Euu5h9{!X4Wtt{kQsD44?AL0-@4Nm0>_(!fzbQi zG&hq(B+`f_@_CtK8`1#b1U7({JolwxBFZ?!UCx3~I@(S!)Xbsl**9GqH0g{aXlco6 zhLo{u4y8k7ea^Uw>*ukRl@He`-%q}Wyba$+9&4CTWy~pp>tR8a%Q6cU@;*$jVM1>Z zj~V&hD0+WbN88ML(%gaC|FuGTtLm!J{AKDeE?_%*+fb{>@2P6iDZ5i*sbKw)T2HUb Ibj+^*2Vm@;1^@s6 literal 0 HcmV?d00001 diff --git a/risc-v/hello.o b/risc-v/hello.o new file mode 100644 index 0000000000000000000000000000000000000000..bef5cf2f974aa25ad3668d1348ee7e27065ae9b5 GIT binary patch literal 1264 zcmb_b%}&BV5S~(s#dyGQ(8LP|;>k2njYk798jV~$>8%!8LX#rRc0uIg$tU38Yw!p@ z0*_+i3pms6rm$2G>NM@leDk}r)0d0RWkJ(Gk_MlUX%Yok6jHf}td)o@D1!-e6N*)% z0&fPu{MCSJX$djf=jPI=8mWBchvBGpH)5f;-M&F13*z1cv^I(co1C5mcGPr+cGPfO zlKOUJJ05*zK`&;6&w{@H*z?g5<>7D~Hls$;#ZMnS_ap#1K6#`Aoo=1dS!_<^EOFDI zzU~g!-{2jAn~FcFI^ggWx<$Q`*MEKbhlvg7CZ6abpzeXyY1F`pxyv}-WJ-I;R=bh- zv9L?FBZPhATM|Sran&EJ_<6|PE^^LNK9CagL)YT|l!N8D+y$!}$6zH(V!52NpgZP1 zE!96z4Rg?KmXusAp{rY^Zo~olW&c2y#1#L>gMcVM)sgd~IT0P=OSrm$5gBtx-Ml08 zp`5>sZ>F&u@~ literal 0 HcmV?d00001 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"