Hi Win32ASM Community people!

I'm new on assembler, I made a code once about a year ago, but now I need to insert an assembler function on a C code (I'm using Visual C++ 6.0).
What I need is to read lines from a file and return it to a C language variable, the max number of characters on the line is 1000.

This community seems to be a gathering of very effective developers, so I need your help!

Thanks!
Posted on 2004-05-16 08:52:55 by Rapidd
You can not insert the asm code directly in the C or C++ code.

You can inline asm code in your c code depending on the assembler that your compiler uses, in this case because VC++, it should be masm sintaxis.

If you have a separate asm file, and it compiles, then is generated a objet file, you can link it to your VC project, in the project options of the linker type the name of the libs (and objects) that you whant link to.

For call the asm function in your C++ code, you should use:

extern "C"
{
int atoi( char *string );
typeReturn name(arguments_coma_separated );
}

or

extern "C" int atoi( char *string );
extern "C" typeReturn name(arguments_coma_separated );

and you can call it in your C++ code.



Have a nice day or night.
Posted on 2004-05-16 10:18:59 by rea
you can also do something like



__declspec(naked) int __stdcall add(int a, int b)
{
__asm {
mov eax,[esp+4]
add eax,[esp+8]
ret 8
}
}


or whatever.
Posted on 2004-05-16 11:20:06 by stormix