flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > Including Assembly in C++

Author
Thread Post new topic Reply to topic
UniverseIsASimulation



Joined: 23 Sep 2016
Posts: 34
UniverseIsASimulation 27 Nov 2019, 15:25
Hey, guys!
I've just posted a video in which I show an easy way to include Assembly into C++. What do you think about it? I think it might help novice people get into Assembly.
Post 27 Nov 2019, 15:25
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 435
Location: Australia
redsock 14 Dec 2019, 09:12
Converting assembly language into its C/gcc/asm("") directive style include is interesting for sure, though I am not sure I would classify it as easy. Lots of possibilities to screw up this fragile process.

Admittedly Windows is not my thing anymore, but can't fasm produce a Windows object file that could be ABI compliant and linkable to an otherwise normal C/C++ project like I do for Linux?
Post 14 Dec 2019, 09:12
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 321
donn 14 Dec 2019, 16:47
If I followed that correctly, your method includes asm as inline asm() blocks in C++ projects? That's more flexible than linking against MS COFF functions in ways since you have to deal with the calling conventions. On the other hand, you have to have some C++ where you can plop the inlined asm.

Vid has an example using the MS COFF function linking method:
https://flatassembler.net/examples/msvc.zip
which is similar to the Linux HeavyThing method. Using the function linking method, you can call functions and access variables even from other asm, without C++. I've found it very useful, but inlining asm using automation is worth exploring too.
Post 14 Dec 2019, 16:47
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.