??? 11/21/06 13:20 Read: times |
#128351 - you do not want a 'heap' in '51 C, however Responding to: ???'s previous message |
An another question from the naive C-novice: I'd like to use the rest of unused XRAM as a "heap".
You do not want a 'heap' in '51 C, This is something that, while it may be great on a PC, should be avoided in the '51. However I have a case where it is to "get as much for this buffer as possible, whatever that is" and (You will love this) I handle that by having all XDATA in an assembler module referred to by C externs. This gives me the ability to have: StartOfRemainingSpace: ds 0 ; buffer from here to xdata end another advantage of the "XDATA in asm" is that I can have some buffers often viewed in the emulator on 'easy' boundaries. This was not originally designed for the above porposes, but the SILabs chips, when you use external XDATA will, in my configuration, run fatser when using internal XDATA and I had to relocate stuff so the fast stuff used the internal XDATA. YES, before anyone object, I know of the _AT_ command, but 211 _AT_ statements just to avoid having XDATA in an assembler module is ridiculous. This works GREAT with Keil where you can use C style .h files in assembler allowing you to have #define RALPH_SIZE in a .h module and, in your assembler XDATA you can include the .h and have RALPH: ds RALPH_SIZE I do not know to which extent other toolsets support this. Erik |