Skip to content

Instantly share code, notes, and snippets.

@c0d3inj3cT
Created October 4, 2014 19:08
Show Gist options
  • Save c0d3inj3cT/fc5e61467dc4a65d2eb1 to your computer and use it in GitHub Desktop.
Save c0d3inj3cT/fc5e61467dc4a65d2eb1 to your computer and use it in GitHub Desktop.
An example program to understand the Calling Convention used for 64-bit Binaries.
#include <stdio.h>
int sum(int, int, int, int);
int main(int argc, char **argv)
{
int result = 0;
result = sum(1,2,3,4);
printf("The sum is: %d\n", result);
return 0;
}
int sum(int a, int b, int c, int d)
{
int e = 0;
e = a + b + c + d;
return e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment