LANGUAGE
Compilation Unit
-Ccx
None
None
None
None
This option allows Cosmic style @near, @far and @tiny space modifiers as well as @interruptin your C code. The -ANSI option must be switched off. It is not necessary to remove the Cosmic space modifiers from your application code. There is no need to place the objects to sections addressable by the Cosmic space modifiers.
The following is done when a Cosmic modifier is parsed:
See the example in the Listing: Cosmic Space Modifiers for a prm file describing the placement of sections mentioned in the following table.
| Definition | Placement to _CX section |
|---|---|
| @tiny int my_var | _CX_DATA_TINY |
| @near int my_var | _CX_DATA_NEAR |
| @far int my_var | _CX_DATA_FAR |
| const @tiny int my_cvar | _CX_CONST_TINY |
| const @near int my_cvar | _CX_CONST_NEAR |
| const @far int my_cvar | _CX_CONST_FAR |
| @tiny void my_fun(void) | _CX_CODE_TINY |
| @near void my_fun(void) | _CX_CODE_NEAR |
| @far void my_fun(void) | _CX_CODE_FAR |
| @interrupt void my_fun(void) | _CX_CODE_INTERRUPT |
For further information about porting applications from Cosmic to the CodeWarrior IDE, refer to the technical note TN234. The following table indicates how space modifiers are mapped for the RS08.
| Definition | Keyword Mapping |
|---|---|
| @tiny | ignored |
| @near | ignored |
| @far | ignored |
Refer to the following listing for an example of the -Ccx compiler option.
volatile @tiny char tiny_ch; extern @far const int table[100]; static @tiny char * @near ptr_tab[10]; typedef @far int (*@far funptr)(void); funptr my_fun; /* banked and __far calling conv. */ char @tiny *tptr = &tiny_ch; char @far *fptr = (char @far *)&tiny_ch; Example for a prm file: (16- and 24-bit addressable ROM; 8-, 16- and 24-bit addressable RAM) SEGMENTS MY_ROM READ_ONLY 0x2000 TO 0x7FFF; MY_BANK READ_ONLY 0x508000 TO 0x50BFFF; MY_ZP READ_WRITE 0xC0 TO 0xFF; MY_RAM READ_WRITE 0xC000 TO 0xCFFF; MY_DBANK READ_WRITE 0x108000 TO 0x10BFFF; END PLACEMENT DEFAULT_ROM, ROM_VAR, _CX_CODE_NEAR, _CX_CODE_TINY, _CX_CONST_TINY, _CX_CONST_NEAR INTO MY_ROM; _CX_CODE_FAR, _CX_CONST_FAR INTO MY_BANK; DEFAULT_RAM, _CX_DATA_NEAR INTO MY_RAM; _CX_DATA_FAR INTO MY_DBANK; _ZEROPAGE, _CX_DATA_TINY INTO MY_ZP; END
Cosmic Manuals, Linker Manual, TN234