flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > How do you link MS Visual Studio C/C++ with Fasm ? |
Author |
|
shism2 17 Nov 2006, 12:24
Can anyone provide any example or way to actually do this ? I need a way urgently... because I need to work on a paid project with a company ... thanks
|
|||
17 Nov 2006, 12:24 |
|
vid 17 Nov 2006, 16:37
in FASM, create MS COFF file. there, declare your procedure as public:
Code: proc string, size ... endp public myproc as '_myproc' in C, declare it: Code: extern "C" { myproc(char*, int); } and link it with OBJ file created from FASM source. In visual studio, it's (i think): project context menu (right click on project) -> properties -> Link -> additional dependencies |
|||
17 Nov 2006, 16:37 |
|
Maverick 17 Nov 2006, 17:07
By the way, does somebody happen to have some good docs about the MSCOFF object format produced and used by VisualC 8.0?
|
|||
17 Nov 2006, 17:07 |
|
wisepenguin 17 Nov 2006, 19:54
i had a topic on the board a while ago about using FASM within
the 2005 IDE, and actually compile the fasm source code within msvc2005 with asm syntax colouring. i will try and find it for you, or search for "fasm 2005 ide" or similar on the board |
|||
17 Nov 2006, 19:54 |
|
wisepenguin 17 Nov 2006, 19:58
|
|||
17 Nov 2006, 19:58 |
|
Quantum 18 Nov 2006, 14:47
vid
Quote:
That works in C++ only. In plain C you have to use just extern (not required in most cases, because all unknown functions are assumed to be extern by default). So, to make it compatible with both C and C++, some preprocessing is required: Code: #ifdef __cplusplus extern "C" { #endif int myproc(void); #ifdef __cplusplus } #endif Maverick http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx Last edited by Quantum on 20 Nov 2006, 01:27; edited 1 time in total |
|||
18 Nov 2006, 14:47 |
|
Maverick 18 Nov 2006, 16:01
Quantum wrote: Maverick Thanks a lot, Quantum And many thanks also to sleepsleep who emailed the files this morning. _________________ Greets, Fabio |
|||
18 Nov 2006, 16:01 |
|
shism2 19 Nov 2006, 19:18
So,Quantum... that works without any modification to it?
|
|||
19 Nov 2006, 19:18 |
|
Quantum 20 Nov 2006, 01:26
In FASM:
Code: public myproc as '_myproc' myproc: mov eax,5 ret In C: + the example above Code: printf("%d", myproc()); Prints out: 5 |
|||
20 Nov 2006, 01:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.