fox-tools/gcc
2023-02-07 18:44:42 -08:00
..
bindings.c bindings: Hack which allows returning multiple values 2023-02-07 18:17:07 -08:00
bindings.kts bindings: Hack which allows returning multiple values 2023-02-07 18:17:07 -08:00
call.h gcc: Use register r31 to call routines instead of r10 2023-02-07 18:13:39 -08:00
fox32-c++ gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
fox32-cc gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
fox32-clang gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
fox32-clang++ gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
fox32-compile gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
fox32-g++ gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
fox32-gcc gcc: Import from the demos repo 2023-02-03 17:53:38 -08:00
README.md gcc: Implement ROM/OS calls 2023-02-06 19:50:50 -08:00
rv2fox rv2fox: Understand bgt and bgtu 2023-02-07 18:44:42 -08:00

Compiling C code for fox32

How does this work?

  • GCC compiles your C code with riscv*-gcc -S hello.c -march=rv32im -mabi=ilp32 -O2
  • rv2fox converts the generated RISC-V assembly to fox32 assembly
  • fox32asm makes an FXF binary

Generating bindings.c

bindings.kts is a little Kotlin script which generates bindings.c. Ensure you have Kotlin installed on your system, then run ./bindings.kts > bindings.c

TODO:

  • commandline argument passing
  • testcase sha256 program that hashes the ROM
  • rust support: rustc --emit asm --target riscv32im-unknown-none-elf test.rs -O