Use objcopy (which is part of binutils as is as ) with --output-target set to binary .
as --64 test.s -o test.o objcopy -O binary test.o test.bin
And parse the output:
objdump -D -m i386:x86-64:intel -b binary test.bin
(Replace --32 and remove x86-64: for 32-bit versions)
source share