Author: Filip Tvrzsky
Date: 10:59:31 03/29/03
Go up one level in this thread
On March 29, 2003 at 13:43:39, Sune Fischer wrote:
>On March 29, 2003 at 13:18:50, Filip Tvrzsky wrote:
>>
>>From the GCC manual:
>>"Several versions of the compiler (C, C++, Objective-C, Ada, Fortran, and Java)
>>are integrated; this is why we use the name "GNU Compiler Collection". GCC can
>>compile programs written in any of these languages. The Ada, Fortran, and Java
>>compilers are described in separate manuals.
>>"GCC" is a common shorthand term for the GNU Compiler Collection. This is both
>>the most general name for the compiler, and the name used when the emphasis is
>>on compiling C programs (as the abbreviation formerly stood for "GNU C
>>Compiler")."
>>There is nothing about assembler ...
>
>I kindof figured gcc would invoke "as" to do what it couldn't do itself.
>gcc seem to be alround for .c and .cpp, so why not .a :)
>
>>Of course, you can compile assembler with gcc as well but only if it is embedded
>>in the asm statement like this:
>>asm(" movl %eax, %ecx ");
>
>If this is possible, why does Crafty use a special .s file for linux assembly
>and then have windows assembly as inline assembly in regular .c files?
>
>Can I use it directly in .cpp just by tossing "asm" around it?
>
>I will try.
>
It depends on the version of your GCC. New ones (like 3.2) don't allow to use
multiple lines strings, so you have to write it like this:
asm (" psrlq $9,%mm1 ");
asm (" por %mm1,%mm0 ");
or like this:
asm ("\n\
psrlq $9,%mm1 \n\
por %mm1,%mm0 \n"
);
Neither former nor latter manner is not much comfortable.
Filip
>>>Well, in any case I don't know how to write a makefile, so if that's what it
>>>takes then I'm lost.
>>>
>>
>>No, you don't need to write a makefile, neither I can do it. Simply substitue
>>the word "ALIGN" in the first line of the X86.s file with some number, I suppose
>>you 4 or 16, and try to compile it. "Error: bad or irreducible absolute
>>expression" messages should disappear. But if you compile with gcc instead of as
>>you become another error messages. If you will believe me and type: as X86.s ,
>>then you should became your requested object file a.out ... :-)
>>(at least it works so by me ...).
>>Filip
>
>Okay, that did actually work :)
>
>Step 1 complete. :)
>
>-S.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.