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

Can't compile...

I written this code and it compiles just fine. However, when I tried to include <stdio.h> library to use with my hyperterminal, it says that it compiled, but can not link. Here is the message that it gave me...

ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: _DATA_GROUP_
LENGTH: 0070H

My memory model is "Small: variables in DATA". When I changed it to compact or large, my program will compile and link, but it behaves differently when I put program it to the Philips 89C664..

thanks
Tommy

Parents
  • The REAL problem here is that in SMALL memory model, you are limited to a total of 128 bytes of variable space, period.

    In large model, you are limited to 64K bytes of variables space.

    So, the following program:

    unsigned char array [121];
    
    void main (void)
    {
    }
    

    will compile and link just fine in LARGE model but not in SMALL model (the register bank of R0-R7 takes up the first 8 bytes of memory).

    You should probably take a look at a databook to get a better understanding of the architecture of the 8051.

    Jon

Reply
  • The REAL problem here is that in SMALL memory model, you are limited to a total of 128 bytes of variable space, period.

    In large model, you are limited to 64K bytes of variables space.

    So, the following program:

    unsigned char array [121];
    
    void main (void)
    {
    }
    

    will compile and link just fine in LARGE model but not in SMALL model (the register bank of R0-R7 takes up the first 8 bytes of memory).

    You should probably take a look at a databook to get a better understanding of the architecture of the 8051.

    Jon

Children
No data