News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

linking vc++

Started by fushiyun, May 29, 2006, 09:05:37 AM

Previous topic - Next topic

fushiyun

i hope to build a project using Masm32 and VC++ 6.0.
i want to write a function such as "Testing proc dwInput:DWORD" used Masm32.
then, i will call this function using VC++ 6.0 (Win32 Application).

my problem is how to link Masm32 and VC++ 6.0.
is it just like DOS' linking method ?
can anybody give me some suggestion.
thank.

zcoder

you create all your assembly functions into a lib then include the lib
in C's IDE then make sure you make C protos for each function
in your lib _std_something ect.

I hope this makes sence, I tried to keep it short.

Zcoder....
Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names

Mincho Georgiev

In fact it's very easy. I've made that  sample how to do it with a short comments in the batch files, you mention that you prefer the command line, so i hope that helps.


[attachment deleted by admin]

asmfan

Inline asm statements are useful too. I like it very much with __declspec( naked ) __declspec( noreturn ) specifyed... Why don't you try this?
Russia is a weird place

fushiyun

thank zcoder, shaka_zulu, and asmfan. :U

my English is poor.
but, now, i am very happy about your replies because my English have a liite improvement.  :bg

for zcoder idea:
it is good idea for my project.
i have forgot the LIB method before i post my problem. :red

for shaka_zulu idea:
i adopted this method in my project and it work well.
now, i know how to combin masm32 and vc++ 6.0.  :P

for asmfan idea:
i don't know that how to manipulate ASM register and pass parameters to ASM using asm statement in c++.
so. i can only adopt neither zcoder or shaka_zulu method.  :(
can you give me a example, thank you.

thank for your replies. :P

asmfan

The first of all i can suggest you to study all calling conventions available for programmer. Then you will know how parameters are organized on the stack and what should return procedure as C data types (int - DWORD, bool - BYTE, etc.) who clears the stack after calling procedures... and so on...

__declspec( noreturn )   int  MyAdd( int a, int b )
{
   __asm
   {
      mov  eax, a
      add  eax, b
   }
}
Russia is a weird place

fushiyun

thank asmfan.  :bg
i will continue to study about that.

asmfan

Always welcome! Ask questions, get answers...
Russia is a weird place