I have wrote a c program that uses the WINAPI library (specifically WSA - Sockets) and instead of compiling the source code asked the compiler to emit assembly source instead to study how it works on the lower level.
When coming across this line below I noticed in the assembly that there is no reference to the first argument of my WINAPI function.The function MAKEWORD in WSAStartup.
What is really happening here? There is no references in my assembly code to MAKEWORD but a hint of push 514.
; source code : if (WSAStartup(MAKEWORD(2,2),&wsa) != 0)
lea eax, DWORD PTR _wsa$[ebp] ;_wsa$ is second arg
push eax
push 514 ; 00000202H ???
call DWORD PTR __imp__WSAStartup@8
test eax, eax
je SHORT $LN4@main
Note: The WSAStartup function initiates use of the Winsock DLL by a process.
I can provide more info if needed