Dear all, I have one question about the _DATA_GROUP_ in DATA MEMORY in m51 file. The current DATA MEMORY is as follows:
REG 0000H 0008H ABSOLUTE "REG BANK 0" DATA 0008H 000DH UNIT ?DT?A DATA 0015H 0008H UNIT ?DT?B IDATA 001DH 0001H UNIT _IDATA_GROUP_ 001EH 0002H *** GAP *** DATA 0020H 0001H BIT_ADDR ?BA?A BIT 0021H.0 0009H.5 UNIT ?BI?A BIT 002AH.5 0000H.3 UNIT _BIT_GROUP_ DATA 002BH 0055H UNIT _DATA_GROUP_ IDATA 0080H 0060H UNIT ?ID?A IDATA 00E0H 0001H UNIT ?STACK
_DATA_GROUP_ now is 55h bytes. But original size is 4Bh bytes before code merge.
The bigger _DATA_GROUP_ causes: 1. ?ID?A was put back and thus variables' offset was changed 2. The space for STACK was getting smaller...
I want to know how to downsize _DATA_GROUP_ and thus ?ID?A and ?STACK are not influenced ?
Could you point-out some detailed comments ?
Thanks in advance...
* I have tried to use some global variables to replace the local variables BUT _DATA_GROUP_ is still 55h in length...
Whether they are global or local has no effect on where they are stored - if you want them stored in a particular memory space, it is up to you to specify that!
See: http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm
Actually I have to merge code on the premise that the _DATA_GROUP should be the same as before(here "the same" means: the same size and the same offset...)
Anyway I found one way to solve this by: 1. try to locate "which leg of the main program uses the most local memory space" 2. use idata or xdata variables to replace the original local variables
Thanks !