flat assembler
Message board for the users of flat assembler.

Index > DOS > Einbindung obj datei in c++ 4.62 in projekt

Author
Thread Post new topic Reply to topic
bmmueller



Joined: 06 Mar 2025
Posts: 12
bmmueller 28 Mar 2025, 22:28
Hallo
ich versuche eine in asm geschriebene datei in ein c++ projekt einzubinden.
Die asm datei funktioniert prima wenn ich daraus eine *.com datei erstelle und sie unter dos 6.22 ausführe. jetzt soll die funktion aus der obj datei mit "extern" im c++ projekt verfügbar sein.
Alle beispiele und Assembler (NASM,TASM) erzeugen super obj dateien, aber deren funktion "myfunk" wird im projekt nicht erkannt.

extern "C" myfunk();
void main()
{
int st;
st = myfunk(); // aus obj datei
getch();
}
// und die asm datei
---------------------------------------------------------------
asm
.model small
.code
public myfunk

myfunk prc

// asm code

myfunk endp

end
Post 28 Mar 2025, 22:28
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4227
Location: vpcmpistri
bitRAKE 29 Mar 2025, 20:19
Try: .model flat, c

Everything else looks good.

Maybe,
extern "C" int myfunk();

But that should be the default. You've not shared any compiler error. So, that is some ambiguity.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 29 Mar 2025, 20:19
View user's profile Send private message Visit poster's website Reply with quote
bmmueller



Joined: 06 Mar 2025
Posts: 12
bmmueller 02 Apr 2025, 16:22
Habe es jetzt geschafft
Danke an Alle
Post 02 Apr 2025, 16:22
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.