LinuxCommandLibrary

llvm-mc

machine code playground

TLDR

Assemble to object file

$ llvm-mc -filetype=obj [input.s] -o [output.o]
copy
Disassemble hex bytes
$ echo "0x90" | llvm-mc --disassemble
copy
Assemble for specific architecture
$ llvm-mc -triple=x86_64-linux-gnu [input.s]
copy
Show encoding
$ llvm-mc -show-encoding [input.s]
copy

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.

SEE ALSO

llvm-as(1), as(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community