From 85b5fde272be6ab543aa866baebabddc24566bdb Mon Sep 17 00:00:00 2001 From: cheapie Date: Sat, 23 May 2026 20:14:34 -0500 Subject: Add initial content --- c/bfhello/Makefile | 20 ++++++++++ c/bfhello/bfhello.b | 1 + c/bfhello/bfhello.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++ c/bfhello/bfhello.elf | Bin 0 -> 6508 bytes c/bfhello/bfhello.hex | 27 ++++++++++++++ c/bfhello/bfhello.o | Bin 0 -> 1856 bytes c/bfhello/rvcontroller.ld | 45 +++++++++++++++++++++++ 7 files changed, 184 insertions(+) create mode 100644 c/bfhello/Makefile create mode 100644 c/bfhello/bfhello.b create mode 100644 c/bfhello/bfhello.c create mode 100755 c/bfhello/bfhello.elf create mode 100644 c/bfhello/bfhello.hex create mode 100644 c/bfhello/bfhello.o create mode 100644 c/bfhello/rvcontroller.ld (limited to 'c/bfhello') diff --git a/c/bfhello/Makefile b/c/bfhello/Makefile new file mode 100644 index 0000000..fa163ed --- /dev/null +++ b/c/bfhello/Makefile @@ -0,0 +1,20 @@ +all: bfhello.hex + +bfhello.o: bfhello.c + clang -target riscv32-none-elf -I../rvcontroller-libraries -march=rv32imacb_zicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt -ffreestanding -O3 -c -o bfhello.o bfhello.c + +bfhello.elf: ../rvcontroller-libraries/rvcontroller-init.o ../rvcontroller-libraries/rvcontroller-ecalls.o bfhello.o + riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o bfhello.elf ../rvcontroller-libraries/rvcontroller-init.o bfhello.o ../rvcontroller-libraries/rvcontroller-ecalls.o + +dump: bfhello.elf + riscv32-none-elf-objdump -d bfhello.elf + +bfhello.hex: bfhello.elf + riscv32-none-elf-objcopy -O ihex bfhello.elf bfhello.hex + +load: bfhello.hex + bash -c "wl-copy < bfhello.hex" + +clean: + rm -f bfhello.bin bfhello.elf bfhello.o init.o + diff --git a/c/bfhello/bfhello.b b/c/bfhello/bfhello.b new file mode 100644 index 0000000..8e5e5a6 --- /dev/null +++ b/c/bfhello/bfhello.b @@ -0,0 +1 @@ +++++++++[>+++++++++<-]>.+++++++++++++++++++++++++++++.+++++++..+++.>++++[>++++++++<-]>.>+++++[<+++++++++++>-]<.>++++[<++++++>-]<.+++.------.--------.>+++[>+++++++++++<-]>.>++++++++++. diff --git a/c/bfhello/bfhello.c b/c/bfhello/bfhello.c new file mode 100644 index 0000000..95d2209 --- /dev/null +++ b/c/bfhello/bfhello.c @@ -0,0 +1,91 @@ +/* This is a translation of bfhello.b, generated by bftoc.py (by Paul Kaefer) + * It was generated on Sunday, May 17, 2026 at 12:17AM + */ + +#include "rvcontroller-ecalls.h" + +void main(void) +{ + int size = 1000; + int tape[size]; + int i = 0; + + /* Clearing the tape (array) */ + for (i=0; i RAM + .data : + { + *(.sbss) + *(.data) + *(.bss) + *(.rela*) + *(COMMON) + } > RAM + + .heap : + { + . = ALIGN(4); + PROVIDE ( end = . ); + _sheap = .; + . = . + __heap_size; + . = ALIGN(4); + _eheap = .; + } >RAM + + .stack : + { + . = ALIGN(4); + _estack = .; + . = . + __stack_size; + . = ALIGN(4); + _sstack = .; + } >RAM + } -- cgit v1.2.3