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

Address Space Overflow-89C52

Hi,
I have a made a code for testing a hardware board.The code on compilation generates an error code of L107 Address space overflow.After searching through the KEIL forum I came to know that once you define XDATA for all variables (including global variables),this error can be avoided.How to define XDATA and where?Please mail me & thanks in advance.

  • You understand what the word "overflow" means - don't you?

    "once you define XDATA for all variables (including global variables), this error can be avoided"

    That obviously depends on how much XDATA you have - doesn't it?

    "How to define XDATA and where"

    You managed to search the forum - how about also searching the C51 Manuals - it's all in there!

  • I came to know that once you define XDATA for all variables (including global variables),this error can be avoided.

    Hmmmm. Then I wonder why wouldn't the compiler ALWAYS put all variables in XDATA?

    Jon

  • I'm sure that's a rhetorical question - eh, Jon...?

    But, if the OP can't work out the answer, it's time for some basic study on the 8051 architecture:

    Some books: http://www.keil.com/books/8051books.asp
    Some tutorials: http://www.8052.com/tutorial
    Links to the so-called "bible" for the 8051: www.8052.com/.../120112

    And, of course, the Keil C51 Manuals: http://www.keil.com/support/man_c51.htm

  • hi,
    I have put all variables(ie including global variables) as XDATA type.I am using KEIL 9.02 version.The error "Address Space Overflow" definetely goes,but after compiling and fusing the code completely malfunctions.The address in which the variables are stored are not taken by the code as the same way.Pls advice.

  • is there any external RAM on your board?
    the basic '52 dies not have any internal XRAM

    Erik

  • So you are doing trial-and-error development?

    You throw in some new keyword just to see if it makes a difference. When it does (the linker doesn't complain) then you start looking for next trial-and-error change.

    1 - are you sure that you need all your variables?
    2 - are you sure that you need to move all variables to XDATA?
    3 - are you sure that you do have actual memory for the XDATA variables?
    4 - are you sure that you have selected the "best" variables to move to XDATA, since access time and code size does differ?

  • You said that you're "testing" the hardware.
    So how do you know if the malfunction is due to a software error, or a hardware error, or a hardware fault - or some combination?!

    Surely, if you're just starting the stage of "testing" the hardware, you should just be writing a very, very simple piece of software for your first "test"?

    Using XDATA requires that you have XDATA present & working on the board, and correctly configured in the software - have you done that?

    If you don't know how to do that, then you should really be learning that first on some known-good hardware - before moving on to unknown hardware that needs "testing".
    Again, see the Basic Study links that I gave earlier.

    "The address in which the variables are stored are not taken by the code as the same way"

    Sorry - what do you mean by that??