delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/15/08:13:04

From: dontmailme AT iname DOT com (Steamer)
Newsgroups: comp.os.msdos.djgpp
Subject: NASM & GCC - very good friends!
Date: Mon, 15 May 2000 12:21:55 GMT
Organization: always disorganized
Lines: 29
Message-ID: <391febcc.19849862@news.freeserve.net>
References: <391fe374 AT news DOT vogel DOT pl>
NNTP-Posting-Host: modem-10.bicolor-angel.dialup.pol.co.uk
X-Trace: news8.svr.pol.co.uk 958393316 29863 62.136.229.10 (15 May 2000 12:21:56 GMT)
NNTP-Posting-Date: 15 May 2000 12:21:56 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Chaos wrote:

>I've tried to include some code written in assembler to my C code in DJGPP.
[snip code]
>Kaszana.o(.text+0x1d):Kaszana.c: undefined reference to `AddFour'

The problem is that you have _AddFour_FUi instead of _AddFour.
Change this (both the label and the GLOBAL declaration) and it
will link.

>All these source files were taken from "Interfacing DJGPP with
>Assembly-Language Procedures" writtenby Matthew Mastracci. I supose that
>code is good part, so what can it be what causes erorrs?

It was evidently written for C++, not C.  But even if you were using
C++ it's better to write the asm as if you were using C, and then
use extern "C" in your C++ header files.

S.

PS. You don't need all that nonsense with EBP either:

BITS 32
GLOBAL _AddFour
SECTION .text
_AddFour:
    mov eax, [esp + 4]
    add eax, 4
    ret

- Raw text -


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