What assembly language does C code compile into in Visual Studio?

Erik W

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?

user267885

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:

enter image description here

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Does Visual Studio Code support language servers written in C#

From Dev

Compile simple C code in Visual Studio 2013

From Dev

C to Assembly code - what does it mean

From Dev

What does "Visual Studio Code" setup uses?

From Dev

What does "Visual Studio Code" setup uses?

From Dev

How to view the Assembly code for C# in Visual Studio (not the MSIL)?

From Dev

Call Assembly procedure from C++ code using Visual Studio

From Dev

How to compile c# in Microsoft's new Visual Studio Code?

From Dev

Why doesn't C code compile properly in Visual Studio?

From Dev

What does it do this assembly code?

From Dev

What code can echo a character in assembly language?

From Dev

What is wrong with my assembly language code

From Dev

what does cmp do in assembly language

From Dev

What does these errors mean? Assembly Language

From Dev

Compile Sparc Assembly Language

From Dev

What are Fakes assembly in Visual Studio 2013?

From Dev

What are Fakes assembly in Visual Studio 2013?

From Java

Bad Instruction - Inline Assembly Language in C Code

From Dev

Converting C code to MIPS Assembly Language

From Dev

Visual Studio Code: compile typescript module

From Dev

What does it mean if Visual studio 2012 throws a compile error that shouldn't exist for VS2012?

From Dev

How to enable Assembly Language support in Visual Studio 2013

From Dev

Can't build Assembly Language program in Visual Studio

From Dev

How to enable Assembly Language support in Visual Studio 2015

From Java

How do I set up Visual Studio Code to compile C++ code?

From Dev

What is meaning of exception in Visual Studio for C++ code

From Java

What is a 'workspace' in Visual Studio Code?

From Dev

What exactly is Visual Studio Code?

From Dev

Visual studio 2015 c++ and assembly not building

Related Related

  1. 1

    Does Visual Studio Code support language servers written in C#

  2. 2

    Compile simple C code in Visual Studio 2013

  3. 3

    C to Assembly code - what does it mean

  4. 4

    What does "Visual Studio Code" setup uses?

  5. 5

    What does "Visual Studio Code" setup uses?

  6. 6

    How to view the Assembly code for C# in Visual Studio (not the MSIL)?

  7. 7

    Call Assembly procedure from C++ code using Visual Studio

  8. 8

    How to compile c# in Microsoft's new Visual Studio Code?

  9. 9

    Why doesn't C code compile properly in Visual Studio?

  10. 10

    What does it do this assembly code?

  11. 11

    What code can echo a character in assembly language?

  12. 12

    What is wrong with my assembly language code

  13. 13

    what does cmp do in assembly language

  14. 14

    What does these errors mean? Assembly Language

  15. 15

    Compile Sparc Assembly Language

  16. 16

    What are Fakes assembly in Visual Studio 2013?

  17. 17

    What are Fakes assembly in Visual Studio 2013?

  18. 18

    Bad Instruction - Inline Assembly Language in C Code

  19. 19

    Converting C code to MIPS Assembly Language

  20. 20

    Visual Studio Code: compile typescript module

  21. 21

    What does it mean if Visual studio 2012 throws a compile error that shouldn't exist for VS2012?

  22. 22

    How to enable Assembly Language support in Visual Studio 2013

  23. 23

    Can't build Assembly Language program in Visual Studio

  24. 24

    How to enable Assembly Language support in Visual Studio 2015

  25. 25

    How do I set up Visual Studio Code to compile C++ code?

  26. 26

    What is meaning of exception in Visual Studio for C++ code

  27. 27

    What is a 'workspace' in Visual Studio Code?

  28. 28

    What exactly is Visual Studio Code?

  29. 29

    Visual studio 2015 c++ and assembly not building

HotTag

Archive