Problem with putting a function in global memory

Sorry - I already posted a similar message in another section of the forum, but I realized that this is the right forum for this question. If a mod wants to remove my other message, please do.

My environment: XDP512 on simulator, using the banked memory model on CW 4.6.

Basically, I have a function that goes above 12K (code) that I want to put in a global memory allocation in ROM. I used #pragma CODE_SEG __FAR_SEG MY_GLOBAL_SPACE at the beginning of my function (I do not have a header file where these are defined), and at the end of the function I put #pragma CODE_SEG DEFAULT.

The right approach is obviously not to have such huge function-monsters.

It is possible to use (part of) the two unpaged areas together with a paged one as single flat area with almost 48k. The truth here is that I never tried such a setup, just given my knowledge of the architecture it should work. No guarantee that there are no special things to handle, and no problems with debugging and other details .