A bare metal program example about how to convert rust code to RISC-V assembly.
Only need install rust toolchain
# build the project
make build
# output asm to a file
make asm > output
Need install qemu
# Unbuntu
sudo apt install qemu-system-riscv64
# MacOS
brew install qemu
Run
make run
output
Hello, world!
inited heap: [0x80c09000, 0xc0c09000)
1 + 2 = 3
1.Open site: https://rust.godbolt.org/
2.Add --target riscv64gc-unknown-linux-gnu
to compiler options