home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- ibmtcc.c -- device dependent stuff for Turbo C compiler (DOS)
- *
- * (c) 1993, 1994 by Han Wen Nienhuys <hanwen@stack.urc.tue.nl>
- *
- * This program is free software; you can redistribute it and/or modify it
- * der the terms of the GNU General Public License as published by the
- * e Software Foundation;
- *
- * This program is distributed in the hope that it will be useful, but
- * T ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * th this program; if not, write to the Free Software Foundation, Inc.,
- * 75 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- #include <stdio.h>
- #include <bios.h>
- #include <stdlib.h>
- #include <time.h>
- #include <signal.h>
- #include <alloc.h>
-
-
-
- #include "ray.h"
- #include "proto.h"
- #include "extern.h"
-
- extern unsigned int _stklen = (unsigned) 16384;
-
-
-
- /* check for an abort condition, such as keypress */
- PUBLIC void
- check_abort(void)
- {
-
- if (keyboard_exit)
-
- if (bioskey(1)) {
-
- abort_trace(0);
-
- } else
-
- return;
-
- }
-
-
-
- PRIVATE clock_t ts;
-
-
- /* start the timer. Using clock ticks isn't exactly elegant, but it works */
- PUBLIC void
- timer_start(void)
- {
-
- ts = clock();
-
- }
-
-
-
- /*
- *
- stop the timer, and return difference in time, measured in tenth of
- * econds from last call to timer_start()
- */
- PUBLIC long
- timer_stop(void)
- {
-
- clock_t st;
-
-
- st = clock();
-
- return (long) ((10 * (st - ts)) / CLOCKS_PER_SEC);
-
- }
-
-
-
- /*
- *
- 131 == div by zer 129 == domain
- */
-
- PRIVATE void
- sigcatch(int sig, int type, int *reglist)
- {
-
- printf("trapped sig %d, type %d\n", sig, type);
-
- }
-
-
-
- PUBLIC void
- init_machine(void)
- {
-
- signal(SIGFPE, sigcatch);
-
- return;
-
- }
-
-
-
-
- /* this is used for debugging memory. */
- PUBLIC unsigned long
- memory_left(void)
- {
-
- return coreleft();
-
- }
-
-
-