flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > MS COFF asm calling C++ library |
Author |
|
revolution 29 Jan 2010, 09:04
Code: extrn 'LibraryFunctionName' as MyInternalName ccall MyInternalName,p1,p2 |
|||
29 Jan 2010, 09:04 |
|
f0dder 29 Jan 2010, 09:24
1) you don't - you'll save yourself a lot of headaches if you restrict yourself to C/C++ calling assembly routines, and not the other way around.
|
|||
29 Jan 2010, 09:24 |
|
Japheth 30 Jan 2010, 19:59
f0dder wrote: 1) you don't - you'll save yourself a lot of headaches if you restrict yourself to C/C++ calling assembly routines, and not the other way around. A lot of my assembly programs call CRT functions. 'Headaches' are to be expected only if you don't know what you're doing. |
|||
30 Jan 2010, 19:59 |
|
f0dder 31 Jan 2010, 02:22
Japheth wrote:
_________________ - carpe noctem |
|||
31 Jan 2010, 02:22 |
|
Japheth 31 Jan 2010, 07:42
f0dder wrote: CRT, yes, but how often has that been C++? There's quite a difference between C and C++... "Not that often" of course - there's not much to gain. But you explicitely talked about C++ and C ... |
|||
31 Jan 2010, 07:42 |
|
f0dder 31 Jan 2010, 17:12
Japheth wrote:
True, true - the OP was pretty clearly about C++, though For C++ code it's - IMHO - just too much bother to even consider. Name mangling (which differs between compilers, and iirc even different compiler versions as well), memory layout, class instatiation, etc. Much easier to call assembly routines from C++. _________________ - carpe noctem |
|||
31 Jan 2010, 17:12 |
|
Bao Tran 01 Feb 2010, 17:57
Wow. I didn't expect to such quick answers, especially in less than 5 mins of the OP. kudos!
f0dder wrote: For C++ code it's - IMHO - just too much bother to even consider. Name mangling (which differs between compilers, and iirc even different compiler versions as well), memory layout, class instatiation, etc. Much easier to call assembly routines from C++. I'm inclined to agree with f0dder here. I ended up recoding my app in C++ because calling the routines from asm would get crazy, especially when I'm working with c++ dll's that aren't mine to control. It's not as easy as linking to C libraries where name mangling is more constant. I did take a look at the asm to Java example in this post http://board.flatassembler.net/topic.php?t=6370 and was thinking it could be possible to do something similar with a c++ class, but I'm a bit pressed for time, so I never pursued it. Any thoughts? |
|||
01 Feb 2010, 17:57 |
|
f0dder 01 Feb 2010, 19:23
Bao Tran wrote: I did take a look at the asm to Java example in this post http://board.flatassembler.net/topic.php?t=6370 and was thinking it could be possible to do something similar with a c++ class, but I'm a bit pressed for time, so I never pursued it. Any thoughts? Theoretically, you could set up a framework giving you some of the same possibilities for C++ code, but it's going to be bother to write, bother to support for your classes, and won'tgive you the full level of flexibility anyway. _________________ - carpe noctem |
|||
01 Feb 2010, 19:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.