Some TMS320C28x instructions read and
write 32 bits of memory at once (MOVL, ADDL, etc.). These instructions require that
32-bit objects be allocated on an even boundary. To ensure that this occurs, the
compiler takes these steps:
- It initializes the SP to an even
boundary.
- Because a call instruction adds 2
to the SP, it assumes that the SP is pointing at an even address.
- It makes sure that the space
allocated on the frame totals an even number, so that the SP points to an even
address.
- It makes sure that 32-bit objects
are allocated to even addresses, relative to the known even address in the
SP.
- Because interrupts cannot assume
that the SP is odd or even, it aligns the SP to an even address.
For more information on how these
instructions access memory, see the TMS320C28x Assembly Language Tools User’s
Guide.