It appears to me that it may vary between implementations of g++ what the syntax will be and whether inline assembly is even supported.

At http://cs.wwc.edu/~aabyan/Unix/Assembly.html I found instructions for inline assembly with g++, but it seems more DJGPP-oriented. Their code would not compile with my MinGW gcc nor g++; it would not even recognize the asm keyword. I also could find no reference to assembly in the LibC help file.

On my Redhat7 box, my version 2.96 gcc did recognize asm, but I had some compile errors.

So you might have to do a bit of testing and searching for your particular g++. The key appears to be that you shouldn't give up too quickly if you run into problems.