1

I'm learning 64bit assembly language on Windows OS. I'm following a book but I'd like to maybe do some experimenting calling functions that the book doesn't use. How can I find out which registers I'm supposed to place the calling parameters in and which registers contain the return values? Is there any kind of documentation that reveals that? Or is there a standard that is followed for all the functions (for example are all returns placed into RAX?)

In particular I'm looking for information on functions in kernel32.lib

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 1
    Check out the [tag wiki](https://stackoverflow.com/tags/x86/info). I'll link a suitable duplicate in a minute. – fuz Mar 22 '20 at 20:43
  • 3
    [This question](https://stackoverflow.com/questions/9603003/what-registers-must-be-preserved-by-an-x86-function) has links to all relevant documents. Does it answer your question as well? – fuz Mar 22 '20 at 20:47
  • 2
    Yes, there's a standard calling convention, so the asm ABI follows from the C function signature. That's how compilers know how to pass args. – Peter Cordes Mar 23 '20 at 01:21
  • @fuz thank you that thread does answer my question, I did search before posting but they use different wording for the title. The tag wiki is also pretty helpful. Thanks! – VanillaSnake21 Mar 23 '20 at 02:11

0 Answers0