When I debug a C project, I can see all the assembly codes it compiles into. I want to know what assembly language that it. Is it NASM or MASM or something else? And if I use inline assembly, will I be able to use some other assembly language?
The code it compiles to is not assembly, but straight machine code, at least after link-time optimizations. What you see while debugging is on-the-fly disassembly of the machine code that is currently executing. As such, it has no additional structure, such as labels, macros, etc. such that you would expect to find in high-level assemblers, because this extra information is lost (or, more accurately, never present), when producing machine code.
If you meant the syntax, Visual Studio shows the assembly directives in Intel syntax, which is different from AT&T syntax, which is a default with GCC and GNU assembler.
In fact, it may also be gibberish. If you jmp
out of alignment (x86 instructions are variable-length), or to a region that does not contain executable code, but rather data, the disassembler will try to make sense of the data, producing random assembly directives that don't mean anything.
This is actually quite common; see for example this image:
add byte ptr [rax], al
is the attempted disassembly of bytes 00 00
, which obviously does not represent actual executable code.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments