flat assembler
Message board for the users of flat assembler.
Index
> Main > How to use fasm code in visual studio c++ |
Author |
|
cod3b453 02 Sep 2014, 18:22
The steps are:
- Change assembly to a COFF object file - Change API references to external implementation links - Set up the VC++ project to include your object file and link kernel32 and user32 - Add a dummy cpp file to allow the executable to be built - Declare the entrypoint as public in the FASM object and set the entrypoint to start - Explicitly define the subsystem in the VC++ project (I chose windows here) to allow correct linking Attached is an example VS2010 project.
|
|||||||||||
02 Sep 2014, 18:22 |
|
ry4n 04 Sep 2014, 10:54
Thanks for your valuable suggestion
|
|||
04 Sep 2014, 10:54 |
|
ry4n 05 Sep 2014, 12:11
func_fasm.asm:
include 'win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here .code proc fun1 invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!",invoke GetCommandLine,MB_OK endp how to call fun1 function from c++ |
|||
05 Sep 2014, 12:11 |
|
cod3b453 05 Sep 2014, 16:18
ry4n wrote: func_fasm.asm: (-Using a normal C++ project) - Declare the FASM function you want to reference in C++ - Change assembly to a COFF object file - Export the function for C++ in FASM [note: you have to encode the correct link string; I normally grab this from the error string. This will change for different compilers, architectures and calling conventions] - Add the FASM object to the link dependencies
|
|||||||||||
05 Sep 2014, 16:18 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.