Date: Fri, 16 Oct 1998 04:40:13 +0100 (BST) From: George Foot To: djgpp AT delorie DOT com Subject: Re: Compiling Assembly with DJGPP In-Reply-To: <97a9b74.36265493@aol.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Thu, 15 Oct 1998 DoctorXV AT aol DOT com wrote: > how do I compile my Assembly program using DJGPP's assembly compiler? Just write the assembly commands in a `.s' file and pass it through gcc as you would a C file. The same output options apply, i.e. `-o xxxxx' sends output to `xxxxx'; `-c' makes it assemble to object files (.o) but go no further; the default is to assemble and link with the standard C library and djgpp's startup code. If you name your file with a capital S extension, and pass it to gcc as such, it will also be passed through the C preprocessor, so you can use C-style comments and preprocessor directives (#include, #define) rather than gas-style. If you want hints on this sort of thing, including how to write your code in such a way that it can interface with gcc-compiled code (essential, actually, since parts of the djgpp startup code are gcc-compiled) then see this minitutorial I wrote: http://users.ox.ac.uk/~mert0407/asmfuncs.txt It also gives hints on general function structure and getting useful debugging information from symify. It does not explain the AT&T syntax; for that see the first section of Brennan's guide to inline assembly: http://brennan.home.ml.org/djgpp/djgpp_asm.html -- george DOT foot AT merton DOT oxford DOT ac DOT uk xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html