80286 BASE ARCHITECTURE

BP IS A CONSTANT POINTER TO STACK BASED VARIABLES AND WORK SPACE, ALL REFERENCES USE BP AND ARE INDEPENDENT OF SP, WHICH MAY VARY DURING A ROUTINE EXECUTION,

PROC N

 

 

 

 

PUSH AX

 

 

 

 

PUSH ARRALSIZE

 

 

 

 

CALL PROC_N+1

-----.....~PROC_N+1:

 

 

 

 

PUSH BP

 

 

 

 

PUSH CX

 

 

 

 

MOV BP, SP

 

 

 

 

SUB SP, WORK_SPACE

 

 

 

"PROCEDURE BODY"

 

 

 

 

MOV SP, BP

 

 

 

 

POP CX

 

 

 

 

POP BP

 

 

 

 

RET

 

 

 

'['

r

 

BOTTOMOF

t

 

 

 

S TACK

PARAMETERS

 

 

 

 

RETURN ADDR

1"'--'

.-

REGISTERS

I

BP

I

 

L __ ..I

 

 

WORK_SPACE

PARAMETERS

RETURN ADDR

REGISTERS

WORK_SPACE

PROCEDURE N STACK FRAME

IPROCEDURE N+ 1 STACK FRAME

DYNAMICALLY ALLOCATED ON DEMAND RATHER THAN STATICALLY

---

TOP OF STACK

 

 

STACK SEGMENT BASE

G30108

Figure 2-9. BP Usage as a Stack Frame Base Pointer

2-13

Page 39
Image 39
Intel 80286, 80287 manual BP Usage as a Stack Frame Base Pointer