I've been working on a project in KEIL uVision3 for some time now, and recently noticed that when compiled, my program size is displayed as follows:
Program Size: Data=164.0 xdata=589 code=8279
I remember reading that the data memory type can only have a maximum of 128 bytes. So my question is, what units are the above values in? Is that 164.0 bits or bytes? I am getting no compiler warnings and my program DOES run fine when loaded onto the processor, but I'm wondering if there might be an underlying issue that perhaps just hasn't manifested yet.
I've looked around for the answer to this and haven't been successful, so sorry if this is a dumb/stupid question.
Thanks!
There is 256 bytes of data. The lower 128 butes are directly addressable. The upper 128 bytes give you the Registers if directly addressed. All 256 bytes are all addressable via indirection.
Note that Keil use DATA to mean specifically the 128 bytes of directly-addressable RAM, and IDATA to refer to indirectly-addressing the whole 256.
http://www.keil.com/support/man/docs/c51/c51_le_intdatamem.htm
"what units are the ... values in?"
See: http://www.keil.com/support/docs/2204.htm
The place to look for information about the generated code is the MAP file:
http://www.keil.com/support/man/docs/bl51/bl51_ln_mapfile.htm
http://www.keil.com/support/docs/1676.htm
Thank you very much. Learned a great deal and was able to tweak my code and reduce its size by half and improve its speed.
Correct variable sizes and variable placements can make a huge difference in program size with the 8051 architecture.