Aiming to be a calculator implemented in RISC-V assembly
Find a file
2025-02-10 12:04:39 +10:00
tests Add a byte to hex function with unit test 2025-02-10 12:04:39 +10:00
.gitignore Add some sample files 2025-02-09 11:09:13 +10:00
calc.s Add a byte to hex function with unit test 2025-02-10 12:04:39 +10:00
cmain.c Fix segfault with the help of gdb via Nix 2025-02-09 21:36:54 +10:00
exit.s Add some sample files 2025-02-09 11:09:13 +10:00
hello.s Fix hello.s so that it only prints 5 times and exits 2025-02-09 11:32:46 +10:00
hex.s Add a byte to hex function with unit test 2025-02-10 12:04:39 +10:00
link.ld Add linker script to make bss work 2025-02-09 15:09:53 +10:00
main.s Add some sample files 2025-02-09 11:09:13 +10:00
Makefile Add a byte to hex function with unit test 2025-02-10 12:04:39 +10:00
README.md Add linker script to make bss work 2025-02-09 15:09:53 +10:00
shell.nix Fix segfault with the help of gdb via Nix 2025-02-09 21:36:54 +10:00

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

Resources

Syscalls on RV32E

Syscalls supported by rv32emu.

Consensus seems to be pass the syscall number in t0: