summaryrefslogtreecommitdiff
path: root/assembly/fizzbuzz/Makefile
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-11-06 14:38:59 -0600
committercheapie <cheapiephp@gmail.com>2026-11-06 14:38:59 -0600
commit155623f85f728b0a5042063b4d43c0255e4748fa (patch)
treeff9d41118e2819bba15fcd694750d4a69447665c /assembly/fizzbuzz/Makefile
parentf1fe00423df3fda0ace4222d9d5e3d1976db3964 (diff)
downloadrvcontroller-155623f85f728b0a5042063b4d43c0255e4748fa.tar
rvcontroller-155623f85f728b0a5042063b4d43c0255e4748fa.tar.gz
rvcontroller-155623f85f728b0a5042063b4d43c0255e4748fa.tar.bz2
rvcontroller-155623f85f728b0a5042063b4d43c0255e4748fa.tar.xz
rvcontroller-155623f85f728b0a5042063b4d43c0255e4748fa.zip
Add fizzbuzz sample
Diffstat (limited to 'assembly/fizzbuzz/Makefile')
-rw-r--r--assembly/fizzbuzz/Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/assembly/fizzbuzz/Makefile b/assembly/fizzbuzz/Makefile
new file mode 100644
index 0000000..56c96d6
--- /dev/null
+++ b/assembly/fizzbuzz/Makefile
@@ -0,0 +1,24 @@
+MARCH ?= rv32imacbzicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt
+
+.PHONY: all dump load clean
+
+all: fizzbuzz.hex
+
+fizzbuzz.o: fizzbuzz.S
+ riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o fizzbuzz.o fizzbuzz.S
+
+fizzbuzz.elf: fizzbuzz.o
+ riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o fizzbuzz.elf fizzbuzz.o
+
+dump: fizzbuzz.elf
+ riscv32-none-elf-objdump -d fizzbuzz.elf
+
+fizzbuzz.hex: fizzbuzz.elf
+ riscv32-none-elf-objcopy -O ihex fizzbuzz.elf fizzbuzz.hex
+
+load: fizzbuzz.hex
+ bash -c "wl-copy < fizzbuzz.hex"
+
+clean:
+ rm -f fizzbuzz.hex fizzbuzz.elf fizzbuzz.o
+