Hi all Here is some code char prev_ch; unsigned int chksum_read; chksum_read += (WORD)prev_ch*256; chksum_read += (unsigned int)prev_ch<<8; if prev_ch has a value of 0xDB after one of of the two above statments cheksum_read is 0xDA00 instead of 0xDB00. Can anyone explain where I am going wrong?
prev_ch is a unsigned char not char. word is unsigned int prev_ch is 0 before calculation. this is a strange one?
Could you perhaps show the real code that you have. That would make it a lot easier than talking in circles. Jon