/* --------------------------------------------------------------------------
Name:       byteswap.c
Function:	Code snippet to swap two bytes in an int
Versions:
   1.0   1/27/2007   L Simone.  Created.  File compiled for debugging mode.
			Step through the code line by line and watch the 2-byte value of
			fred (starting at RAM location 0x0200) change.  The variables are
			declared globally so that they show up in RAM; otherwise registers
			are used.  These would normally be local variables within main().
----------------------------------------------------------------------------- */
int   fred = 0x55AA;		/* 2-byte value to show byte swapping	   */
int   temp = 0;				/* Temporary variable used in swap process */

void main( void )
{
  temp = fred & 0x00FF;
  fred >>= 8;
  temp <<= 8;
  fred |= temp;
}

