We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi Ken, I understand that the 8051 has 256 bytes of internal data. Well, after declaring variables and array's, I get the error
*** ERROR 107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 0062H Target not created
GetMACInput(strSrcDest); printf("MAC Address......... "); printf("%02X:", strSrcDest->SrcMAC1 >> 8); printf("%02X:", strSrcDest->SrcMAC1 & 0x00FF); printf("%02X:", strSrcDest->SrcMAC2 >> 8); printf("%02X:", strSrcDest->SrcMAC2 & 0x00FF); printf("%02X:", strSrcDest->SrcMAC3 >> 8); printf("%02X", strSrcDest->SrcMAC3 & 0x00FF); printf("\r\n");
"Am I to understand that I don't necessarily have access to the entire 256 bytes, but less than 256 bytes due to Stack Size/ Nesting and interrupt context saving?" Yes, you can't use all the idata space. The stack needs some of it. ">>...the stack resides in internal RAM too, >>positioned after IDATA up to the end of >>internal RAM" What Dan meant was that the stack starts in idata above your idata variables. "I am curious about Function calls and the space required. Do the nested Functions require Ram Space? Is there a difference between void Func1() and int Func1()?" For every function nesting the return address (two bytes) is pushed onto the stack. Interrupt service routines (sometimes) push considerably more data (PSW, registers etc) onto the stack. Values aren't returned from functions on the stack so there is no difference between int and void in this context. "I'm not exactly sure what interrupt context means. I am using an interrupt" When the ISR is called the 'context' of the uc is saved. The 'context' is the contents of any registers that will be changed in the ISR, so that they can be restored on exit. "I wish the compiler would have complained. The program compiles just fine" It would be very difficult if not impossible for the compiler to calculate worst case stack usage. You'll have to do that yourself! Stefan