Sorry if the answer to my question is really obvious, but im new to FASM.
Im trying to do the following:
Code a procedure and compile it into and obj file using FASM32 1.45
Include the object file in a MSVC++ 6.0 project
Call the procedure from C code.
The problem is that fasm gives me errors when i try to make a procedure, example code includes:
main proc
;code here
main endp
proc main
enter
;code here
return
neither of this works, it gives me an error such as "Error, illegal instruction: proc main"
Is my syntax totally wrong or am i supposed to set up FASM somehow to make this work? Sorry again if this is a totaly newbie question.
Im trying to do the following:
Code a procedure and compile it into and obj file using FASM32 1.45
Include the object file in a MSVC++ 6.0 project
Call the procedure from C code.
The problem is that fasm gives me errors when i try to make a procedure, example code includes:
main proc
;code here
main endp
proc main
enter
;code here
return
neither of this works, it gives me an error such as "Error, illegal instruction: proc main"
Is my syntax totally wrong or am i supposed to set up FASM somehow to make this work? Sorry again if this is a totaly newbie question.
Actually proc is not the FASM native construction but macro. The right is your second variant, but you must include stdcall.inc in your source file. Read the fasm manual and take a look at the examples.
BTW: Actually 'proc' is not an instruction and the error message is true. :)
BTW: Actually 'proc' is not an instruction and the error message is true. :)
Well, ok, that kinda worked, thanks, BUT... I still cant call the procedure from C... I link to the obj file, i declare:
extern void fun_name();
and then call it, but I get an error, saying that no such procedure exists. This might not really be Assembler related, but any help would be nice.
extern void fun_name();
and then call it, but I get an error, saying that no such procedure exists. This might not really be Assembler related, but any help would be nice.