Follow

TCC Compiler Output (from ) prints "Hello World" in Apache RTOS! 🎉 ... But needs painful Assembly 🤔

Source: github.com/lupyuen/tcc-riscv32

@lupyuen I don't know if this can help, but "li" assembly mnemonic is a pseudocode that can be converted to several real RISC-V mnemonics, including addi rd,x0,imm. on the other side, gnu objdump and gdb (that use objdump to disassemble) disassemble addi rd,x0,imm as li rd,imm by default:

objdump -d <binary>

To display real instruction, the option -M no-aliases is needed:

objdump -d -M no-aliases <binary>

on a x86_64/armv8 etc...:

riscv64-elf-objdump -d -M no-aliases <binary>

or

riscv32-elf-objdump -d -M no-aliases <binary>

Depending on target binary. Sadly, didn't found this option in gdb disassemble command.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.