/


data_len_temp = data_len;


temp_02 = data_len_temp;
//temp_02 = data_len_temp & 0x0f;
temp_02 = temp_02 << 4;
temp = id;
temp = temp | temp_02;
//temp = temp | id;
// temp_04 = temp_05 | temp_03;
// temp = temp_04;

/*P0パリティチェック計算開始*/

math_pari0[0] = temp; //ID0
math_pari0[1] = temp >> 1; //ID1
math_pari0[2] = temp >> 2; //ID2
math_pari0[3] = temp >> 4; //ID4

//temp_02 = math_pari0[0] ^ math_pari0[1] ^ math_pari0[2] ^ math_pari0[3];



temp_02 = math_pari0[0];
if((math_pari0[0] & 0x01) == (math_pari0[1]) & 0x01)temp_02 = ~temp_02;
if((math_pari0[1] & 0x01) == (math_pari0[2]) & 0x01)temp_02 = ~temp_02;
if((math_pari0[2] & 0x01) == (math_pari0[3]) & 0x01)temp_02 = ~temp_02;

//temp_02 = math_pari0[0];
//temp_02 = temp_02 ^ math_pari0[1];
//temp_02 = temp_02 ^ math_pari0[2];
//temp_02 = temp_02 ^ math_pari0[3];


//temp_03 = math_pari0[2] ^ math_pari0[3];
//temp_04 = temp_02 ^ temp_03;
//pari0 = temp_04 & 0x01;
pari0 = temp_02 & 0x01;


/*P0パリティチェック計算終了*/


/*P1パリティチェック計算開始*/
math_pari1[0] = temp >> 1; //ID1
math_pari1[1] = temp >> 3; //ID3
math_pari1[2] = temp >> 4; //ID4
math_pari1[3] = temp >> 5; //ID5

//temp_02 = math_pari1[0] ^ math_pari1[1] ^ math_pari1[2] ^ math_pari1[3];

temp_02 = math_pari1[0];
if((math_pari1[0] & 0x01) == (math_pari1[1]) & 0x01)temp_02 = ~temp_02;
if((math_pari1[1] & 0x01) == (math_pari1[2]) & 0x01)temp_02 = ~temp_02;
if((math_pari1[2] & 0x01) == (math_pari1[3]) & 0x01)temp_02 = ~temp_02;


//temp_02 = temp_02 ^ math_pari1[1];
//temp_02 = temp_02 ^ math_pari1[2];
//temp_02 = temp_02 ^ math_pari1[3];
//temp_03 = math_pari1[2] ^ math_pari1[3];;
//temp_04 = temp_02 ^ temp_03;
pari1 = (~temp_02 & 0x01);
/*P1パリティチェック計算終了*/


// pari0 = (temp & 0x01) ^ ((temp >> 1) & 0x01) ^ ((temp >> 2) & 0x01) ^ ((temp >> 4) & 0x01);
// pari1 = ~((temp >> 1) & 0x01) ^ ((temp >> 3) & 0x01) ^ ((temp >> 4) & 0x01) ^ ((temp >> 5) & 0x01);


/*identifier fieldの作成*/

temp = temp | (pari0 << 7);
temp = temp | (pari1 << 8);
/*identifier fieldの作成終了*/



// temp = temp | (pari0 << 7);
// temp = temp | (pari1 << 8);

// temp_lo = temp_lo | (pari0 << 7) & 0x40
// temp_lo = temp_lo | (pari1 << 8) & 0x80);

return temp;
}