DIRECTORY Alloc USING [Notifier], CodeDefs USING [Byte, StackIndex, StackLocRec, StackPos, TempAddr, VarComponent], Symbols USING [ContextLevel, lZ]; Stack: DEFINITIONS = { OPEN CodeDefs; StackModelingError: SIGNAL; Above: PROC [s: StackIndex, count: CARDINAL_1, nullOk: BOOL_FALSE] RETURNS [StackIndex]; Also: PROC [ n: CARDINAL_1, inLink: BOOL_FALSE, tOffset: TempAddr, tLevel: Symbols.ContextLevel_Symbols.lZ]; Check: PROC [b: Byte]; Clear: PROC; Decr: PROC [count: CARDINAL_1]; DeleteToMark: PROC; Depth: PROC RETURNS [d: StackPos]; Dump: PROC; Dup: PROC [load: BOOL_FALSE]; Exchange: PROC; Forget: PROC [s: StackIndex, count: CARDINAL_1]; Incr: PROC [count: CARDINAL_1]; Init: PROC; KeepOnly: PROC [s: StackIndex, count: CARDINAL]; Load: PROC [s: StackIndex, count: CARDINAL_1]; Loc: PROC [s: StackIndex, count: CARDINAL_1] RETURNS [StackLocRec]; Mark: PROC; MoveToTemp: PROC [firstIndex: StackIndex, count: CARDINAL_1] RETURNS [VarComponent]; New: PROC RETURNS [old: StackIndex]; Off: PROC; On: PROC; Pop: PROC [count: CARDINAL_1]; Prefix: PROC [sti: StackIndex]; Require: PROC [count: StackPos]; Reset: PROC; ResetToMark: PROC; Restore: PROC [s: StackIndex]; RoomFor: PROC [n: CARDINAL] RETURNS [BOOL]; TempStore: PROC [count: CARDINAL_1] RETURNS [VarComponent]; Top: PROC [count: CARDINAL_1] RETURNS [StackIndex]; UnMark: PROC; VDepth: PUBLIC PROC RETURNS [StackPos]; VDepthOf: PROC [s: StackIndex] RETURNS [d: StackPos]; StackImplNotify: Alloc.Notifier; }. šStack.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Sweet, February 27, 1980 3:26 PM Satterthwaite, November 2, 1982 3:53 pm Russ Atkinson (RRA) March 6, 1985 11:08:27 pm PST Interface Items the index of the word "count" above that at "s" record that the top "n" words on the stack are also in temps starting at "tOffset", at lexical level "tLevel" requires that top "n" words are already onStack if stack in "On", assure that operands are loaded, reflect changes due to execution of instruction byte "b", check for overflow pop off all remaining words remove the "count" top words from the stack model ResetToMark, UnMark number of words actually on stack empty the stack into temporaries duplicate the top element on the stack if "load", load if top is in temp exchange the top two elements on the stack remove "count" words beginning at "a" from the stack model add "count" words to the stack model pop off anything above the "count" words at "s" put the "count" words beginning at "s" on top where are the "count" words beginning at "s" insert a mark, also a label for dumping previous contents store "count" words from stack into contiguous temps pop off the top "count" words (unless they are already in temps) link saved away stack item on front of model empty all but the top "count" words into temporaries the top "count" words may also be dumped if necessary load items back to the first mark, remove from model will the stack overflow if n more words are loaded store the top "count" words into a temp the index of the word "count" down from the top remove the topmost mark the current depth of the virtual stack the virtual depth of the word at "s" Κφ˜codešœ ™ Kšœ Οmœ1™