home *** CD-ROM | disk | FTP | other *** search
- {*********************************************************************
- (C) Copyright 1983-1992; MetaWare Incorporated; Santa Cruz, CA 95060.
- *********************************************************************}
- pragma on(Optimize_for_space);
- Export(Here);
- pragma include('system.pf');
- pragma include('lineterm.pf');
- pragma C_include('Implement.pf');
- pragma C_include('Interrupts.pf');
- pragma C_include('Portio.pf');
- package Here;
- pragma Routine_aliasing_convention(Implement.RTE_aliasing);
- procedure Display(const S:string); external;
- procedure Pascal_abort(const Msg:String; RC:Integer); external;
- pragma Alias(Pascal_abort,Implement.RTE || 'abort');
- procedure Stack_overflow; External;
- procedure Stkerr; External;
- end;
- with Loopholes:[Adr,Retype,Longptr,Sizeof,Address,Pointer_arithmetic];
- package Elsewhere;
- pragma Routine_aliasing_convention(Implement.RTE_aliasing);
- procedure FTERM; external;
- procedure CFTERM; external;
- procedure Restore_interrupts;External;
- end;
-
- -- Imports:
- with Lineterm,Elsewhere,Interrupts,Portio;
- pragma Off(With_warnings);
- with System;
- pragma Pop(With_warnings);
-
- program Implement_term;
- pragma Alias(Implement_term,Implement.RTE || 'term2');
-
- pragma off(Emit_names);
-
- { Termination procedures & write to terminal on error. }
-
- procedure Display;
- begin
- Write(System_stderr,Adr(S[1]),Length(S));
- Write(System_stderr,Adr(Ltconv_out[1]),Length(LTconv_out));
- end;
-
- var _Retcode: 0..255;
- value _Retcode := 0;
-
- -- Routines called from ints.p.
-
- procedure Pascal_abort;
- begin
- Display(Msg);
- Display('***Program aborted.***');
- #ifndef DAISY
- FTERM; CFTERM;
- #ifndef CDOS
- Restore_interrupts;
- #endif
- #endif
- Dos_exit(_Retcode);
- end;
-
- procedure Stkerr;
- begin
- Display('***STACK/HEAP OVERFLOW***');
- end;
-
- procedure Stack_overflow;
- begin
- Stkerr();
- Fstackdump(Stderr);
- Halt(-3);
- end;
-
- { (C) Copyright 1983-1985; unpublished property and trade secret of }
- { MetaWare Incorporated; Santa Cruz, CA 95060; detailed notice above.}
-