Re: esp & local variables

Nfiedler@aol.com
Fri, 4 Apr 1997 11:27:44 -0500 (EST)

In a message dated 97-04-03 00:05:51 EST, edwdig@bergen.org (Edward Di
Geronimo Jr.) writes:
> Hi,
>
> If I'm writing an Esp procedure that uses local variables, how do I get
the
> inital value of bp?
>
> ------------------------------------------------------------------------
> | Edward Di Geronimo Jr. edwdig@bergen.org |
> ------------------------------------------------------------------------

This comes from the Geoworks Developer Relations "White Papers" web site:

-------------------------------
BP and Local Variables

When a procedure takes parameteres in BP and uses local
variables, BP can be saved before the stack frame is allocated.

Saving BP in a local variable

BP can be saved into the first push-initialized variable.

; ^hbp = GState to draw to
CircleVisDraw method dynamic CircleClass, MSG_VIS_DRAW
gStateHandle local hptr.GState push bp
count local word
.enter

......
mov di, ss:[gStateHandle]
call GrDrawPoint

Saving BP in another register

; ^hbp = GState to draw to
CircleVisDraw method dynamic CircleClass, MSG_VIS_DRAW
count local word

mov di, bp ; ^hdi = GState
.enter
......
call GrDrawPoint
-------------------------------

Hope this helps.

Nathan