#ifndef XADMASTER_CONVERTE_C
#define XADMASTER_CONVERTE_C

/* Programmheader

	Name:		ConvertE.c
	Main:		xadmaster
	Versionstring:	$VER: ConvertE.c 1.0 (22.08.1999)
	Author:		SDI
	Distribution:	Freeware
	Description:	endian conversion

 1.0   22.08.99 : first version
*/

/* These are Endian Conversion routines for Motorola (big endian) computers.
   For Intel machines, the EndConvM and EndConvI defines must be switched. The
   EndGet defines stay valid!
   For machines with more than 32 Bit, the EndConvX32 routine must be fixed.
*/

#define EndGetM32(a)	((((a)[0])<<24)|(((a)[1])<<16)|(((a)[2])<<8)|((a)[3]))
#define EndGetM16(a)	((((a)[0])<<8)|((a)[1]))
#define EndGetI32(a)	((((a)[3])<<24)|(((a)[2])<<16)|(((a)[1])<<8)|((a)[0]))
#define EndGetI16(a)	((((a)[1])<<8)|((a)[0]))

#define EndConvM32(a)	(a)
#define EndConvM16(a)	(a)
#define EndConvI32(a)	(((a)>>24)|(((a)>>8)&0xFF00)|(((a)<<8)&0xFF0000)|((a)<<24))
#define EndConvI16(a)	((UWORD)(((a)>>8)|((a)<<8)))

#define EndSetM32(a)	
#define EndSetM16(a)	
#define EndSetI32(a)	((a) = EndConvI32(a))
#define EndSetI16(a)	((a) = EndConvI16(a))

#endif /* XADASTER_CONVERTE_C */
