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.
Using the SMALL memory model of the C167, I have forced a function to be "far". The compiler generates the segmented call to this function (CALLS) but the linker/locater tries to allocate the code into the NCODE class instead of the FCODE class. The total program size overlaps the maximum allowed size of the NCODE class (64k) and the linker/locater generates the following message: ERROR L116: SIZE OF CGROUP EXCEEDS 64K GROUP: NCODE (1) But from the Keil C166 User Guide: The SMALL model uses the segmented CPU mode. Variables are located in the near area and function calls generate near calls. This gives the same efficient code as the TINY model, but code and data are not limited to 64KB. The user can locate variables and functions with the far,huge, and xhuge memory types. These memory types enable full use of the 166/167 address capabilities. Could anyone help me to solve the problem? Thank you very much.
Hi Luigi, I think that using the far keyword with a function in small memory model doesn't force it to go to the FCODE class. It only ensures that a far call (CALLS) will be used to call it. It sort of makes sense, since C166 compiler allocates sections on a file-by-file basis, not on a function-by-function basis. So if you want to put your function in the FCODE class, you should define it in a separate source file and force all the functions from that file to go to the FCODE class by using
#pragma RENAMECLASS (NCODE=FCODE)
Hi Mike, I first want to thank you for the suggestion you gave me. I put the line
#pragma SRC
#pragma ASM / ENDASM
Hi Luigi, I think I've found a way around. Still using
FCODE (0x10000-0x30000)