There are two questions.
I just want to know the max code size SDCC supported. It must be the size of the file hex. The following is my memory map from SDCC. The max size is 65536, Is there any options that can get rid of this limitation.
"ERROR: Couldn't get 147 bytes allocated in internal RAM for area DSEG."
In fact, the whole RAM is 256 Bytes. how could this happen? why does the SP start from 0x72?
Internal RAM layout:
0 1 2 3 4 5 6 7 8 9 A B C D E F
0-3:Reg Banks, T:Bit regs, a-z:Data, B:Bits, Q:Overlay, I:iData, S:Stack, A:Absolute
ERROR: Couldn't get 147 bytes allocated in internal RAM for area DSEG.
Stack starts at: 0x72 (sp set to 0x71) with 142 bytes available.
Name Start End Size Max
---------------- -------- -------- -------- --------
PAGED EXT. RAM 0 256
EXTERNAL RAM 0x0000 0x001f 32 65536
ROM/EPROM/FLASH 0x0000 0x101cb 65996 65536
*** ERROR: Insufficient ROM/EPROM/FLASH memory.
1) The max code memory SDCC can easily address is 64 kB. There are cumbersome ways to use more.
2) No 8051 has more than 128 bytes data memory. You will have to move something to idata/pdata/xdata.
Any body here?
Sorry for the reply I posted twice. There are something wrong with my IE.
Thanks for your attention,
(1)What's the cumbersome ways? It's very kind of you to give me some clues on this.
(2)you'r right, there're only 128 bytes data memory. Actually, Only four globle varibles can be set to idata/xdata/pdata areas in my project. I believe the other needed data memory is required for the overlaying. Well how can I do some changes in this situation? Some guys suggested that doing the overlay manually, I don't think It's the best way.
(3)Do code banking supported by SDCC?
1,3) Cumbersome is bank switching. You will have to declare some functions as "banked" and you will have to put the objects in named code segments using a pragma or command line switch (codeseg). Then you can tell the linker to put those named segments at addresses above 0x10000.
2) Which options are you using? Sometimes --stack-auto gives better results than --model-medium or --model-large when it comes to memory usage.
Log in to post a comment.