SLAA534A June 2013 – June 2020
For MSP430 and MSP430X, a 32-bit argument may be split between the stack and memory. If an argument would be passed in a register pair, but only one register is available (always R15), the compiler will split the argument between R15 and one register-sized spot on the stack.
MSP430 and MSP430X example:
C source code:
void func1(int a0, long a1, long a2);
int a0;
long a1, a2;
func2(void)
{
func1(a0, a1, a2);
}
Compiled assembly code:
SUB.W #2,SP
MOV.W &a0, R12
MOV.W &a1+0,R13
MOV.W &a1+2,R14
MOV.W &a2+0,R15
MOV.W &a2+2,0(SP)