Shorty – 680×0 with x86 data

So those pesky Intel chips put the least significant byte first, and your super efficient 680×0 code needs to translate? Easy! Rotate, swap, rotate.

This takes advantage that the 680×0 32-bit registers can be operated on as if they are 16-bit, at least with certain instructions, using the “.w” (word) suffix. Suppose we start with hex 44332211

rol.w #8,d0 ; rotate the lowest 16-bits by 8 – 44331122

swap d0 ; swap lowest and highest 16-bits – 11224433

rol.w #8,d0 ; again rotate the lowest 16-bits – 11223344

 

0 comments