Skip to content

Instantly share code, notes, and snippets.

@Alcaro
Created August 26, 2016 12:49
Show Gist options
  • Save Alcaro/ee2ea273ceba9d9db1cb442f69b336af to your computer and use it in GitHub Desktop.
Save Alcaro/ee2ea273ceba9d9db1cb442f69b336af to your computer and use it in GitHub Desktop.
Compiled with https://gcc.godbolt.org/ x86-64 gcc 4.8.2, flags -Os
void q(int* a, volatile int* b)
{
*a=0;
*b=1;
*a=2;
*b=3;
*a=4;
}
q(int*, int volatile*):
mov DWORD PTR [rsi], 1
mov DWORD PTR [rsi], 3
mov DWORD PTR [rdi], 4
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment