1)How C structures get passed to function in assembly. I mean pass by value, not pass by reference. 2)By the way, how callees return structure to its callers? I\'m so sorry for
It depends on the ABI for your system. On x86_64, most systems use SYSV ABI fo AMD64 -- the exception being Microsoft, who use their own non-standard ABI.
On either of those ABIs, this structure will be passed on the stack, which is what is happening in the code -- first s
is constructed in main
's stack frame, then a copy of it is pushed on the stack (the 4 pushq instructions).