When procedure A calls procedure B, the ENTER instruction creates a new display (refer to
Figure 4-9). The first doubleword holds a copy of the last value in procedure As EBP register.
The second and third doublewords are copies of the two stack frame pointers in procedure As
display. Procedure B can access variables in procedure A and MAIN by using the stack frame
pointers in its display.
Figure 4-8. Stack Frame after Entering Procedure A
EBP
Display
Old EBP
ESP
Mains EBP
Dynamic
Storage
Procedure As EBP
Mains EBP
Mains EBP