O'Reilly logo

Linux Assembly Language Programming by BOB NEVELN

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. THE STACK

The stack is a portion of memory which is shared with the operating system. It is used by programs for communication with subprograms, for temporary storage, and when making system calls. It is called the stack because it has a "last stored first retrieved" policy. It is in fact an example of the data structure that is called a stack. Because it is used by the operating system as well as by the programmer, it must be used responsibly. Misusing the stack is a very easy way to crash a program, or the whole system, if the operating system is unprotected.

Push and Pop Operations

The following figure shows the stack and the ESP register. This register has the job of keeping track of the stack. It does this by holding the address ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required