near the beginning of the file, you want a PROTOtype
MyFunc PROTO :DWORD,:DWORD,:DWORDthat tells the assembler how many and what size the parameters are
for 32-bit programs, it is best if they are all DWORD sized parms
in the program, you call the function as boggie suggested...
INVOKE MyFunc,Parameter3,Parameter2,Parameter1i numbered the parameters that way because that is the order they are pushed onto the stack
then, to write the function...
MyFunc PROC Parm3:DWORD,Parm2:DWORD,Parm1:DWORD
mov eax,Parm1
mov ecx,Parm2
mov edx,Parm3
;
;
;
mov eax,ReturnValue
ret
MyFunc ENDP
if your routine uses EBX, ESI, or EDI, it should be preserved
the assembler will do it for you
let's say we were going to use all 3...
MyFunc PROC USES EBX ESI EDI Parm3:DWORD,Parm2:DWORD,Parm1:DWORDin most cases, you shouldn't use EBP because the assembler uses that register as the stack frame base pointer and needs it to reference the parms