- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using CVF to create a DLL from mixed Fortran and Assembly files.
I export the entry point to a Fortran routine by using the DLLEXPORT directive:
subroutine MyFortranRoutine(x, y)
!DEC$ ATTRIBUTES DLLEXPORT::MYFORTRANROUTINE
...
end
How do I export the entry point to an assembly routine?
I don't want to just wrap the assembly routine in a Fortran wrapper function which I then export.
The assembly routine looks like this:
MYASSEMBLYROUTINE PROC STDCALL, x:SDWORD, y:SDWORD extrn _z@12:proc
...
MyAssemblyRoutine ENDP
I export the entry point to a Fortran routine by using the DLLEXPORT directive:
subroutine MyFortranRoutine(x, y)
!DEC$ ATTRIBUTES DLLEXPORT::MYFORTRANROUTINE
...
end
How do I export the entry point to an assembly routine?
I don't want to just wrap the assembly routine in a Fortran wrapper function which I then export.
The assembly routine looks like this:
MYASSEMBLYROUTINE PROC STDCALL, x:SDWORD, y:SDWORD extrn _z@12:proc
...
MyAssemblyRoutine ENDP
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know if MASM has a "DLLEXPORT" directive/pragma/whatever. Perhaps one uses a .DEF file for this?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve is on to something when he suggests using a .DEF. See
http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_10.htm
BTW kb Q228545 has a patch 6.14 for masm.
Please post back on your success and any uncovered pitfalls.
HTH,
Gerry T.
http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_10.htm
BTW kb Q228545 has a patch 6.14 for masm.
Please post back on your success and any uncovered pitfalls.
HTH,
Gerry T.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, there is a MASM611SAMPLESWINDLL folder that shows how to make an all-MASM DLL.
Not being extreme MASM experts, we are going to have a hard time using this to devine the one or two lines of code that perhaps would solve our problem within CVF, where we just want to add one entry point.
The development environment doesn't seem to have a place for adding .DEF files. There seems to be a .EXP file already that defines exports.
Anyu experts out there who know the answer?
Not being extreme MASM experts, we are going to have a hard time using this to devine the one or two lines of code that perhaps would solve our problem within CVF, where we just want to add one entry point.
The development environment doesn't seem to have a place for adding .DEF files. There seems to be a .EXP file already that defines exports.
Anyu experts out there who know the answer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just add the .DEF as if it was a source file. It will get picked up automatically by the linker. I have done this (just not with MASM.)
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What should the DEF file look like? Should it export WEP and/or the entry points that are already exported by the DLLEXPORT directives in my Fortran routines?
I tried putting the following .DEF file in the same folder as my source files, but according to DUMPBIN it didn't add the export (MyAsmFunction) that I specified:
LIBRARY MyDll
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE SINGLE
SEGMENTS CODE2 PRELOAD FIXED
EXPORTS MyAsmFunction
I tried putting the following .DEF file in the same folder as my source files, but according to DUMPBIN it didn't add the export (MyAsmFunction) that I specified:
LIBRARY MyDll
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE SINGLE
SEGMENTS CODE2 PRELOAD FIXED
EXPORTS MyAsmFunction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Simply placing the .DEF file in the source directory is insufficient - you have to be sure that it is an input to the linker, similar to a .OBJ. That's what adding it as a project source would do.
I've used .DEF files a little. I think the EXPORTS keyword is supposed to be on a line by itself, then followed by lines naming the exports. I also think that proper case for the symbol name is important.
Steve
I've used .DEF files a little. I think the EXPORTS keyword is supposed to be on a line by itself, then followed by lines naming the exports. I also think that proper case for the symbol name is important.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did a search on Microsoft's site for Q228545 and got no results. Is that number correct?
Mike
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page