Skip to content

Instantly share code, notes, and snippets.

@tomtor
Last active Oct 13, 2017
Embed
What would you like to do?
Esp32 ULP macro function
/* r0 = r0 xor r2, spills r1 */
.macro xor
/*
See https://stackoverflow.com/a/5377173
int bitwise_XOR(int a, int b)
{
return (a + b) - (a & b) - (a & b);
}
*/
and r1,r0,r2
add r0,r0,r2
sub r0,r0,r1
sub r0,r0,r1
.endm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment