Namespaces
Variants
Views
Actions

Talk:cpp/language/asm

From cppreference.com
< Talk:cpp‎ | language
Revision as of 19:45, 13 August 2024 by Benio (Talk | contribs)

The example code on this page does not work. There is no multiplication written there, so the intended output will not happen, and the program segfaults when run. Will eccles (talk) 07:39, 6 July 2021 (PDT)

It runs fine and gives the output as expected, as can be seen by using the "run this code" button. The multiplication by 5 comes from the lea, which multiplies eax by 4 and adds it to eax --Ybab321 (talk) 13:04, 6 July 2021 (PDT)

Wrong Syntax

According to:

  • C++26 standard (ISO/IEC 14882:2026):
    • 9.10 The asm declaration [dcl.asm]
  • C++23 standard (ISO/IEC 14882:2024):
    • 9.10 The asm declaration [dcl.asm]
  • C++20 standard (ISO/IEC 14882:2020):
    • 9.10 The asm declaration [dcl.asm]
  • C++17 standard (ISO/IEC 14882:2017):
    • 10.4 The asm declaration [dcl.asm]
  • C++14 standard (ISO/IEC 14882:2014):
    • 7.4 The asm declaration [dcl.asm]
  • C++11 standard (ISO/IEC 14882:2011):
    • 7.4 The asm declaration [dcl.asm]
  • C++03 standard (ISO/IEC 14882:2003):
    • 7.4 The asm declaration [dcl.asm]
  • C++98 standard (ISO/IEC 14882:1998):
    • 7.4 The asm declaration [dcl.asm]

the syntax before diff. 174910 was wrong:

  1. attribute-specifier-seq (optional) was added in (C++17), not (C++11).
  2. balanced-token-seq replaced string-literal in (C++26), while old page stated wrongly that is was there since beginning.

I've corrected the Syntax section, but sections: Explanation and Notes should be corrected aswell.

Best regards, Benio (talk) 20:45, 13 August 2024 (PDT)