[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-assembly
Subject:    Gcc extended asm : error
From:       "=?iso-8859-1?q?Rodrigo=20F.=20Baroni?=" <rodrigobaroni () yahoo ! com ! br>
Date:       2003-02-23 22:49:09
[Download RAW message or body]

Hello everybody,

      Does anyboby could know where are the problem in
the source attached ? The follow message are given by
gcc:

    asm2.c: In function `main':
    asm2.c:22: Invalid `asm' statement:
    asm2.c:22: fixed or forbidden register 2 (cx) was
spilled for class CREG. 


Rodrigo F Baroni
Computer Science Bach's Student
Sao Paulo, Brazil

_______________________________________________________________________
Busca Yahoo!
O serviço de busca mais completo da Internet. O que você pensar o Yahoo! encontra.
http://br.busca.yahoo.com/
["asm2.txt" (text/plain)]

#include <stdio.h>

#define rep_movsl( src, dest, numwords )	\
	__asm__ __volatile__ ( \
	"cld\n\t" \
	"rep\n\t" \
	"movsl" \
	: : "S" (src), "D" (dest), "c" (numwords) \
	: "%ecx", "%esi", "%edi" )

int main( void )
{
	char *src, *dest;
	int nro = 9;

	src = ( char * ) calloc( 10, sizeof( char ) );
	dest = ( char * ) calloc( 10, sizeof( char) );

	sprintf( src, "%s", "ola mundo" );
	printf( "%s", src );

	rep_movsl( src, dest, 9 );
	
	printf( "%s", dest ); 
	return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic