Nibble-swap Pasm2 code
Has anyone got a smaller solution than this for performing a nibble swap?: $12345678 -> $21436587
splitb val splitw val movbyts val, #%01_00_11_10 mergew val mergeb val
Has anyone got a smaller solution than this for performing a nibble swap?: $12345678 -> $21436587
splitb val splitw val movbyts val, #%01_00_11_10 mergew val mergeb val
Comments
split/merge instructions are circular (5x mergew will bring you back to the same value you started with. splitw moves in the opposite direction. splitb/mergeb are just 2x splitw/mergew), so perhaps
Not tested, may be nonsense Yep, works.
Damn! That's cool! Thanks.