From: Matthew B Kennedy Newsgroups: comp.os.msdos.djgpp Subject: Problem when assembling external function using "asmdefs.h" Date: Mon, 7 Oct 1996 23:27:07 +1000 Organization: University of Southern Queensland Lines: 46 Message-ID: NNTP-Posting-Host: helios.usq.edu.au Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hello. I've finished reading the AS assembler tutorial/guide, so I tried making a simple program in assembler (to be linked with C). 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). Thanks in advance, Matthew ===== ADD.C ============================ extern int _addint(int a, int b); void main(void) { int a, b, c; c = _add_int(a,b); printf("%d+%d=%d\n",a,b,c); } ===== ADD.S ============================ #include "libc/asmdefs.h" .file "add.c" .text .align 4 FUNC(__addint) ENTER movl ARG1, %eax addl ARG2, %eax LEAVE ===== 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 ======================================= (Line 6 corresponds to the FUNC(__addint) line)