Skip to content

Instantly share code, notes, and snippets.

@Alcaro
Created August 26, 2016 12:47
Show Gist options
  • Save Alcaro/4b3c7c12420f9697a926e5a3f0259419 to your computer and use it in GitHub Desktop.
Save Alcaro/4b3c7c12420f9697a926e5a3f0259419 to your computer and use it in GitHub Desktop.
Compiled with https://gcc.godbolt.org/ ARM 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*):
movs r3, #1
str r3, [r1]
movs r3, #3
str r3, [r1]
movs r3, #4
str r3, [r0]
bx lr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment