version 1.15, 1994/09/09 16:27:18
|
version 1.20, 1994/12/12 17:10:35
|
Line 1
|
Line 1
|
/* |
/* |
$Id$ |
|
Copyright 1992 by the ANSI figForth Development Group |
Copyright 1992 by the ANSI figForth Development Group |
*/ |
*/ |
|
|
Line 17
|
Line 16
|
#include "forth.h" |
#include "forth.h" |
#include "io.h" |
#include "io.h" |
|
|
|
#ifndef SEEK_SET |
|
/* should be defined in stdio.h, but some systems don't have it */ |
|
#define SEEK_SET 0 |
|
#endif |
|
|
typedef union { |
typedef union { |
struct { |
struct { |
#ifdef BIG_ENDIAN |
#ifdef WORDS_BIGENDIAN |
Cell high; |
Cell high; |
Cell low; |
Cell low; |
#else |
#else |
Line 180 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 184 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
CPU_DEP; |
CPU_DEP; |
#endif |
#endif |
|
|
|
#ifdef DEBUG |
|
fprintf(stderr,"ip=%x, sp=%x, rp=%x, fp=%x, lp=%x, up=%x\n", |
|
(unsigned)ip,(unsigned)sp,(unsigned)rp, |
|
(unsigned)fp,(unsigned)lp,(unsigned)up); |
|
#endif |
|
|
if (ip == NULL) |
if (ip == NULL) |
return symbols; |
return symbols; |
|
|
Line 190 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 200 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
|
|
docol: |
docol: |
#ifdef DEBUG |
#ifdef DEBUG |
printf("%08x: col: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
fprintf(stderr,"%08x: col: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
#endif |
#endif |
#ifdef CISC_NEXT |
#ifdef CISC_NEXT |
/* this is the simple version */ |
/* this is the simple version */ |
Line 215 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 225 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
|
|
docon: |
docon: |
#ifdef DEBUG |
#ifdef DEBUG |
printf("%08x: con: %08x\n",(Cell)ip,*(Cell*)PFA1(cfa)); |
fprintf(stderr,"%08x: con: %08x\n",(Cell)ip,*(Cell*)PFA1(cfa)); |
#endif |
#endif |
#ifdef USE_TOS |
#ifdef USE_TOS |
*sp-- = TOS; |
*sp-- = TOS; |
Line 227 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 237 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
|
|
dovar: |
dovar: |
#ifdef DEBUG |
#ifdef DEBUG |
printf("%08x: var: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
fprintf(stderr,"%08x: var: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
#endif |
#endif |
#ifdef USE_TOS |
#ifdef USE_TOS |
*sp-- = TOS; |
*sp-- = TOS; |
Line 241 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 251 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
|
|
douser: |
douser: |
#ifdef DEBUG |
#ifdef DEBUG |
printf("%08x: user: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
fprintf(stderr,"%08x: user: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
#endif |
#endif |
#ifdef USE_TOS |
#ifdef USE_TOS |
*sp-- = TOS; |
*sp-- = TOS; |
Line 253 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 263 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
|
|
dodefer: |
dodefer: |
#ifdef DEBUG |
#ifdef DEBUG |
printf("%08x: defer: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
fprintf(stderr,"%08x: defer: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); |
#endif |
#endif |
cfa = *(Xt *)PFA1(cfa); |
cfa = *(Xt *)PFA1(cfa); |
NEXT1; |
NEXT1; |
Line 277 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 287 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
|
|
*/ |
*/ |
#ifdef DEBUG |
#ifdef DEBUG |
printf("%08x/%08x: does: %08x\n",(Cell)ip,(Cell)cfa,*(Cell)PFA(cfa)); |
fprintf(stderr,"%08x/%08x: does: %08x\n",(Cell)ip,(Cell)PFA(cfa),(Cell)DOES_CODE1(cfa)); |
fflush(stdout); |
fflush(stderr); |
#endif |
#endif |
*--rp = (Cell)ip; |
*--rp = (Cell)ip; |
/* PFA1 might collide with DOES_CODE1 here, so we use PFA */ |
/* PFA1 might collide with DOES_CODE1 here, so we use PFA */ |
Line 290 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
Line 300 Label *engine(Xt *ip0, Cell *sp0, Cell *
|
*--sp = (Cell)PFA(cfa); |
*--sp = (Cell)PFA(cfa); |
#endif |
#endif |
NEXT; |
NEXT; |
|
|
#include "primitives.i" |
#include "primitives.i" |
} |
} |