#418 Problem with internal RAM access

closed
nobody
5
2002-12-05
2002-12-05
Carsten Pahl
No

Hi there,
my goal is to use the Philips 89C51RC2 with 512 Byte
internal RAM. Is there a chance to tell sdcc that there
are 512 Byte of internal memory ?
Additionally there's a problem if I overload the data
memory range with too many too large variables. SDCC
then makes a DIRECT access to the memory address range
above (idata); this results in a wasted content of the
registers, which will be overwritten. Keil for example
automatically transfers the supernumerary data memory
variables into idata memory (with indirect access). Is
there a chance that sdcc gives me a warning if I
overload the memory or that SDCC does the same like Keil?

With best regards

Carsten

Discussion

  • Logged In: YES
    user_id=603650

    Hi,

    The extra memory in the 89C51RC2 is actually builtin external
    memory. From the data sheet:

    "4. The 256/768-bytes expanded RAM (ERAM, 00H
    FFH/2FFH)are indirectly accessed by move external
    instruction, MOVX, and with the EXTRAM bit cleared, see
    Figure 27."

    So just put "xdata" in front of your variables when you declare
    them. Also the latest version of SDCC (2.3.2 as for 04 Dec
    2002) will warn if you run out of memory both in data or
    idata, or if there is an overlap. You can download version
    2.3.2 from:

    http://sdcc.sourceforge.net/snapshots/

    You can check the memory usage either from the map or
    mem files generated by the linker.

    Jesus

     
    • status: open --> closed