i have a project where ram has become a precious resource. i have reconfigured my code so that i should be allowing the linker to overlay as much as possible (all code on the idle loop). my problem is how do i determine how much ram is used? ie how good a job has the overlay mechanism done? i can see what the linker says is 'overlayable' but is there an easy way to determine how much ram i currently have available? thanks! robert
The linker tells you total usage: Program Size: data=106.7 xdata=27223 const=983 code=72159 The map file has more details, of course.
drew, i guess that my problem comes from the underlying hardware design that i am using. i have a small xdata ram with lots of h/w registers, which are mapped onto the xdata address bus. this means that all my h/w registers count in the xdata usage report that you identified. to sort my problem out i've just created an every bigger array until the compilation failed. not elegent, but it works. thanks, robert
So you declare your registers as variables _at_ an address? Or with XBYTE, etc.? So that the registers count as variables? I usually declare registers as addresses (or pointers to structs), and use the linker to reserve the address space occupied by memory so that regular declarations cannot go there. (This is easiest if your registers live on one end of the xdata memory and you can just declare a smaller xdata size. But there's also a reserve directive that you can use.) Wouldn't you have a constant number of registers, and thus could subtract a constant amount from the linker report? This might be most human-readable if you pad the registers with declarations for unoccupied addresses out to a multiple of 100 or 1000.