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, Does anyone know how to create a user class for the HCONST memory type using the c251 compiler similar to creating one for the ECODE memory type: #pragma userclass (ucode = foo). The above would create the user class ECODE_FOO I want to do this: #pragma userclass (hconst = foo) to create the user class HCONST_FOO so I can position the constants in the file foo.c in an absolute memory address range at link time. However, hconst does not seem to be a memory type that the C251 compiler can assign a user class to. Any help would be greatly appreciated. Thanks, Trevor.
Here is how I did it with C251 v2.14. 1. Use X-Tiny memory model, constants are put to NCONST memory class. 2. In program module put desired constants to HCONST memory class by declaring them as following example: static uchar const far SOP_String[] = {0x15,0x08,0x08,0x00,0x00,0x30,0x00}; 3. You can access this constants from the linker L251 as ?HC?MODULE (where MODULE is the name of your program module) and locate it to an absolute address.