Assume I am not trying to make my code work with any other code or the output of any compiler...
What would be some options I should consider for a calling convention internal to my own code?
I've learned cdecl, fastcall, stdcall, etc... But these are all common conventions output by compilers. I want to learn a way I may do this as just an assembly programmer.
First, is there even one convention I should follow? Why or why not? I'm thinking for example, if I write a procedure which is to take 2 strings and a length, I could simply write it to expect the 2 string pointers to be in rsi, rdi, and the length in rcx for example... But maybe if I have a proc that takes 2 numbers in and does some math, then returns a result, that proc could expect the numbers to be in rcx and rdx, and then the return in rax and so on and so forth...
Generally, I think I would prefer registers so as to reduce the amount of memory reads/writes and stack manipulation, since most general purpose registers are assumed to be clobbered anyway...
Does anyone have any guidance on this? Is there a good blog, forum post, article, etc...?
Thanks