Actually, long, long ago in cross development we decided it made most sense to put 
byte swapping on the Intel machines, simply
because Intel has a byte swap command and Mototola doesn't.  You can byte swap a 
32-bit word on an X86 in 1 cycle.

Daniel Morais wrote:

> Hi again !
>
> Mardi 20 Mars 2001 23:41, Daniel Morais a écrit:
>
> > Swap16 :
> >
> > xchg al, ah
> >
> > Swap32 :
> >
> > xchg al, ah
> > rol eax , 16
> > xchg al, ah
>
> Sorry to reply to myself, but by looking to my Intel code, I was wondering
> how to do the same in Motorola code, and I find a way which is the complete
> opposite :
>
> Swap16 :
>
> rol.w #8, d0
>
> Swap32 :
>
> rol.w #8, d0
> swap d0
> rol.w #8, d0
>
> I'm not sure it is the best way ( I'm not a 68K specialist ), but I find it
> so funny that I wanted to show it ! :-)
>
> --
> Daniel Morais
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to