Talk:Inline Assembly

From OSDev Wiki
Jump to: navigation, search

The following text came from the OSFAQ on AT&T vs Intel syntax differences -- but it seems to me that it belongs here, instead:

You can switch to intel syntax mode in the inline assembler with a pseudo op, and switch back at the end of the block. -- MirAbile

Page with the contents on it: http://www.osdev.org/osfaq2/index.php/GasIntelHowtoMirror -- DasCandy

Under "Input Operands" I dont think the example code:

asm("mov %%eax,%%ebx": : "a" (amount));//useless but it gets the idea

matches the text, namely I think it should be :

int dummy;
asm("add %%eax,%%eax": "=a" (dummy)) : "0" (amount));// the "0" indicate that it's using the same register as the first parameter

--Dormito 04:21, 13 February 2014 (CST)

Bewing 00:20, 28 February 2007 (CST)

Personal tools
Namespaces
Variants
Actions
Navigation
About
Toolbox