llvm-mc
machine code playground
TLDR
Assemble to object file
$ llvm-mc -filetype=obj [input.s] -o [output.o]
Disassemble hex bytes$ echo "0x90" | llvm-mc --disassemble
Assemble for specific architecture$ llvm-mc -triple=x86_64-linux-gnu [input.s]
Show encoding$ llvm-mc -show-encoding [input.s]
SYNOPSIS
llvm-mc [options] file
DESCRIPTION
llvm-mc is the LLVM machine code playground. Assembles and disassembles machine code for various targets. Useful for testing assembly syntax, examining instruction encodings, and low-level debugging.
PARAMETERS
-filetype type
Output type (asm, null, obj).-triple triple
Target triple.--disassemble
Disassemble input.-show-encoding
Show instruction encoding.-o file
Output file name.
