Hi David,
what about that: YASM will produce an OBJ file for you. The rest is a linker question. You could use GOLINK, which can produce DLL files:
HTH,
Gunther
Thank you so much Gunther, but my problem is related to the source file (I'm sending it again).
The file is created 100% but when I try to call it from a x64 Visual Basic application the system hangs. :icon_redface:
I'm going to be crazy!
The MAIN problem is the fact of the INTEL source code is NOT prepared to be a DLL but a LIB file, and I don't want to get a C++ file ONLY to access it! I'm trying to make it as a DLL and call it directly from Visual Basic.
I had modified the INTEL code adding a DLLEntry procedure as mentioned in NASM manual. Remember: the source code was made to be a LIB of a C/C++ CONSOLE APP.
I compile it successfully using:
vsyasm -f x64 -D WINABI sha512_sse4.asmI link it successfully using MS LINK and that commandline:
link /entry:DllMain /MACHINE:X64 /NODEFAULTLIB /def:hash.def /DLL /export:sha512_sse4 /subsystem:windows sha512_sse4.obj /out:"hash.dll"I get the DLL file withou any error from VSYASM and LINK.EXE! But when I try to call it from Visual Basic the system hangs. I tried two ways to call it, both UNSUCCESSFULLY:
1) To create a STRUCTURE inside VB and call the function via DECLARE (exactly what I done to call CPUID successfully) as shown below:
Public Structure GetSHA
Dim OriginalMsg As String
Dim SHA_Returned As String
Dim MsgLen As IntPtr
End Structure
Declare Sub sha512_sse4 Lib "hash.dll" (ByRef sMensagem As String, ByRef ssha As String, ByVal stamanhomensagem As IntPtr)
Public MyRetorno As GetSHA
sha512_sse4(MyRetorno)2) To create the variables without a structure and point them directly in the function:
Declare Sub sha512_sse4 Lib "hash.dll" (ByRef Message As String, ByRef ReturnedSHA As String, ByVal MsgSize As IntPtr)
Dim Msg As String = "system test"
Dim NewMsg As String = Msg.PadRight(64)
Dim NewMsgLen As UInteger = newMsg.Length
Dim returned As String = ""
sha512_sse4(newMsg, returned, NewMsgLen)
WOW!!! Why INTEL had choosen THIS way to do the things?!?!? It seems a bad joke with MS programmers....
And I really had appreciated THE WHOLE TEAM efforts to help me. I apologize for any inconvenience but here in Brazil is really too hard to find ANYONE with some ASM knowledge to ask my questions.
Thank you very much for any help.
Kindest regards Gunther and all the guys involved with my questions.