Date: Mon, 7 Oct 1996 17:36:36 +0200 (IST) From: Eli Zaretskii To: Matthew B Kennedy Cc: djgpp AT delorie DOT com Subject: Re: Problem when assembling external function using "asmdefs.h" In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 7 Oct 1996, Matthew B Kennedy wrote: > The exact files and compile commands I have used are below. As you > can see, I am using the "asmdefs.h" file to be able access the FUNC, > ENTER and LEAVE macros. The problem is, the assembler spits-chips > when it comes across the FUNC macro (see the compilation result). [snip] > ===== COMPILATION COMMANDS ============ > [1] C:\DJGPP >gcc add.c add.s -o add > add.s: Assembler messages: > add.s:6: Error: invalid character '(' in opcode > add.s:7: Error: operands given don't match any known 386 instruction Unlike other assemblers, Gas does NOT know how to handle macros like those defined on `asmdefs.h'. It needs a cpp pass on the source before you submit it to Gas. Gcc will do that automagically for you, if you call it like so: gcc add.c add.S -o add (note the capital S!). Yes, gcc is NOT case-insensitive to filenames. Capital S means run the preprocessor on the source before calling Gas. I suggest you read section 8.4 of the DJGPP FAQ list (v2/faq201b.zip from the same place you get DJGPP) for more info on the way gcc determines the source language.