venus.w
venus.w

Reputation: 2251

What is the "long form" of asm()?

It is well known that asm() is a way to put assembly code into c code, but it is said in some resource that "unless you use the 'long form' of asm(), which correctly declares to the compiler the C-language effects of your assembly code, you leave yourself open to the substantial risk that a different compiler version, different compilation flags, or even minor changes to your C code may have disastrous interference effects." I want to know what is the "long form" of asm()?

Upvotes: 0

Views: 170

Answers (2)

Aki Suihkonen
Aki Suihkonen

Reputation: 20037

The "long form" most likely refers to GNU Extended Asm, where the user can specify constraints, input, output registers, as well as a clobber list to help the optimizing compiler in register allocation.

Upvotes: 5

Kevin A. Naudé
Kevin A. Naudé

Reputation: 4070

All use of embedded assembly code is subject to compiler specific details. Including any such long form. There isn't a standard for that sort of thing.

Upvotes: 3

Related Questions