commit 7bf0e225a37b6794fcd83b7a5f6d0d33032254c6 Author: Andrew Ekstedt Date: Sun Apr 16 10:38:46 2023 -0700 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8a243a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/true +/false diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eea76d5 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +TARGET ?= riscv64-linux-gnu +AS = $(TARGET)-as +LD = $(TARGET)-ld + +.SUFFIXES: + +all: true false +#all: cat echo + +%: %.o + $(LD) -o $@ $< + +%.o: %.s + $(AS) -o $@ $< diff --git a/false.s b/false.s new file mode 100644 index 0000000..b42bfdb --- /dev/null +++ b/false.s @@ -0,0 +1,10 @@ +.globl _start +.option rvc # enable compressed instructions + +.text + +_start: + li a7, 93 # sys_exit + li a0, 1 + ecall + diff --git a/true.s b/true.s new file mode 100644 index 0000000..98bf23e --- /dev/null +++ b/true.s @@ -0,0 +1,10 @@ +.globl _start +.option rvc # enable compressed instructions + +.text + +_start: + li a7, 93 # sys_exit + li a0, 0 + ecall +