Archived

This topic is now archived and is closed to further replies.

BeanDog

ASM proc to C++ declaration

Recommended Posts

I have a really small .obj file (thanks, CyberBen) that has the compiled MASM code for some blitting routines. It has this proc: DDSysBlit proc destsurface :DWORD sourcesurface : DWORD DestX :DWORD DestY :DWORD SourceRect :RECT DestPitch :DWORD SourcePitch :DWORD bpp :WORD I changed this into this prototype: void DDSysBlit(DWORD destsurface, DWORD sourcesurface, DWORD DestX, DWORD DestY, RECT SourceRect, DWORD DestPitch, DWORD SourcePitch, WORD bpp); This is correct, right? I need this for some .h files... ~BenDilts( void );

Share this post


Link to post
Share on other sites
I haven''t done many asm declarations so I''m not sure. Did you take into acount packing and calling convention? I think cdecl puts the parameters on the stack in reverse order, but stdcall does it the other way around.

Share this post


Link to post
Share on other sites
Wouldn''t it put it in reverse order for me if I put it in as an extern "C" function? I thought that was what that was for. I tried it with and without, but what the heck I''ll try reversing all the params.

Surely someone has done this before?



~BenDilts( void );

President, BDAA.

Share this post


Link to post
Share on other sites