Skip to content

Instantly share code, notes, and snippets.

@danlark1
Created January 11, 2020 22:16
Show Gist options
  • Save danlark1/84a6fde93cd8658bda2daf86d34734f4 to your computer and use it in GitHub Desktop.
Save danlark1/84a6fde93cd8658bda2daf86d34734f4 to your computer and use it in GitHub Desktop.
movq (%rdi), %rax # load from the input
xorl %ecx, %ecx
movabsq $-6076574518398440533, %rdx # imm = 0xABABABABABABABAB
cmpq %rdx, %rax # Check with a garbage value
cmovel %ecx, %eax # return it in %rax
retq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment