Advertisement

Creating DLL with Win32 ASM?

Started by June 13, 2001 06:23 PM
4 comments, last by Tom 23 years, 8 months ago
Hi. I''m looking for info on making a DLL in ASM that I can call from my VC++ and VB programs. Articles and explanations are equally welcome. Is there any special methodology in making the DLL legible from within Visual Basic? Some kind of DEF file, for example? Thanks for your help.

GDNet+. It's only $5 a month. You know you want it.

Check this out (if you are using nasm):
http://www.web-sites.co.uk/nasm/docs/nasmdoc6.html#section-6.2.5

but wouldn''t it be much simpler to write a DLL in VC and include the asm code in the funcion(s) body?
Advertisement
I didn''t know I could do that. You mean just write my ASM directly in the VC workspace and compile it? Are there any special switches I need to use to compile it properly?

GDNet+. It's only $5 a month. You know you want it.

Tom: AFAIK, you only need to surround your code in Visual Studio files with asm blocks..

ie..

  __asm {      ;do asm ops here      mov blah, eax      }; //end asm block  


check msdn site for more tips..search for "assembly language" I think it was..

There''s a small function example of a function written in ASM being called from a c function...

hth,
Wazoo
Learn about game programming!Games Programming in C++: Start to Finish
Okay, I looked it up on my CD. You guys were right. Now the only problem is that inline assembly lacks the macro definitions of MASM, which is really what I wanted since it''s so much easier writing code with them. (ASM without macros is some scary shit.) Any solutions? Any ideas on how I can import the macros from MASM v6.12?

Thanks again for the help.

GDNet+. It's only $5 a month. You know you want it.

Write all the functions you want in asm (in .asm files with macros and stuff) and setup some custom build rules for them (right click a file in the project-tree and select Properties or Options or whatever).

Then you can write a regular .def file with export-rules for your asm functions and if you wish you can include som C/C++ code (in their own files), such as DllMain and stuff that don't need to bee in asm.

Then all you have to do is click "Build" and it should compile/assemble and link it all into a dll (provided of course that you have setup the project and the custom build rules correctly ).

Edited by - Dactylos on June 14, 2001 11:13:28 AM

This topic is closed to new replies.

Advertisement