flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > AMD APP linkage in MS COFF

Author
Thread Post new topic Reply to topic
donn



Joined: 05 Mar 2010
Posts: 60
AMD APP linkage in MS COFF
Hi, I've been working with AMD APP in Visual Studio for a while now, mixing in asm objs with vid's COFF mixing style.

Was interested in calling functions such as

Code:
extrn '__imp_clGetPlatformIDs' as clGetPlatformIDs:qword

from fasm objs and running the executable with

Code:
/SUBSYSTEM:WINDOWS  /ENTRY:start 

instead of from cpp files/Visual Studio. I'm still trying to figure this out, but progress has been very slow.

I can set the main entry point as a fasm COFF and link with cpp objs, but the AMD APP calls don't seem to execute properly. I can get valid results if I set the main entry point within the cpp objs, then call an asm COFF func that calls clGetPlatformIDs, but I can't switch the entry point completely. Windows API functions still work once switching over, but the AMD APP ones don't.

An example call that works only when the cpp files contain the executable entry point:


Code:

        lea r8, [newAPP.numPlatforms]
        mov rdx0
        mov rcx0
        stdcall [clGetPlatformIDs], rcx,rdx,r8



or from the cpp.cpp file directly:


Code:

        cl_int status;
        cl_uint numPlatforms;
        status = clGetPlatformIDs(0NULL, &numPlatforms);
        



As mentioned above, progress has been slow trying to get rid of these cpp files. If anyone has any ideas off the top of their head, would be greatly appreciated.
Post 18 Sep 2017, 04:26
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 60
OK nevermind, I figured it out!

Haven't run a COFF as an executable entry point with non-WINAPI .lib's before, thought I was missing a step to get this to work, or thought it might not have been possible with this .lib (AMD's APP Platform). I was questioning everything and getting quite frustrated. Turned out to just be a case of a misaligned stack...

Sorry for the convoluted post, but getting this running was a huge relief!
Post 19 Sep 2017, 02:26
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.