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.
I am having a bit of a problem with constant arrays on the ds80c400 i.e. char y[] = {1,2,3,4}; Note: the ds80c400 has a 16M contiguous memory map. example 1: in the following code the array is placed in segment CONST.
#include <stdio.h> char foo (int x) { char y[] = { 1,2,3,4}; return(y[x]); }
#include <stdio.h> char foo (int x) { char y[] = { 1,2,3,4}; printf("1234%d",1); return(y[x]); }
It's very interesting problem, I cannot find the solution. the idea to create userclass #pragma UCL(CODE =my) and locate it in the upper half of memory CODE (C:0X0-C:0XFFFF), ECODE (C:0X0-C:0X1FFFF),CODE_MY (C:0x10000-C:0x1FFFF) does not works! Does Dallas has the possibility to read constants with MOVC from upper memory?
yes... why?
Did you enable VARBANKING? Are you using the XBANKING.A51 file? You may have to modify the file in order to support the HCONST the way you want to. You can read more at: http://www.keil.com/support/man/docs/c51/c51_ap_xbanking.htm
first VARBANKING and XBANKING.A51 are not required for the ds80c400 as it is not a "classic 8051 device" but even supposing the the XBANKING.A51 was re-written it would not stop the compiler from placing the data in the const or hconst segments... this would have to be done on the compiler for the source file in question.
sory const or data segments