Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Wait... what's this "exit()" thingy about? In the main function, exit() is the same as return()... At least they both seem to exit the program...
_mark() :
I think that the "typedef int (*fnptr)(void)" should be "typedef void (*fnptr)(void)"...
Ok. Now I have a working version of mark() and tim's examples. I have a function that receives the fname as a char*. How do I call that from my asm code? I usually do this:
Mastermind wrote:
Wait... what's this "exit()" thingy about? In the main function, exit() is the same as return()... At least they both seem to exit the program...
_mark() :
I think that the "typedef int (*fnptr)(void)" should be "typedef void (*fnptr)(void)"...
Ok. Now I have a working version of mark() and tim's examples. I have a function that receives the fname as a char*. How do I call that from my asm code? I usually do this:
It's easier to explain with integer or pointer parameters (floats and doubles are another topic).
Just PUSH the parameters right-to-left, then use the CALL instruction, and ADD ESP, <number of parameters>*4 after that. NASMDOC.TXT should explain everything.
Tim Robinson wrote:
It's easier to explain with integer or pointer parameters (floats and doubles are another topic).
Just PUSH the parameters right-to-left, then use the CALL instruction, and ADD ESP, <number of parameters>*4 after that. NASMDOC.TXT should explain everything.
Tim:
Where can I obtain NASMDOC.TXT? Is it in the NASM distrib package? And you give an example with integer parameters? Thanks!!