-- PrincOpsRuntime.mesa (last edited by: McJones on: September 16, 1980  11:14 AM)

DIRECTORY
  Mopcodes USING [zAND],
  PrincOps USING [GFTIndex, GlobalFrameHandle];

PrincOpsRuntime: DEFINITIONS =
  BEGIN

  -- Global Frame Table definitions

  GFTHandle: TYPE = POINTER TO ARRAY [0..0) OF GFTItem;
  GFT: GFTHandle = LOOPHOLE[1400B];

  GFTItem: TYPE = MACHINE DEPENDENT RECORD [
    SELECT OVERLAID * FROM
      frame => [framePtr: PrincOps.GlobalFrameHandle],
      ep => [data: [0..37777B], epbias: [0..3]],
      ENDCASE];

  EmptyGFTItem: GFTItem = [ep[data: 0, epbias: 0]];
  FreedGFTItem: GFTItem = [ep[data: 0, epbias: 3]];

  -- Procedure for easy access of frame handle
  GetFrame: PROC [g: GFTItem] RETURNS [PrincOps.GlobalFrameHandle] = INLINE
    BEGIN
    And: PROC [g: GFTItem, mask: WORD] RETURNS [PrincOps.GlobalFrameHandle] =
      MACHINE CODE BEGIN Mopcodes.zAND; END;
    RETURN[And[g, 177774B]];
    END;

  MaxGFTSize: CARDINAL = (LAST[PrincOps.GFTIndex] + 1)*SIZE[GFTItem];

  END.

June 30, 1980  3:00 PM	Sandman	Created file
July 20, 1980  8:24 PM	Forrest	?
September 16, 1980  11:14 AM	McJones	Switched to 1-word GFT entries