This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to Split the 16bit word?

Hi! i want to spilt the 16bit word into two 8bit words,
is there any key words for it. i use the p89V51 mcu and c language Cx51 keil compiler ver3.

regards,
K.T.Venkatesan.

Parents Reply Children
  • Right-shifting an int having a negative value is implementation-defined, whereas div/mod are not.

    It would be nice if that were true, but actually this only holds if your compiler claims compliance to C99.

    In the original standardized version of the language, C90, which still has to be considered the default assumption for portable code, division of negative numbers is implementation-defined, too. (-1)/2 can yield either -1 or 0; (-1)%2 can be either -1 or 1.