This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Assembler in GCC


Hi,

On Fri, Apr 05, 2002 at 02:04:23AM +0300, Atanas Uzunov wrote:
> Hi,
> I need to know how to implement simple assembler instructions in C for
> example:
> 
> mov ah, 2
> 
> when i wrte this (asm ("mov ah, 2"::)) i get the message: Error: suffix or
> operands invalid for `mov'

Try this links:
http://www-106.ibm.com/developerworks/linux/library/l-ia.html?dwzone=linux
http://www.cs.virginia.edu/~clc5q/links.html

Based on that, i would suggest something like that:

int main (int argc, char **argv)
{
 asm volatile ("movb $2, %%ah" : : :"eax");
}

Read gcc's info page about extended inline assembly, too.

Hope that helps,
Martin.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]