# asm syntax

**URL:** <https://forums.developer.nvidia.com/t/asm-syntax/130435>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [August 9, 2006, 6:56pm UTC](https://forums.developer.nvidia.com/t/asm-syntax/130435 "2006-08-09T18:56:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![esmyth](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@esmyth](https://forums.developer.nvidia.com/u/esmyth)\
**Post date:** [August 9, 2006, 6:56pm UTC](https://forums.developer.nvidia.com/t/asm-syntax/130435/1 "2006-08-09T18:56:48Z")

</div>

I am looking for documentation on the asm syntax that I can use with the 6.1 PGI compilers. I have a little snippet like

asm volatile (“lock; incl %0”  
: “=m”(mValue)  
: “m”(mValue));

and I get compilation errors along the lines of

/tmp/pgCCbaaaafqpaA.s: Assembler messages:  
/tmp/pgCCbaaaafqpaA.s:103: Error: bad register name `%0’

which seems to strongly suggest that the asm syntax that I would have used with a gnu compiler will not work for me here (this does work with my gnu compilers). There is presumably a document on how to use the newly introduced asm and I would like to have a copy of that. I’ve searched the web and this site (in vain evidently).

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [August 11, 2006, 4:56am UTC](https://forums.developer.nvidia.com/t/asm-syntax/130435/2 "2006-08-11T04:56:50Z")

</div>

Hi esmyth,

Which compiler are you using? With PGI 6.1, extended asm is only supported in C but it appears that you might be compiling with the C++ compiler. C++ extended asm support will available with the up coming 6.2 release.

-Mat

---

<div class="post-metadata">

**Author:** ![esmyth](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@esmyth](https://forums.developer.nvidia.com/u/esmyth)\
**Post date:** [August 11, 2006, 3:54pm UTC](https://forums.developer.nvidia.com/t/asm-syntax/130435/3 "2006-08-11T15:54:02Z")

</div>

Hello Mat:  
I am using pgCC for this portion. You are right. I was unaware of this “inconsistency” between the pgcc and pgCC compilers in 6.1. I gather 6.2 is close at hand. In the meantime, I will try to move this code to a C translation unit and will thus inclur the overhead of an extra function call (which may turn out to be a bad deal). Nevertheless, it should work.  
Thanks,  
Evan
