I am trying to learn assembler using Masm64 in VS2019. I have progressed quite wel, until I reached the current stage of wanting to call windows functions from my asm files. My problem is I cannot find any for of listing of the registers that need setting up before calling say printf() and all the other functions I am used to using in C , C++ and c# .
As an example, I tried to use gets, what should be a a simple call, but it crashes immediately on return from the call with "Access violation writing location 0x00000000FFFFFFFF". I already push and pop the normal registers before starting, and have tried using sub rsp, 40h, and mov rcx, offset buffer but it continues ot crash. Clearly I need to set some register(s) but have spent 3 days searching with google to find some documentation, but with no luck whatsoever, I just get the same old YouTube videos and StackOverflow results, none of which give me the answer I need.
Where can I find the relevant Windows (10) documentation to let me call these functions form my asm code ??.