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

Memory class question

I am using a Temic 80251 which gives me 1K on board RAM. Is there any
way that I can tell the compiler that the IDATA class is bigger than 256 bytes..
because I get an error from the compiler that I have exceeded capacity.
Or should I just use the edata class and just watch that I don't allocate
above the 1K limit???

Any suggestions appreciated.

Thank, Jim

Parents
  • The 1K of internal memory is not idata. idata is the same as the standard 8051 definition. Outside of the 1K internal, access is through the edata segment.

    You can access the internal 1K segment by defining it as xdata, and providing a data range in the linker.

    We put the following defines in a model.h, and include it in all source. This allows us to select which physical memory segment we want to place the data into.

            #define HUGE    huge        /* 16 Meg indirect addressing, full access */
            #define FAR     far         /* 16 Meg indirect addressing, in page */
            #define NEAR    near        /* 64k direct and indirect addressing */
            #define DATA    near        /* On-chip data */
            #define XDATA   near        /* was far  */
            #define FXDATA  xdata       /*  */
            #define PDATA               /* Paged xdata */
            #define CODE    far         /*  */
            #define IDATA   idata       /*  */
            #define BDATA   bdata       /* Bit addressable memory */
            #define EBDATA  ebdata      /* Extended bit addressable memory */
            #define SBIT    sbit
            #define BIT     bit
    
    

    As an example we would have:
    char  XDATA  value1;     // this goes in edata (near)
    char  FXDATA value2;     // this goes in 1K segment (xdata)
    
    

    The linker must be told where the xdata & edata segments are located.

    this is done using the class command :
    CL (XDATA (100h-41fh),                          &
        EDATA (8000h-0ffffh),hdata(8000h-0ffffh),   &
        ECODE  (0fe0000h-0feffffh),                 &
        HCONST (0fe0000h-0feffffh),                 &
        ECODE  (0ff2080h-0ffffffh),                 &
        HCONST (0ff2080h-0ffffffh) )                &
    


    When the code is compiled and linked, the variables will be placed in the respective memory spaces. By changing the defines and modifying the linker classes, you can assign any variable to any data space until you run out of memory. The linker file assignments above are what we use in our application. You have to define yours as needed.

Reply
  • The 1K of internal memory is not idata. idata is the same as the standard 8051 definition. Outside of the 1K internal, access is through the edata segment.

    You can access the internal 1K segment by defining it as xdata, and providing a data range in the linker.

    We put the following defines in a model.h, and include it in all source. This allows us to select which physical memory segment we want to place the data into.

            #define HUGE    huge        /* 16 Meg indirect addressing, full access */
            #define FAR     far         /* 16 Meg indirect addressing, in page */
            #define NEAR    near        /* 64k direct and indirect addressing */
            #define DATA    near        /* On-chip data */
            #define XDATA   near        /* was far  */
            #define FXDATA  xdata       /*  */
            #define PDATA               /* Paged xdata */
            #define CODE    far         /*  */
            #define IDATA   idata       /*  */
            #define BDATA   bdata       /* Bit addressable memory */
            #define EBDATA  ebdata      /* Extended bit addressable memory */
            #define SBIT    sbit
            #define BIT     bit
    
    

    As an example we would have:
    char  XDATA  value1;     // this goes in edata (near)
    char  FXDATA value2;     // this goes in 1K segment (xdata)
    
    

    The linker must be told where the xdata & edata segments are located.

    this is done using the class command :
    CL (XDATA (100h-41fh),                          &
        EDATA (8000h-0ffffh),hdata(8000h-0ffffh),   &
        ECODE  (0fe0000h-0feffffh),                 &
        HCONST (0fe0000h-0feffffh),                 &
        ECODE  (0ff2080h-0ffffffh),                 &
        HCONST (0ff2080h-0ffffffh) )                &
    


    When the code is compiled and linked, the variables will be placed in the respective memory spaces. By changing the defines and modifying the linker classes, you can assign any variable to any data space until you run out of memory. The linker file assignments above are what we use in our application. You have to define yours as needed.

Children