Difference between assembly code and disassembly listing

assemblyccompiler

Is the disassembly listing generated by a disassembler exactly the same as the assembly code listing that is optionally generated by a compiler during the compilation of C code?

Best Answer

No I'd expect that the compiler's assembly output can include symbolic names, of functions and of variables, even struct member names. The disassembly would only contain numbers.

In other words, both the compiler and the disassembler can output opcode instruction names, but the disassembler merely outputs numbers instead of symbols when it refers to memory addresses. Or if it's disassembling a DLL, the disassembler might output the public symbols exported from the DLL; but (unlike the compiler) not the symbolic names of internal variables and subroutines.

Apart from that, it's the same machine code. There's also a linker, which happens after the compiler (the linker's processing will be evident in the numeric addresses shown by the disassembler).

Related Topic