TEB's Blog


  1. On stack growth direction

    -
    I was working on a project, and found myself in need of a virtual stack. Now most cpu’s grow the stack downwards, which means that pushing to the stack decrements the stack pointer. But why do they do so? And would growing it upwards have any advantages? From what I can tell, there isn’t actually any clear and concise answer. Many attribute it to sheer convention, but there are some minor differences. I thought I’d write a summary of what I found, to congregate the information on this topic.