I don't know what to tell you. The Compiler Manual seems pretty clear about what each of the memory models represent, and the section called "Memory Management" is what mentions the sections referred to as CODE, DATA, UDATA, and KDATA, as well as how the keywords
near and
far play a role in all of this. I strongly recommend you read that section, as well as all the example code they provide. Anything with a calculated 24-bit address (
far) should be easy to obtain the bank -- you just
>> 16 to shift off the lower 16 bits and what you're left with is the bank. Also be sure to read the section titled "Large Programs".
The reason I mentioned
#pragma is because that appears to be how you can explicitly set a bank for certain types of sections (CODE, DATA, and UDATA). There is a short example in the "Heap Functions" area that shows how they're using "magic variables" called
_END_UDATA and so on to obtain addresses of things -- it's these "magic variables" which are what you're effectively looking for. It doesn't matter if you're using inline assembly or C, both methodologies are going to require that you refer to something that the assembler and/or compiler tracks internally -- that's just how it works, as I'm sure you know. But if you wanted to try and use inline assembly, then you should look at the Assembler/Linker Manual, because that goes over all the internal variables the assembler has.
You're probably going to have to spend a very long while playing with this and examining the full output of a listing generation, as well as a full assembly listing, to ensure everything is "correct", especially considering the SNES's memory map -- you need to see exactly what the compiler and/or assembler are generating binary-wise to know if things are correct/what you expect.
WDC's compiler really isn't directed at SNES stuff in general, and the example programs I've seen online of people trying to use it for SNES developer show nothing useful, e.g. very small programs that fit exclusively within bank $00 thus their entire program has that hard-coded into it. Ten bucks if they wrote something >32KBytes in size they'd be asking the same thing you are.
I only know of 3 C compilers for the 65816: WDC's, ORCA/C (solely for the Apple IIGS), and Toshi Morita's LCC (which just generates assembly code intended for use with ORCA/M which is also solely for the Apple IIGS). Your choices are extremely limited. Considering WDC's product (
last I read) cost US$40, then I'd say you should start making some telephone calls to WDC instead of Email.