{#######################################}
{#######################################}
{###                                 ###}
{###   R E C O R D   F O R M A T S   ###}
{###                                 ###}
{#######################################}
{#######################################}

!
! Each module which has diagnostic or recovery information contributes one
! MODULE FM information block to a psect called IMP_INFO_AREA_B, which is
! delimited by IMP___INFO_START and IMP___INFO_END, defined in a separate
! MACRO module.
!
%record %format Module Fm ( -
        %integer Code Base,     {LD}      {beginning of code}
                 Diag Base,     {LD}      {points to a DIAG HEAD FM}
                 Recovery Base, {LD}      {points to recovery area}
                 Code Size )              {total code in module}

%record %format Recovery Fm (
        %short   Mask,  {events trapped or 0 if perm}
                 Entry, {offset from LOW for re-entry}
        %integer Low,   {first protected AD}
                 High ) {first unprotected AD}

!
! If Module_Diag Base # 0, it points to a diagnostic header of the following
! format:
!
%record %format Diag Head Fm ( -
        %integer Line  Base,     {LD}
                 Var   Base,     {LD}
                 Block Base,     {LD}
                 Gla   Base,     {LD}
        %byte    Language,
                 Flags,
                 Res2,
                 Res3,
        %integer Record Base,    {LD}
                 %string(255) Module Name )

%const %integer Module No Lines  = 1<<0,
                Module Env Diags = 1<<1
 
%const %integer Language Unknown = 0,
                Language IMP     = 1,
                Language PASCAL  = 2,
                Language C       = 3

%record %format Block Fm ( -
        %integer Low Pc,            { < 0 if end of list }
                 High Pc,
        %short   Line Offset,
                 Var  Offset )

!!!%from IMP %include SfDef

%record %format Context Fm ( -
        %integer Pc, Sp,
        %record(Frame Fm) %name Frame,
                                FPrev,
                                FTwo )

%external %routine %spec Set Context %alias "IMP___SET_CONTEXT" -
        ( %record(Frame Fm) %name Called Frame )

%external %routine %spec Start Context %alias "IMP___START_CONTEXT"

%external %predicate %spec Find Module %alias "IMP___FIND_MODULE" -
        ( %integer Pc )

%external %predicate %spec Find Recovery %alias "IMP___FIND_RECOVERY"
%external %predicate %spec Find Block    %alias "IMP___FIND_BLOCK"
%external %predicate %spec Find Vars     %alias "IMP___FIND_VARS"

%external %routine   %spec Back Off      %alias "IMP___BACK_OFF"
%external %routine   %spec Back Off Fast %alias "IMP___BACK_OFF_FAST"

%external %routine %spec Find Line     %alias "IMP___FIND_LINE" -
          ( %integer %name Start Line, Code Line,
            %string(255) %name Block Id )
