The MSP430X CPU has 20-bit address bus, so it only can address up to 1MB without paging.
IAR use 4 bytes to store in memory for MSP430X's function pointer (20 bits) whatever __data20 is used or not.
The function pointer is always 4 bytes for MSP430X architecture by IAR MSP430 compiler.
In fact, IAR used RETA for all function exit even the function is located in 1st 64K.
Code:
typedef unsigned short int U16;
U16 subroutine1( U16 v ) { return v+1; }
U16 subroutine2( U16 v ) { return v-1; }
U16 subroutine3( U16 v ) { return v*v; }
The 'csubroutines'
(12 bytes) in 'DATA16_C' segment:
Code:
U16 (* const __data16 csubroutines[])( U16 )={ subroutine1,subroutine2,subroutine3 };
The 'csubroutines'
(12 bytes) in 'DATA20_C' segment:
Code:
U16 (* const __data20 csubroutines[])( U16 )={ subroutine1,subroutine2,subroutine3 };
The size of data pointer can be 2 or 4 bytes which it depends on model and/or memory attribute.
Code:
char const __data16 s1[]="ABBA";
char const __data16 s2[]="BEEF";
char const __data16 * __data20 const dp1[]={ s1,s2 };
The s1,s2 are placed in 'DATA16_C' and dp1
(4 bytes) in 'DATA20_C'.
Code:
char const __data20 s3[]="DEAD";
char const __data20 s4[]="FEED";
char const __data20 * __data16 const dp2[]={ s3,s4 };
The s3,s4 are placed in 'DATA20_C' and dp2
(8 bytes) in 'DATA16_C'.
So you need to let compiler know how to translate them.