flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > C & FASM, make them work together?

Author
Thread Post new topic Reply to topic
FASMELINA



Joined: 05 Dec 2022
Posts: 1
FASMELINA 05 Dec 2022, 14:44
Hello, question from a beginner perspective.
Low level programming is truly fascinating, but sometimes a high level language is needed.
Is there a way to "connect" FASM and C? (for example when using SDL2 as a graphic library)
Thank you Embarassed Cool
Post 05 Dec 2022, 14:44
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 435
Location: Australia
redsock 05 Dec 2022, 19:26
wow its been a long time since I wrote this, but I did so for Linux. Windows calling convention is different but otherwise the same basic rules apply.

https://2ton.com.au/rants_and_musings/gcc_integration.html
Post 05 Dec 2022, 19:26
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 321
donn 06 Dec 2022, 02:42
2Ton's pages are very good.

There's also this example on the Windows side:

https://flatassembler.net/examples.php

Quote:
Mixing assembly with MS Visual C
size: 2 kilobytes
A somewhat-advanced example of mixing assembly and C. It uses MS Visual C, but it may apply to other C compilers.
Written by vid (2006).


I linked fasmg and C libs as MS COFF 64, 64 bit linkage and 32 is slightly different:

Code:
format MS64 COFF    


If you get stuck on anything, MSDN has some documentation, there are books on it, and ppl here can probably answer too.
Post 06 Dec 2022, 02:42
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.