Talk:Inline Assembly: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
Content deleted Content added
No edit summary
m Bot: Replace deprecated source tag with syntaxhighlight
 
(2 intermediate revisions by one other user not shown)
Line 8:
 
Under "Input Operands" I dont think the example code:
<sourcesyntaxhighlight lang="c">
asm("mov %%eax,%%ebx": : "a" (amount));//useless but it gets the idea
</syntaxhighlight>
</source>
matches the text, namely I think it should be :
<sourcesyntaxhighlight lang="c">
int dummy;
asm("add %%eax,%%eax": "=a" (dummy)) : "0" (amount));// the "0" indicate that it's using the same register as the first parameter
</syntaxhighlight>
</source>
--[[User:Dormito|Dormito]] 04:21, 13 February 2014 (CST)
--dormito
 
[[User:Bewing|Bewing]] 00:20, 28 February 2007 (CST)

Latest revision as of 05:58, 9 June 2024

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)