Hello, I am using the medium memory model. In order to deal with a shortage of memory, I am using 'sdata' to store some static variables, and I have declared SDATA to reside in the address range (0x10000 - 0x12000). However, if I call a function that returns a 'long' type and assigned it to the 'sdata' mapped static, it gets the value 0. What am I doing wrong? Thanks, Tamir
That's a silly thing to do. Read the manual: http://www.keil.com/support/man/docs/c166/c166_le_sdata.htm Besides, I cannot understand how declaring variables as sdata can prevent shortage of memory. - mike
I can only second Mike's comment to READ the manual. http://www.keil.com/support/man/docs/c166/c166_ap_dppreg.htm SDATA will use DPP3 which is assigned to "3" (0xC000--0xFFFF).
Mike, thank you. Sometimes blazing criticism puts you on the right path :) I understand my mistake, but just to be 100% clear: Assuming My NDATA region is full, where should I place new data elements (assuming a medium memory model?). I admit as to not being the biggest expert in the world (on the C166), but that did not stop me from embarking on a very ambitious project (in my free time) - an RTOS which seems to be running very well, but now when I add extra functionality I am running out of memory...Hope you can help!
Hi Tamir, I must admit I never used memory models other than SMALL on C166, but I've always thought that the standard way to overcome the limited size of NDATA was to declare some variables as far: http://www.keil.com/support/man/docs/c166/c166_le_memtypes.htm Regards, - mike