TCC Compiler Output (from #WebAssembly) prints "Hello World" in Apache #NuttX RTOS! 🎉 ... But needs painful #RISCV Assembly 🤔
Source: https://github.com/lupyuen/tcc-riscv32-wasm#ecall-for-nuttx-system-call
@popolon That's very helpful, thanks for the tip! :-)
@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.