Post Go back to editing

unsigned char value more than 255?

Category: Software

Hi 

I am using 21489 and find an interesting thing as follows:

I defined "unsigned char abc = 456;" and used CCES to debug. I checked abc value in the window and i can find it is 456.

I can not understand why abc can be more than 255? I thought i defined a unsigned char type value and it should be 0-255.

Thanks.

Parents
  • Hi,

    Please note that, unsigned char type value can be range between 0 - 4294967295 for the ADSP-21xxx Processors with no support for byte-addressing, or when using the -char-size-32 switch.

    You can refer the "Table 1. Representations of Integer Types on the ADSP-21xxx and ADSP-SCxxx Processors (with no support for byte-addressing, or when using the -char-size-32 switch)" in the below CCES help path for more details.

    CrossCore® Embedded Studio <version> > SHARC® Development Tools Documentation > C/C++ Compiler Manual for SHARC® Processors > Compiler > Implementation Defined Behavior > ISO/IEC 9899:1990 C Standard (C89 Mode) > G3.5 Integers

    Regards,
    Santhakumari.K

Reply
  • Hi,

    Please note that, unsigned char type value can be range between 0 - 4294967295 for the ADSP-21xxx Processors with no support for byte-addressing, or when using the -char-size-32 switch.

    You can refer the "Table 1. Representations of Integer Types on the ADSP-21xxx and ADSP-SCxxx Processors (with no support for byte-addressing, or when using the -char-size-32 switch)" in the below CCES help path for more details.

    CrossCore® Embedded Studio <version> > SHARC® Development Tools Documentation > C/C++ Compiler Manual for SHARC® Processors > Compiler > Implementation Defined Behavior > ISO/IEC 9899:1990 C Standard (C89 Mode) > G3.5 Integers

    Regards,
    Santhakumari.K

Children