© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
J. BartlettLearn to Program with Assemblyhttps://doi.org/10.1007/978-1-4842-7437-8_11

11. The Stack and Function Calls

Jonathan Bartlett1  
(1)
Tulsa, OK, USA
 

The stack is an area of memory that is used to store values which will eventually be discarded.

11.1 Imagining the Stack

To understand what the stack is or why it is needed, imagine yourself doing a complicated task that involves a lot of paperwork. Imagine yourself doing taxes, and imagine doing it largely on paper, not the computer.

Now, while doing your taxes, you discover that you need to find out how much money you spent on tools for your job. This is a new (though related) task. You have to set down ...

Get Learn to Program with Assembly: Foundational Learning for New Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.