version 1.8, 1994/06/01 16:40:01
|
version 1.10, 1994/07/08 15:00:35
|
Line 14
|
Line 14
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <time.h> |
#include <time.h> |
#include <sys/time.h> |
#include <sys/time.h> |
#include <unistd.h> |
|
#include "forth.h" |
#include "forth.h" |
#include "io.h" |
#include "io.h" |
|
|
Line 97 Label *engine(Xt *ip, Cell *sp, Cell *rp
|
Line 96 Label *engine(Xt *ip, Cell *sp, Cell *rp
|
&&dodoes, /* dummy for does handler address */ |
&&dodoes, /* dummy for does handler address */ |
#include "prim_labels.i" |
#include "prim_labels.i" |
}; |
}; |
|
int throw_code; |
IF_TOS(register Cell TOS;) |
IF_TOS(register Cell TOS;) |
IF_FTOS(Float FTOS;) |
IF_FTOS(Float FTOS;) |
#ifdef CPU_DEP |
#ifdef CPU_DEP |
Line 106 Label *engine(Xt *ip, Cell *sp, Cell *rp
|
Line 106 Label *engine(Xt *ip, Cell *sp, Cell *rp
|
if (ip == NULL) |
if (ip == NULL) |
return symbols; |
return symbols; |
|
|
|
if ((throw_code=setjmp(throw_jmp_buf))) { |
|
static Cell signal_data_stack[8]; |
|
|
|
/* AFAIK, it's not guarateed that the registers have the right value |
|
after a longjump, so we avoid using the current values. |
|
If it were guaranteed that the registers keep their values, we could |
|
call a signal handler in Forth instead of doing the throw from C */ |
|
sp = &signal_data_stack[7]; |
|
TOS = throw_code; |
|
ip = throw_ip; |
|
NEXT; |
|
} |
|
|
IF_TOS(TOS = sp[0]); |
IF_TOS(TOS = sp[0]); |
IF_FTOS(FTOS = fp[0]); |
IF_FTOS(FTOS = fp[0]); |
prep_terminal(); |
prep_terminal(); |