Intel 80C186EA User Manual page 324

Hide thumbs Also See for 80C186EA:
Table of Contents

Advertisement

BP
SP
Figure A-4. Stack Frame for Procedure A at Level 2
After Procedure A calls Procedure B, ENTER creates the display for Procedure B. The first word
of the display points to the previous value of BP (BPA). The second word points to the value of
BP for MAIN (BPM). The third word points to the BP for Procedure A (BPA). The last word
points to the current BP (BPB). Procedure B can access variables in Procedure A or Main via the
appropriate BP in the display (see Figure A-5).
After Procedure B calls Procedure C, ENTER creates the display for Procedure C. The first word
of the display points to the previous value of BP (BPB). The second word points to the value of
BP for MAIN (BPM). The third word points to the value of BP for Procedure A (BPA). The
fourth word points to the current BP (BPC). Because Procedure B and Procedure C have the same
lexical nesting level, Procedure C cannot access variables in Procedure B. The only pointer to
Procedure B in the display of Procedure C exists to allow the LEAVE instruction to collapse the
Procedure C stack frame (see Figure A-6).
80C186 INSTRUCTION SET ADDITIONS AND EXTENSIONS
15
Old BP
BPM
BPM
BPM
BPA*
*BPA = BP Value for Procedure A
0
Display A
Dynamic
Storage A
A1003-0A
A-5

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c188ea

Table of Contents