-- TrapSupport.mesa
-- Last edit: Taft at  8-Jul-81 10:40:14

DIRECTORY
  Frame USING [GetReturnLink],
  Mopcodes USING [zLLB],
  PrincOps USING [BytePC, ControlLink],
  SDDefs USING [SD];

TrapSupport: DEFINITIONS IMPORTS Frame =
  BEGIN

  OpTrapTable: TYPE = MACHINE DEPENDENT RECORD [
    main: ARRAY [0..377B] OF PrincOps.ControlLink,
    misc: ARRAY [0..377B] OF PrincOps.ControlLink];

  opTrapTable: POINTER TO POINTER TO OpTrapTable = LOOPHOLE[SDDefs.SD+137B];

  BumpPC: PROCEDURE [bytes: CARDINAL] = INLINE
    BEGIN
    controlLink: PrincOps.ControlLink = Frame.GetReturnLink[];
    controlLink.frame.pc ← PrincOps.BytePC[controlLink.frame.pc+bytes];
    END;

  GetTrapParam: PROCEDURE RETURNS [UNSPECIFIED] = MACHINE CODE
    BEGIN Mopcodes.zLLB, 3 END;

  TrapSupportImpl: PROGRAM;

  END.