[Instructions] [Search] [Current] [Syllabus] [Handouts] [Outlines] [Assignments]
Held Monday, November 2, 1998
Notes
TEMP ``instruction''.
w in the current
stack frame, we use
MEM(BINOP(PLUS,TEMP(FP),CONST(w))
w to the frame pointer
and then look that up in memory.
w in the parent's
stack frame, and the static link is at offset s, we use
MEM(BINOP(PLUS, MEM(BINOP(PLUS, TEMP(FP), CONST(s))), CONST(w)))
w in that frame.
MEM(BINOP(PLUS, CONST(w), MEM(BINOP(PLUS, CONST(s), TEMP(FP))))
w in the grandparent's
stack frame, the static link in the parent's frame is at offset p,
and the static link to the parent's frame is at offset s, then
we access v with
MEM(BINOP(PLUS,
MEM(BINOP(PLUS,
MEM(BINOP(PLUS, TEMP(FP), CONST(s))) // Parent's frame
CONST(p))) // Grandparent's frame
CONST(w))) // Offset of v in grandparent's frame
History
Back to Abstracting stack frames. On to Translation, continued.
[Instructions] [Search] [Current] [Syllabus] [Handouts] [Outlines] [Assignments]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Wed Nov 4 11:40:22 1998.
This page generated on Wed Nov 4 11:44:53 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu