Aiming to be a calculator implemented in RISC-V assembly
Find a file
2025-02-10 15:03:55 +10:00
tests Fix grep invocation in tests 2025-02-10 14:03:04 +10:00
.gitignore Add some sample files 2025-02-09 11:09:13 +10:00
calc.s Attempt to print register values in regdump 2025-02-10 14:00:44 +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 Fix bug in tohex 2025-02-10 15:03:55 +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 Implement tohex function to format register to hex string 2025-02-10 12:55:08 +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: