Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created April 14, 2013 19:31
Show Gist options
  • Save aras-p/5383882 to your computer and use it in GitHub Desktop.
Save aras-p/5383882 to your computer and use it in GitHub Desktop.
Sunday coding!
// actual code I've written today
// I was also reading this, which is excellent: http://www.agner.org/optimize/calling_conventions.pdf
*d++=0x48;*d++=0x81;*d++=0xEC;*(int*)d=kArgsSpace+8;d+=4; // sub rsp, kArgsSpace+8
*d++=0x4C;*d++=0x89;*d++=0x44;*d++=0x24;*d++=0x28; // mov [rsp+40], r8
*d++=0x4C;*d++=0x89;*d++=0x4C;*d++=0x24;*d++=0x30; // mov [rsp+48], r9
*d++=0x49;*d++=0x89;*d++=0xD0; // mov r8, rdx
*d++=0x49;*d++=0x89;*d++=0xC9; // mov r9, rcx
*d++=0x48;*d++=0x89;*d++=0xF9; // mov rcx, rdi
*d++=0x48;*d++=0x89;*d++=0xF2; // mov rdx, rsi
// we don't ask "why?"
// we say "why not!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment