Re: [Algorithms] Byte Swapping
Brought to you by:
vexxed72
From: Aaron D. <ri...@ho...> - 2000-07-18 01:58:58
|
I'm assuming you're not after portability here. Off the top of my head you could use an assembler snippet like below. Its in x86. I'm not sure if there is a mac equiv of the xchg instruction but if thats not supported its 3 xors for each. The code below doesn't rely on bswap. mov ebx,eax shr ebx,16 xchg al,ah xchg bl,bh shl eax,16 or eax,ebx -----Original Message----- From: Conor Stokes <cs...@tp...> To: gda...@li... <gda...@li...> Date: Tuesday, 18 July 2000 11:19 Subject: Re: [Algorithms] Byte Swapping > >> Errr............ you'd better use the BSWAP instruction........ same >result >> with one line of assembly............ >> >BSWAP is an x86 instruction :) Not much good if you wanna swap bytes on the >Mac. > >Possibly there is a Mac equivelent, but I think it is RISC practice to avoid >such instructions. > >Conor Stokes > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |