
#define SaveId(cmdId,count) \
   count = 0;\
   outputStream[count] = (U8)cmdId;\
    count++

#define SaveVar(data,count,width) \
    outputStream[count] = width;\
    count++;\
   memcpy(&outputStream[count],&data,width);\
    count += width

#define SaveBuff(buff,count,dataLen) \
    outputStream[count] = dataLen;\
    count++;\
    memcpy(&outputStream[count],buff,dataLen);\
    count += dataLen

#define HighWord(x)      ((U16)((U32)(x) >> 16))
#define LowWord(x)       ((U16)(x))
#define HighByte(x)      ((U8)((U16)(x) >> 8))
#define LowByte(x)       ((U8)(x))
#define LinearToPhysical(x)   ((U32)HighWord(x) << 4) + LowWord(x)
#define PhysicalToLinear(x)   ((U32)HighWord(x) << 12) + LowWord(x)
