In other C compilters such as gcc, there is a -S option to translate to assembly file rather than binary.
For instance, "gcc -S prog.c" creates a prog.s file in their assembly syntax, "gcc -S -masm=intel prog.c" creates a prog.s file in the intel assembly syntax. Is there such a feature here?
You can use the /T option:
/Tx86-coff Creates a COFF (Common Object File Format) object file for a X86 processor.
/Tx86-asm Creates an assembly text file for a X86 processor.
/Tx64-coff Creates a COFF (Common Object File Format) object file for a X64 processor. As of version 9.00, the default.
/Tx64-asm Creates an assembly text file for a X64 processor.
/Tamd64-coff Alias for /Tx64-coff.
/Tamd64-asm Alias for /Tx64-asm.
The assembler is available only with INTEL syntax.
See help file, command line tools POCC.
/Tx64-asm was what I was looking for. Tried it and it works.
Thank you frankie.
Is there a way to disassemble just ONE single function?
My code has about 2000 functions and complete disassembly
does not make any sense at all.
Quote from: Akko on April 06, 2022, 08:39:09 PM
Is there a way to disassemble just ONE single function?
My code has about 2000 functions and complete disassembly
does not make any sense at all.
You can't because this is not a disassembling, but a different output of the compiler.
Using the switch
/T the compiler is instructed to emit assembler code for the source 'C' code in a text file instead of the corresponding machine op-codes in an object file.
You can use the PE/COFF viewer, distributed with PellesC V11, to disassemble the object file, but it will be a mess to locate the function you want in the object code.
Probably the simplest way to achieve what you want is to copy the source code of the function you want in a new source file and compile just this file with the
/T option.
Hi Akko,
A very good disassembler :
https://github.com/gitGNU/objconv
You can also just create a normal object file from the compiler and then use
PODUMP -disasm <somename>.obj
to look at the result.
If you include the compiler option /Zd (line numbers) source lines will be mixed with assembly code in the output.
Most optimizations will still be enabled with the /Zd option (unlike the /Zi option).
There is an poide Add-In for podump too:
https://forum.pellesc.de/index.php?topic=6985.msg26516#msg26516
PrjObjPODmp_WS is for podump.exe