This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stack overflow question.

Hi,

I need to write a testprogram for some old PCB with a AT89C51CC03 uC. It contains 256 bytes of iData. I do not have some debugger. In the map file it shows 0x70 is the last declared variable. So stackpointer will point to 0x71 or 0x72. I wrote a function that fills the unused stack memory up to 0xFF with value 0x55 and then execute a second function that searches down for the first non-0x55 byte address as being the highest stackpointer address being used ever. The fill function is executed in main() as the first executed function. The highest stackpointer address is shown by 8 leds. I see the stack growing up to around 0x83 and at that point the program hangs. The stackpointer holding address itself is at 0x81.

My questions are:
- is the stackpointer holding address (SFR) part of the iData?
- why does my program crash witch stackpointer around address 0x80 as in the reference manual it says having 256 bytes address space from 0x00 up to 0xff

Thanks

Henk