home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s1.arc / INITTERM.MOD < prev    next >
Text File  |  1988-02-13  |  5KB  |  106 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                  InitTerm --- Initialize PibTerm                     *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE InitTerm;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  InitTerm                                             *)
  10. (*                                                                      *)
  11. (*     Purpose:    Initializes PibTerm                                  *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        InitTerm;                                                     *)
  16. (*                                                                      *)
  17. (*     Calls:                                                           *)
  18. (*                                                                      *)
  19. (*        INt24On                                                       *)
  20. (*        Set_Defaults                                                  *)
  21. (*        InitOvly                                                      *)
  22. (*        Read_Config_File                                              *)
  23. (*        MyLoadOverlay                                                 *)
  24. (*        TestVersionWarning                                            *)
  25. (*                                                                      *)
  26. (*----------------------------------------------------------------------*)
  27.  
  28. VAR
  29.    I      : INTEGER;
  30.  
  31. BEGIN (* InitTerm *)
  32.                                    (* Save top of heap for use  *)
  33.                                    (* in DOS EXEC later on.     *)
  34.  
  35.    IF ( OFS( FreePtr^ ) = 0 ) THEN
  36.  
  37.                                    (* Free list is empty -- add *)
  38.                                    (* $1000 to the segment.     *)
  39.  
  40.       HeapTop := PTR( SEG( FreePtr^ ) + $1000 , 0 )
  41.    ELSE
  42.       HeapTop := PTR( SEG( FreePtr^ ) + ( OFS( FreePtr^ ) SHR 4 ) , 0 );
  43.  
  44.                                    (* Don't allow <CTRL>Break   *)
  45.                                    (* to zap program.           *)
  46.    CheckBreak := FALSE;
  47.                                    (* Make sure we have some    *)
  48.                                    (* space on free list.       *)
  49.    FreeMin := 8 * 100;
  50.                                    (* Initialize critical error *)
  51.                                    (* handler routine.          *)
  52.    Int24ON;
  53.                                    (* Initialize handler for    *)
  54.                                    (* other errors.             *)
  55.    ExitSave  := ExitProc;
  56.    ExitProc  := @Error_Handler;
  57.    HeapError := @Heap_Error_Handler;
  58.  
  59.                                    (* Display message if this is *)
  60.                                    (* a test version.            *)
  61.    IF Test_Version THEN
  62.       Test_Version_Warning;
  63.                                    (* Determine if multitasker active *)
  64.                                    (* Also sets 'Multitasker' telling *)
  65.                                    (* which multitasker is active     *)
  66.  
  67.    TimeSharingActive  := IsTimeSharingActive;
  68.  
  69.                                    (* Redirect keyboard input to *)
  70.                                    (* PibTerm's special driver   *)
  71.    Keyboard_Buffer := '';
  72.                                    (* Get current interrupt 9 address *)
  73.  
  74.    GetIntVec( Kbd_Interrupt , Kbd_Save_Iaddr );
  75.  
  76.                                    (* Get current interrupt $10 address *)
  77.  
  78.    GetIntVec( Video_Interrupt , Video_Save_Iaddr );
  79.  
  80.                                    (* And initialize the global variables *)
  81.    Set_Defaults;
  82.                                    (* Read or create primary config. file *)
  83.  
  84.    IF ( NOT Read_Config_File ) THEN
  85.       BEGIN
  86.          Get_Default_Params( TRUE );
  87.          Write_Config_File('');
  88.       END;
  89.                                    (* Allocate dialing directory, *)
  90.                                    (* review buffer.              *)
  91.    Allocate_Dial_And_Review;
  92.                                    (* Read in directory, function keys, etc. *)
  93.    Get_Other_Files;
  94.  
  95.                                    (* Set other parameters *)
  96.    Set_Other_Parameters;
  97.                                    (* Clear out command line area. *)
  98.  
  99.    Mem[PrefixSeg:$80] := 0;
  100.    Mem[PrefixSeg:$81] := ORD( CR );
  101.  
  102.                                    (* Initialize communications *)
  103.    Initialize_Communications;
  104.  
  105. END   (* InitTerm *);
  106.