--- gforth/Attic/engine.c 1994/05/07 14:55:47 1.5 +++ gforth/Attic/engine.c 1994/07/07 14:59:21 1.9 @@ -1,5 +1,5 @@ /* - $Id: engine.c,v 1.5 1994/05/07 14:55:47 anton Exp $ + $Id: engine.c,v 1.9 1994/07/07 14:59:21 pazsan Exp $ Copyright 1992 by the ANSI figForth Development Group */ @@ -13,12 +13,10 @@ #include #include #include +#include #include "forth.h" #include "io.h" -extern unlink(char *); -extern ftruncate(int, int); - typedef union { struct { #ifdef BIG_ENDIAN @@ -72,10 +70,6 @@ typedef struct F83Name { #define FTOS (fp[0]) #endif -/* -#define CA_DODOES (symbols[DODOES]) -*/ - int emitcounter; #define NULLC '\0' @@ -89,7 +83,6 @@ static char* fileattr[6]={"r","rb","r+", Label *engine(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp) /* executes code at ip, if ip!=NULL returns array of machine code labels (for use in a loader), if ip==NULL - This is very preliminary, as the bootstrap architecture is not yet decided */ { Xt cfa; @@ -100,7 +93,7 @@ Label *engine(Xt *ip, Cell *sp, Cell *rp &&dovar, &&douser, &&dodoes, - &&docol, /* dummy for does handler address */ + &&dodoes, /* dummy for does handler address */ #include "prim_labels.i" }; IF_TOS(register Cell TOS;) @@ -119,7 +112,7 @@ Label *engine(Xt *ip, Cell *sp, Cell *rp docol: #ifdef DEBUG - printf("col: %x\n",(Cell)PFA1(cfa)); + printf("%08x: col: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); #endif #ifdef undefined /* this is the simple version */ @@ -143,7 +136,7 @@ Label *engine(Xt *ip, Cell *sp, Cell *rp docon: #ifdef DEBUG - printf("con: %x\n",*(Cell*)PFA1(cfa)); + printf("%08x: con: %08x\n",(Cell)ip,*(Cell*)PFA1(cfa)); #endif #ifdef USE_TOS *sp-- = TOS; @@ -155,7 +148,7 @@ Label *engine(Xt *ip, Cell *sp, Cell *rp dovar: #ifdef DEBUG - printf("var: %x\n",(Cell)PFA1(cfa)); + printf("%08x: var: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); #endif #ifdef USE_TOS *sp-- = TOS; @@ -169,7 +162,7 @@ Label *engine(Xt *ip, Cell *sp, Cell *rp douser: #ifdef DEBUG - printf("user: %x\n",(Cell)PFA1(cfa)); + printf("%08x: user: %08x\n",(Cell)ip,(Cell)PFA1(cfa)); #endif #ifdef USE_TOS *sp-- = TOS; @@ -198,7 +191,8 @@ Label *engine(Xt *ip, Cell *sp, Cell *rp */ #ifdef DEBUG - printf("does: %x\n",(Cell)PFA(cfa)); fflush(stdout); + printf("%08x/%08x: does: %08x\n",(Cell)ip,(Cell)cfa,*(Cell)PFA(cfa)); + fflush(stdout); #endif *--rp = (Cell)ip; /* PFA1 might collide with DOES_CODE1 here, so we use PFA */