how can i use an assembly funcyion in C
i write two file one in assemble, something like this
.386
.model flat, stdcall
option casemap:none
.code
ftest proc
mov eax, esp
ret
ftest endp
end
and i want use ftest() function in C language
is it possible?
thx
Welcome to the forum.
Here is a quick example :
#include <stdio.h>
extern int __stdcall testproc(int x, int y);
int main(int argc,char *argv[])
{
int x=125,y=75;
printf("125 + 75 = %d",testproc(x,y));
return 0;
}
.386
.model flat,stdcall
option casemap:none
.code
testproc PROC x:DWORD,y:DWORD
mov eax,x
add eax,y
ret
testproc ENDP
thank you Vortex for your help and your example
now understand how do i do it :)