operand->exp.X_add_number = (short)operand->exp.X_add_number;
do_a_fix_imm (offset, operand, relaxing)     int offset;     struct h8_op *operand;     int relaxing;{  int idx;  int size;  int where;  char *t = operand->mode & IMM ? "#" : "@";  if (operand->exp.X_add_symbol == 0)    {      char *bytes = frag_now->fr_literal + offset;      switch (operand->mode & SIZE)	{	case L_2:	  check_operand (operand, 0x3, t);	  bytes[0] |= (operand->exp.X_add_number) << 4;	  break;	case L_3:	  check_operand (operand, 0x7, t);	  bytes[0] |= (operand->exp.X_add_number) << 4;	  break;	case L_8:	  check_operand (operand, 0xff, t);	  bytes[0] = operand->exp.X_add_number;	  break;	case L_16:	  check_operand (operand, 0xffff, t);	  bytes[0] = operand->exp.X_add_number >> 8;	  bytes[1] = operand->exp.X_add_number >> 0;	  break;	case L_24:	  check_operand (operand, 0xffffff, t);	  bytes[0] = operand->exp.X_add_number >> 16;	  bytes[1] = operand->exp.X_add_number >> 8;	  bytes[2] = operand->exp.X_add_number >> 0;	  break;	case L_32:	  /* This should be done with bfd */	  bytes[0] = operand->exp.X_add_number >> 24;	  bytes[1] = operand->exp.X_add_number >> 16;	  bytes[2] = operand->exp.X_add_number >> 8;	  bytes[3] = operand->exp.X_add_number >> 0;	  break;	}    }  else    {      switch (operand->mode & SIZE)	{	case L_24:	  size = 4;	  where = -1;	  idx = relaxing ? R_MOVLB1 : R_RELLONG;	  break;	default:	  as_bad("Can't work out size of operand.\n");	case L_32:	  size = 4;	  where = 0;	  idx = R_RELLONG;	  break;	case L_16:	  size = 2;	  where = 0;	  idx = relaxing ? R_MOVB1 : R_RELWORD;	  break;	case L_8:	  size = 1;	  where = 0;	  idx = R_RELBYTE;	}      /* Sign extend any expression */      operand->exp.X_add_number = (short)operand->exp.X_add_number;      fix_new_exp (frag_now,		   offset + where,		   size,		   &operand->exp,		   0,		   idx);    }}