I think there is an intrinsic call missing:
switch (__even_in_range(TAIV, 10))
{
__even_in_range
is an intrinsic used for MSP-430 mcu. It is provided by both TI compiler cl430
for MSP-430 and IAR compiler for MSP-430. It requires two arguments, the interrupt vector register and the last value in the allowed range, which in this example is 10. The intrinsic is used to help the compiler to generate efficient code.
See IAR for MSP-430 compiler documentation which gives this example in page 25:
#pragma vector=TIMERA1_VECTOR
__interrupt void Timer_A1_ISR(void)
{
switch (__even_in_range(TAIV, 10))
{
case 2: P1POUT ˆ= 0x04;
break;
case 4: P1POUT ˆ= 0x02;
break;
case 10: P1POUT ˆ= 0x01;
break;
}
}
and says:
The effect of the intrinsic function is that the generated code can only handle even values within the given range, which is exactly what is required in this case as the interrupt vector register for Timer A can only be 0, 2, 4, 6, 8, or 10.
The description of __even_in_range
in page 237 says:
Instructs the compiler to rely on the specified value being even and within the specified range. The code will be generated accordingly and will only work if the requirement is fulfilled