There are several issues here: a. As already mentioned there is no point in using inline assembler for a function call. Inline assembler is occasionally (but very rarely nowadays) used for efficiency or for doing some low-level hardware things. But even if you have to use assmebler for something you can move results to local variable(s) for passing to functions in normal C/C++ code. b. You can't just do a "call" to an arbitrary memory location (as in your 1 and 2 examples). You have to use some sort of symbolic name so the linker can resolve the addres and the loader can adjust addresses when the program is run. c. Your example 3 looks like it could work but I think you are pushing the parameters onto the stack in the wrong order. d. Where does the code crash? I suspect in the call to WinExec but you can step through the code in the debugger to see exactly where it goes wrong. (Use Debug/Windows/Disassembly menu item to get the assembler code in the debugger.) e. Check what registers you can use in an _asm {} block. I think eax is safe but you may have to save (ie push and later pop) others like ebp before using them.
Andrew Phillips http://www.hexedit.com andrew @ hexedit.com