Memory assignment of local variables
- by Mask
void function(int a, int b, int c) {
char buffer1[5];
char buffer2[10];
}
We must remember that memory can only
be addressed in multiples of the word
size. A word in our case is 4 bytes,
or 32 bits. So our 5 byte buffer is
really going to take 8 bytes (2 words)
of memory, and our 10 byte buffer is
going to take 12 bytes (3 words) of
memory. That is why SP is being
subtracted by 20.
Why it's not ceil((5+10)/4)*4=16?