🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #851

Re: CPP und ASM ???

#851
From: Frank-Christian Kruegel
Date: Wed, 22 Nov 1995 05:15
39 lines
1689 bytes
kutzeln@uni-muenster.de meinte am 21.11.95
zum Thema "CPP und ASM ???":

>
> Hallo Alle,
>
> wie linke ich Variablen mit CPP und ASM?
>
> TESTCPP.CPP:
> [...]
> unsigned long testvar;
> [...]
>
> TESTASM.ASM
> [...]
> extrn testvar : DWORD
> [...]
>
> Da macht mir der Watcom Linker einen Fehler: "unreferenced Symbol testvar"
> bzw. "undefined symbol testvar" :-(( Ich werde doch wohl noch globale
> Variablen aus CPP-Dateien in ein mit TASM assembliertes File einlesen
> koennen? Wo steckt der Wrum drin?
>
> Danke im Voraus...

1. Variable als extern "C" deklarieren, sonst hast Du mit dem
   C++ name mangling Probleme.
2. Im Assemblerpart wird den Symbolen ein _ vorangestellt.
3. Vielleicht besser auf stack based calling convention (_cdecl)
   ausweichen. Das ist wenigstens portabel. Register based calling
   convention ist WQatcom-spezifisch, man erkennt es daran, dass der _
   nicht vorne, sondern hinten angefuegt wird.



Frank-Christian Kruegel

----------------------------------------------------------------------
fchk@gigabyte.ohz.north.de                 2:2426/3060.1 21:100/8211.1
Technical Details
Message-ID: <5yM4Ns7ri6B@gigabyte.istda.ohz.north.de>
Path: arc1-ca.pugleaf.net!istda.ohz.north.de!fchk
References: <Pine.A32.3.91.951121152951.51974A-100000@asterix.uni-muenster.de>

Show Full Headers
Complete Article Headers
X-Mailer: CrossPoint v3.1 R/C385
Message-ID: <5yM4Ns7ri6B@gigabyte.istda.ohz.north.de>
X-Gateway: ZCONNECT UV uistda.ohz.north.de [DUUCP BETA vom 28.07.1995]
References: <Pine.A32.3.91.951121152951.51974A-100000@asterix.uni-muenster.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
From: fchk@gigabyte.ohz.north.de (Frank-Christian Kruegel)
Subject: Re: CPP und ASM ???
Date: 22 Nov 1995 06:15:00 +0100
Path: arc1-ca.pugleaf.net!istda.ohz.north.de!fchk
Newsgroups: de.comp.lang.c++
Distribution: world