delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/07/11:53:24

Date: Mon, 7 Oct 1996 17:36:36 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Matthew B Kennedy <q9522772 AT helios DOT usq DOT edu DOT au>
Cc: djgpp AT delorie DOT com
Subject: Re: Problem when assembling external function using "asmdefs.h"
In-Reply-To: <Pine.HPP.3.95.961007232355.1559A-100000@helios.usq.edu.au>
Message-Id: <Pine.SUN.3.91.961007173037.4486B-100000@is>
Mime-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019