Skip to content

clarify stack alignment #1

Description

@Meister-anon

"The stack contains words (just like books - look how far my analogy extends!). However, all we know about the stack is the location of the most recent item - this is the stack pointer. The stack pointer must thus be a multiple of 4. This ensures the stack is properly aligned."

Why does that explain why the stack must be multiplied by 4, is it because words are 4 bytes?
And how does that cause alignment? Further what does it mean to be aligned?

I'm still reading so maybe that will be answered further down, but I think it would be good to add those answers up here, so readers can better follow without question/getting lost.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions