I'm porting for a microcontroler which has segmented memory. THe memory is devided into many pages, each page is 16K. And I'm going to use 256 pages for code. But these 256 pages are not continuous in physical memory, so when I want to jump to a function, I have to know what is the segment address of this function, and then set the CSP with this value, and jump to it.
So what I want to know is if I'm in a function, is there any way for me to know what code segments I'm locating in ? If I know this, when I have to jump to another function, I can decide wheather this function is in the same segment with the function that I'm locating in, and then can decide if I have to change the CSP. And when I compile a long long program with so many methods, is there any way for GCC so that it can realize that the code has exceeded 16K and have to use a new segments ? or the user must explicit declare this in the C source program ? If you know any hints or any doccument about this, please show me. THank you very much.