Quantcast
Channel: Break an integer into even- and odd-indexed bits - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 15

Answer by corvus_192 for Break an integer into even- and odd-indexed bits

$
0
0

x86 machine code, 18 bytes

080497c8 <f>: 80497c8:       be 55 55 55 55          mov    esi,0x55555555 80497cd:       c4 e2 7a f5 d6          pext   edx,eax,esi 80497d2:       f7 d6                   not    esi 80497d4:       c4 e2 7a f5 c6          pext   eax,eax,esi 80497d9:       c3                      ret

Input is in eax, output in edx:eax.

Try it online!


Viewing all articles
Browse latest Browse all 15

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>