C51 Compiler, 8051 Utilities manuals' examples syntax for 'code' conflict

User's guide, 01.97, C compiler C51 on page 63 'explicitly defined memory types' recommends a syntax.

The Utilities guide, 04.95, page 119, has a different syntax in files c_mess0.c, c_mess1.c.

the utilities guide contradicts the recommendation in the user's guide.

Yet the 'preferred' method in the C51 compiler will NOT work. You must use the 'obsolete' method of the Utilities guide.

(1) Please explain.

(2) What is correct syntax for:
const unsigned char code *MyArray[NumberFruits] = {"apple,"banana","cherry"};

Parents
  • You can obtain a free CD from Keil, which includes all the manuals in PDF.

    My CD is dated 09.2000 and has C51 User's Guide 03.2000 and Assembler/Utilities Guide 07.2000 - so your manauals would seem to be way out of date!


    With the mspace qualifiers (code, xdata, etc), you can specify both where the pointer is located, and the mspace to which it points; eg:

    A definition of the form

    int code *var
    is a pointer to an int located in code memory;

    A definition of the form
    code int code *var
    is a pointer located in code memort which points to an int located in code memory.

Reply
  • You can obtain a free CD from Keil, which includes all the manuals in PDF.

    My CD is dated 09.2000 and has C51 User's Guide 03.2000 and Assembler/Utilities Guide 07.2000 - so your manauals would seem to be way out of date!


    With the mspace qualifiers (code, xdata, etc), you can specify both where the pointer is located, and the mspace to which it points; eg:

    A definition of the form

    int code *var
    is a pointer to an int located in code memory;

    A definition of the form
    code int code *var
    is a pointer located in code memort which points to an int located in code memory.

Children
More questions in this forum