SPRAB89A September 2011 – March 2014
The SP is 8-byte aligned, and must remain 8-byte aligned at all times in case an interrupt occurs during frame allocation or deallocation. This means that every atomic adjustment to SP must be a multiple of 8 bytes.
The double word (8 bytes) at the bottom of the frame spans a frame boundary. That is, the first word is in the callee's frame but the second is in the caller's frame, so neither can use it to store a double word. This is unfortunate from the point of view of saving and restoring registers using double word loads and stores, but is a historical carryover from prior architectures that did not have double word support. In the diagrams that follow, double word boundaries are indicated with heavier lines.
Before the first instruction in a function, the stack looks like this:
If this function needs one word on the stack to store something, it will need to allocate a frame of 2 words (because SP must always remain 8-byte aligned). The allocation is performed by decrementing SP by 8. Now the stack looks like this: