in

Does stack grow upward or downward?

Does stack grow upward or downward

end of stack

— Stack pointer

« function locals>

Frame

pointer

‹function locals>

– Frame pointer

end of stack

Stack pointer

A stack frame, with stack and frame pointers

A stack frame, with stack and frame pointers

At this point, roughly half of you will be screaming, saying “this diagram doesn’t make sense, stacks obviously grow in the opposite direction!”. Fear not, I made a button for you:

I think stacks grow downwards

At this point, roughly half of you will be screaming, saying “this diagram doesn’t make sense, stacks obviously grow in the opposite direction!”. Fear not, I made a button for you:

I think stacks grow upwards

Huzzah! A man of quality!

What do you think?

Written by codeitbro

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings