1.1 KiB
1.1 KiB
Calculator
Aims to be a calculator implemented in 32-bit RISC-V assembly, initially targeting the inexpensive CH32V003 RV32EC microcontroller: 48Mhz 2KB SRAM, 16KB Flash.
Notes
Disassemble
riscv64-unknown-elf-objdump -D main.o
List Symbols
riscv64-unknown-elf-nm calc.o
List segment info
readelf -l calc.elf
Build with LLVM
make AS=clang ASFLAGS="-g -mabi=ilp32e --target=riscv32-unknown-elf -nostdlib -c"
Resources
- https://riscv-programming.org/book/riscv-book.html
- CH32V003 Datasheet
- QingKeV2 Processor Manual — core used in the CH32V003
Syscalls on RV32E
Syscalls supported by rv32emu.
Consensus seems to be pass the syscall number in t0
: