What is the opt in the __asm grammar and how can semi-colons be used as comments without autoformatting?

Viewed 45

What is the meaning of opt in the grammar for invoking the inline assembler with __asm keyword? Is it trying to say the ending semi-colons are optional?

Semi-colons are usually used as comments in assembly. I find when I'm not using any semi-colons in my assembly-instruction-list, after typing one for a comment Visual Studio will do very strange autoformatting of the assembly instructions that I cannot seem to disable or make sense of.

Grammar
asm-block:
    __asm assembly-instruction ;opt
    __asm { assembly-instruction-list } ;opt

assembly-instruction-list:
    assembly-instruction ;opt
    assembly-instruction ; assembly-instruction-list ;opt

Source: https://docs.microsoft.com/en-us/cpp/assembler/inline/asm

0 Answers
Related