DataMuseum.dk

Presents historical artifacts from the history of:

Bogika Butler

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Bogika Butler

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦a214d60ab⟧ TextFile

    Length: 15360 (0x3c00)
    Types: TextFile
    Names: »COMDEF2.BAK«

Derivation

└─⟦08e5746f0⟧ Bits:30009789/_.ft.Ibm2.50007359.imd Mogens Pelles Zilog 80,000 / EOS projekt
    └─⟦this⟧ »COMDEF2.BAK« 

TextFile

(*--------------------------------------------------------------------
  MMU DESCRIPTOR (ONLY USED AS PART OF CONTEXT)  *)

   TYPE
      MMU_RegisterIndexType = (First_logical (* first log. // 256 *)
                              ,Last_logical  (* last log. // 256 *)
                              ,Offset        (* offset //256
                                                (logical + offset =
                                                 physical) *)
                              ,Flags         (* bit0=1: ENABLE
                                                bit1=1: READ ONLY *)
                              );

      MMU_RegisterType = ARRAY (. MMU_RegisterIndexType .) OF word;

      MMU_SaveAreaKindType = (MMU_RegKind, D67_RegKind);

      MMU_saveAreaType = RECORD

      (* The pascal interpretation is based on the comment in line
         253 in file comdef.sa page 6. *)

      CASE MMU_SaveAreaKindType OF
      MMU_RegKind:
         (MMU_Regs: MMU_RegisterType
         );
      D67_RegKind:
         (d6
         ,d7: RegisterType
         )
        END;

      MMU_DescriptorType = RECORD
         MM_map: PointerType;
                   (* Points to segment or sub segment mapped
                      MM_ref = PT_ref = address of segment or sub
                               segment object. 0 if unmapped or
                               base segment removed.
                      MM_kin = PT_kin = MMU_descriptor (=PT_MMU) *)
         MM_reg: MMU_SaveAreaType;
                   (* MMU register contents. Also used to save d6/d7
                      (=result) during delete context (del_ctx) in
                      knelop. *)
        END;

   CONST
      MM_siz = sizeof(MMU_DescriptorType);

(*--------------------------------------------------------------------
  GENERAL OBJECT  *)

   TYPE
      ObjectGeneralPartType = RECORD
         GE_ex: ChainType;   (* Executed by: General obj -> ctx *)
         GE_con: word;       (* Control procedure <= 0 *)
         GE_temp: word;      (* No of temp pointers in contexts
                                (incl T(0)) *)
         GE_temd: long;      (* No of bytes in temp stack, > 0,
                                < MAX-AR_MAXVAL  *)
         GE_stk: SizeType;   (* Size of required free call stack *)
         GE_stkm: AddressType;
                             (* Logical address for mapping temp stack:
                                FL_tempd = $200000 for normal objects *)
         GE_ent: AddressType;
                            (* Logical address for entry *)
        END;

      GeneralObjectType = RECORD
         CommonPart: ObjectCommonPartType;
         GeneralPart: ObjectGeneralPartType
        END;

   CONST
      GE_siz = sizeof(GeneralObjectType);

(*--------------------------------------------------------------------
  STACK ELEMENT: COMMON PART OF ENVELOPES AND CONTEXTS  *)

      (* Embedded segments and subsegments allocated here *)
   TYPE
      StackCommonPartType = RECORD
         ST_mem: MemberType; (* Various usage: Head -> stack element
                                ST_ref = CH_hold = address of entity
                                holding head *)
         ST_word: word;      (* Various usage *)
         ST_stk: MemberType; (* Stack: Head -> stack element
                                ST_hold = CH_hold = addrass of object
                                holding stack element *)
         ST_act: ChainType;  (* Actual: Stack element -> formal pointer *)
         ST_top: word;       (* Top pointers, relative to stack element *)
         ST_fir: word;       (* First embedded, relative to stack element *)
         ST_res: word;       (* Resident count: <> 0 when stack
                                element is resident *)
         ST_io: word;        (* io_count: #simple pointers with io_cap
                                in element *)
        END;
      (* Pointers allocated here *)

      (* NOTE: Size of envelope/contextincluding pointers and embedded
         structures is always:
                   TOP POINTERS - FIRST EMBEDDED
                        (ST_top - ST_fir)                           *)

   CONST
      ST_siz = sizeof(StackCommonPartType);

(*--------------------------------------------------------------------
  STACK ELEMENTS: ENVELOPE AND CONTEXT *)

   TYPE
      StackElementKindType = (EnvelopeKind, ContextKind);

      StackElementType = RECORD

      (* Although the first parts of both variants are structurally
         almost identical they have not been united in a fixed part
         because of the differences in semantics. The interpretation
         of each field is explained (as usual) in the accompanying
         comment *)

      CASE StackElementKindType OF
      EnvelopeType:
         (
         EN_mst: MemberType; (* Manager: Manset -> envelope
                                EN_man = CH_hold = address of manager
                                envelope (0 if dummy manager) (also
                                term_proc = 0 for dummy manager)  *)
         EN_off: word;       (* Manset pointer offset in manager envelope *)
         EN_stk: MemberType; (* Envelope stack: object -> envelope
                                EN_obj = CH_hold = addrass of object
                                 holding envelope *)
         EN_act: ChainType;  (* Actual: Envelope -> formal pointer *)
         EN_topl: word;      (* Top local pointers, relative to envelope *)
         EN_fir: word;       (* First embedded, relative to envelope *)
         EN_res: word;       (* Resident count: #res_pt to env + #driv_pt
                                   in env + #res_ctx in the obj having
                                   env as primary env. <> 0 when envelope
                                   is resident *)
         EN_io: word;        (* io_count: #simple pointers with io_cap
                                in envelope *)

         (*  END OF COMMON PART *)

         EN_ref: ChainType;  (* Referred by: Env -> refEnv pointers *)
         EN_term: word;      (* Termination procedure:
                                   < 0: Normal
                                   = 0: Dummy or dummy manager
                                   = 1: Term procedure called *)
         EN_termr: SizeType; (* Termination requirement: Free stack needed
                                   to enter term procedure, use call stack
                                   or dealloc stack+delete locals and older
                                   envelopes *)
         EN_fix: SizeType;   (* Fixed term requirement: Fixed stack needed
                                   to enter term procedure and use dealloc
                                   stack *)
         EN_max: SizeType;   (* Max stack: Free stack sufficient to delete
                                   all locals in envelope *)
         EN_cou: word;       (* Number of "locals" with term req = max for
                                   both components. "Locals" are logically
                                   owned objects and older envelopes.
                                   EN_cou may be zero in case max components
                                   are from different "locals" *)
         );
      ContextKind:
         (
         CT_exe: MemberType; (* Executes: Gen obj -> ctx (self-ref if
                                aborted)
                                CT_obj = CH_hold = address of general obj.
                                (0 if aborted) *)
         CT_mode: byte;      (* Exc_mode << 2 + propagation mode:
                                Exc_mode: 0=No_exc,1=undef_exec,
                                3=undef/reject_exc
                                Propagation_mode: 0=stop,1=reject,3=same *)
         CT_spe: byte;       (* Speedexc << 7 + speed_up.
                                Speedexc=1 ==> exception.
                                Speed_up: 0=normal, 1=reject, 3=undef *)
         CT_stk: MemberType; (* Context stack: Process or
                                extension obj -> ctx.
                                CT_hold = CH_hold = addrass of process
                                or extension object *)
         CT_act: ChainType;  (* Actual: ctx -> formal pointers *)
         CT_topf: word;      (* Top formal pointers, relative to ctx *)
         CT_fir: word;       (* First embedded, relative to ctx *)
         CT_res: word;       (* Resident count: 0 for normal, 1 for
                                resident ctx *)
         CT_io: word;        (* io_count: #simple pointers with io_cap
                                in ctx *)

         (* END OF COMMON PART *)

         CT_topt: word;      (* Top temp pointers, relative to context
                                   = first formal pointer, relative to ctx.
                                CT_topt must be placed on offset ST_siz *)
         CT_stkuk: SizeType; (* Size of free call stack in context (used
                                when temp/formal in old ctx grows *)
         CT_mm: ARRAY (.0..3.) OF MMU_DescriptorType;
                             (* CT_mm(.0.) is used as save area in del_ctx *)
         CT_con: AddressType;
                             (* Continue address in kernel when user returns *)
         CT_usp: long;       (* Saved user stack pointer *)
         CT_sava: ARRAY (.0..11.) OF long;
                             (* Supervisor stack: saved in old context
                                when new context is created *)
         CT_count: word;     (* - #supervisor stack words saved in addition
                                  to "A4,A5,A6,SR,PC" which are always saved.
                                  Kernel return is also always saved (count=-2)
                                  Used by procedures save_stk and rsto_stk *)
                             (* Val data description: *)
         CT_val: word;       (* Pointer offset in prev ctx for val base segm *)
         CT_frel: long;      (* First rel address of val in val base segm *)
         CT_trel: long       (* Top rel address of val in val base segm *)
         )
        END; (* StackElementType *)

         (* temp pointers allocated here. T(0) is aux pointer for dealloc *)
         (* formal pointers allocated here *)

   CONST
      EN_siz = sizeof(StackElementType);
                   (* Size of envelope excluding local pointers *)
      CT_siz = sizeof(StackElementType);
                   (* Size of context excluding pointers *)

(*--------------------------------------------------------------------
  RESULT ARGUMENT, ERROR CODES.  *)

(* RESULT:   MAIN   = D7, BIT  7: 0
             FAMILY = D7, BIT 15: 8
             ORGNO  = D7, BIT 31:16  ALWAYS ZERO FOR KERNEL
             ARGNO  = D6, BIT  7: 0  ARGUMENT NUMBER WHERE ERROR FOUND
             AUXCAU = D6, BIT 15: 8
             ORGSYS = D6, BIT 31:16  ALWAYS ZERO FOR KERNEL *)

   CONST
      EC_OK = 0;             (* MAIN: OK  (set by CLR d7) *)

      (* ERROR CODES page 10 in comdef.sa.  Should these be declared
         as numeric constants or as an enumeration type? *)

(* *** ??? *** *)

(*--------------------------------------------------------------------
  ARGUMENT LIST  *)

(* ARGUMENT TYPES. HOW TO DECLARE ?  PAGE 11 F IN COMDEF.SA *)

(*--------------------------------------------------------------------
  INS ELEM MACRO  *)

   PROCEDURE InsElem((*UNIV*) VAR Old, New, Prev: ChainPointerType);

   (* Insert the new element in the chain between prev and old.

   The macro is substituted by a procedure to conform with pascal
   programming facilities. Parameter number 4 (OLD/PREV) which is
   redundant and only used to provide performance optimization is
   omitted. Parameter number 3 (PREV) is redundant too, but the
   exact usage is not known and consequently it is retained.

      Old:  Points to a chain element (often the chain head)
      New:  Points to the new element
      Prev: At call: Any value
            At return: = New^.Pred; Points to the chain element
                       previously next to old, which has now
                       been moved one position down the chain
                       to make room for the new element. Same
                       value as Old^.Prev *)

     BEGIN
      Prev := Old^.Prev;
      New^.Next := Old;
      New^.Prev := Prev;
      Prev^.Next := New;
      Old^.Prev := New
     END;

(*--------------------------------------------------------------------
  REM_ELEM MACRO  *)

   PROCEDURE RemElem((*UNIV*) VAR Elem, Next, Prev: ChainPointerType);

   (* Removes element Elem from the chain but does NOT make Elem
      self-referencing

   The macro is substituted by a procedure to conform with pascal
   programming facilities. Parameter #4 (OLD/PREV) which is
   redundant and only used to provide performance optimization is
   omitted. Parameters #3 (PREV) and #2 (NEXT) are redundant too,
   but their exact usage is not known and consequently they are retained.

      Elem: Points to chain element to be removed.
      Next: At call: Any value.
            At return: = Elem^.Next; Points to the neighbour chain
                       element towards the chain head along the line
                       of next-pointers.
      Prev: At call: Any value.
            At return: = Elem^.Prev; Points to the neighbour chain
                       element towards then chain head along the
                       line of prev-pointers. *)

     BEGIN

      (* Obvious performance improvements can be obtained if the
        redundant parameters are omitted *)

      Next := Elem^.Next;
      Prev := Elem^.Prev;
      Prev^.Next := Next;
      Next^.Prev := Prev;
     END;

(*--------------------------------------------------------------------
  INIT_HEAD MACRO  *)

   PROCEDURE InitHead((*UNIV*)     Elem: ChainType;
                     ,     VAR AbsElem: AddressType
                     );

   (* Makes chain element self-referencing

      Elem: Points to chain element to be made self-referencing.
      AbsElem: At call: Any value.
               At return: The effective (virtual) address of Elem. *)

     BEGIN
      AbsElem := addr(Elem);
      WITH Elem DO
        BEGIN
         Next := AbsElem;
         Prev := AbsElem;
        END
     END;

(*--------------------------------------------------------------------
  CASEJMP AND CASELAB MACROES *)

   (* BOTH CASEJMP AND CASELAB MACROES ARE OMITTED AS THEY ONLY SERVE
      TO IMPLEMENT AN EQUIVALENT TO THE PASCAL CASE STATEMENT *)

(*--------------------------------------------------------------------
  ENTRYSAV AND RETURN MACRO  *)

   (* ARE these nessesary ??? *)

(*--------------------------------------------------------------------
  PRT_REG, PRT_MEM, ERROR MACRO  *)

  (* TO APPEAR *)

(*--------------------------------------------------------------------
  OTHER CONSTANTS USED IN MORE THAN ONE MODULE
  (TO BE REMOVED FROM THIS SOURCE)
  Moved to file kernel.pas *)

«eof»