asm

suggest change

The asm keyword takes a single operand, which must be a string literal. It has an implementation-defined meaning, but is typically passed to the implementation’s assembler, with the assembler’s output being incorporated into the translation unit.

The asm statement is a definition, not an expression, so it may appear either at block scope or namespace scope (including global scope). However, since inline assembly cannot be constrained by the rules of the C++ language, asm may not appear inside a constexpr function.

Example:

[[noreturn]] void halt_system() {
    asm("hlt");
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents