home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / 24 < prev    next >
Encoding:
Text File  |  1992-12-09  |  2.1 KB  |  72 lines

  1. {*********************************************************************
  2. (C) Copyright 1983-1992; MetaWare Incorporated;  Santa Cruz, CA 95060.
  3. *********************************************************************}
  4. pragma on(Optimize_for_space);
  5. Export(Here);
  6. pragma include('system.pf');
  7. pragma C_include('Implement.pf');
  8. pragma C_include('Interrupts.pf');
  9. pragma C_include('Portio.pf');
  10. package Here;
  11.    pragma Routine_aliasing_convention(Implement.RTE_aliasing);
  12.    procedure ENDD; external;
  13.    pragma Alias(Endd,Implement.RTE || 'end');
  14.    procedure Halt(RC:Integer);    External;
  15.    end;
  16. with Loopholes:[Adr,Retype,Longptr,Sizeof,Address,Pointer_arithmetic];
  17. package Elsewhere;
  18.    pragma Routine_aliasing_convention(Implement.RTE_aliasing);
  19.    procedure FTERM; external;
  20.    procedure CFTERM; external;
  21.    procedure Restore_interrupts;External;
  22.    procedure Call_onexit_fcns; external;
  23.    end;
  24.  
  25. -- Imports:
  26. with Elsewhere,Interrupts,Portio;
  27. pragma Off(With_warnings);
  28. with System;
  29. pragma Pop(With_warnings);
  30.  
  31. program Implement_term;
  32. pragma Alias(Implement_term,Implement.RTE || 'term1');
  33.  
  34. pragma off(Emit_names);
  35.  
  36. -- NOTE:  term.p has been split into term.p and term2.p; only term.p
  37. -- is documented in the programmer's guide as the date of the split, 4/2/86.
  38.  
  39. { Non-I/O termination procedures. }
  40.  
  41. var _Retcode: 0..255;
  42. value _Retcode := 0;
  43.  
  44. procedure ENDD;
  45.    begin
  46.    -- This next call is for C only.  The Pascal run-time initializer
  47.    -- has a dummy version of this.
  48.    -- Can't call this on a stack-overflow since it might happen again.
  49.    Call_onexit_fcns;
  50. #ifndef DAISY
  51.    FTERM; CFTERM;
  52. #ifndef CDOS   
  53.    Restore_interrupts;
  54. #endif   
  55. #endif
  56.    Dos_exit(_Retcode);
  57.    end;
  58.  
  59. procedure Halt;     -- Needed by Pascal RTE.
  60.    pragma data(static);
  61.    var     Halt_invoked: Boolean;
  62.    value Halt_invoked := False;
  63.    pragma data;
  64.    begin
  65.    if Halt_invoked then DOS_exit(_Retcode) else Halt_invoked := True;
  66.    _Retcode := RC;
  67.    ENDD;
  68.    end;
  69.    
  70. { (C) Copyright 1983-1985;  unpublished property and trade secret of }
  71. { MetaWare Incorporated; Santa Cruz, CA 95060; detailed notice above.}
  72.