Talk:Inline Assembly: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 16: Line 16:
asm("add %%eax,%%eax": "=a" (dummy)) : "0" (amount));// the "0" indicate that it's using the same register as the first parameter
asm("add %%eax,%%eax": "=a" (dummy)) : "0" (amount));// the "0" indicate that it's using the same register as the first parameter
</source>
</source>
--[[User:Dormito|Dormito]] 04:21, 13 February 2014 (CST)dormito
--dormito


[[User:Bewing|Bewing]] 00:20, 28 February 2007 (CST)
[[User:Bewing|Bewing]] 00:20, 28 February 2007 (CST)

Revision as of 10:21, 13 February 2014

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)dormito

Bewing 00:20, 28 February 2007 (CST)