llvm-mc Command Examples

LLVM Machine Code Playground. It provides a set of tools for working with LLVM machine code. Part of LLVM. More information: https://llvm.org/docs/CommandGuide/llvm-mc.html.

llvm-mc --filetype=obj -o {{path/to/output.o}} {{path/to/input.s}}

llvm-mc --disassemble -o {{path/to/output.s}} {{path/to/input.o}}

llvm-mc -o {{path/to/output.s}} {{path/to/input.bc}}

echo "{{addl %eax, %ebx}}" | llvm-mc -show-encoding -show-inst

echo "{{0xCD 0x21}}" | llvm-mc --disassemble -triple={{target_name}}