Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is an "asm Macro" part of standard C?

Tags:

c

embedded

We develop code for embedded PowerPC architectures.

Our compiler supports something called asm Macros.

Here an excerpt from the handbook:

asm Macro Syntax

An asm macro definition looks much like a function definition, including a return type and parameter list, and function body.

The syntax is:

asm [volatile] [return-type] macro-name ( [ parameter-list ] )
 {
 % storage-mode-list (must start in column 1)
 ! register-list     (“!” must be first non-whitespace)
   asm-code      
 } (must start in column 1

Is this standard C? My compiler does not list this as an extension in his handbook.

Clarification after first answer:

I'm aware the part withen { } is not defined by standard C. I meant the function like construct after asm and before the closing ).

like image 681
RedX Avatar asked Jan 19 '26 05:01

RedX


1 Answers

No, it is not standard C. Anything architecture-specific, like assembly code, is going to be an implementation-specific extension just about by definition.

like image 124
Carl Norum Avatar answered Jan 20 '26 17:01

Carl Norum