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!
Angelo;
Here are the links to the so called 8051 'Bible'. You will find there are two data areas, one called IDATA and the other called DATA. Each are 128 bytes in the typical 80C51 devices. These areas are further sub-diviede into SFR, REGS, BDATA. The Keil tools often refer to these as the data area (lower case).
I won't talk about the stack area since it's a special case for reentrant code. Look up the memory areas in the links.
Bradford
here are the links to "the bible" Chapter 1 www.semiconductors.philips.com/.../80C51_FAM_ARCH_1.pdf
chapter 2 www.semiconductors.philips.com/.../80C51_FAM_PROG_GUIDE_1.pdf
chapter 3 www.semiconductors.philips.com/.../80C51_FAM_HARDWARE_1.pdf
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.