void us_encode(val, buf)
unsigned short int val;
char *buf;
{
  buf[0] = (val >> 8) & 0xFF;           /* MSB */
  buf[1] = val & 0xFF;                  /* LSB */
}


unsigned short int us_decode(buf)
char *buf;
{
  return ((( (unsigned) buf[0] ) & 0xFF) << 8) |
          (( (unsigned) buf[1] ) & 0xFF);
}
