--- gforth/engine/engine.c 2003/11/03 20:13:36 1.72 +++ gforth/engine/engine.c 2005/01/22 21:06:03 1.76 @@ -1,6 +1,6 @@ /* Gforth virtual machine (aka inner interpreter) - Copyright (C) 1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc. + Copyright (C) 1995,1996,1997,1998,2000,2003,2004 Free Software Foundation, Inc. This file is part of Gforth. @@ -160,12 +160,12 @@ extern int gforth_memcmp(const char * s1 #ifndef TOSREG #define TOSREG #endif -#ifndef spaREG -#define spaREG -#endif #ifndef spbREG #define spbREG #endif +#ifndef spcREG +#define spcREG +#endif #ifndef FTOSREG #define FTOSREG #endif @@ -190,7 +190,7 @@ extern int gforth_memcmp(const char * s1 #ifdef GFORTH_DEBUGGING #if DEBUG -#define NAME(string) { saved_ip=ip; asm(""); fprintf(stderr,"%08lx depth=%3ld: "string"\n",(Cell)ip,sp0+3-sp);} +#define NAME(string) { saved_ip=ip; asm("# "string); fprintf(stderr,"%08lx depth=%3ld: "string"\n",(Cell)ip,sp0+3-sp);} #else /* !DEBUG */ #define NAME(string) { saved_ip=ip; asm(""); } /* the asm here is to avoid reordering of following stuff above the @@ -202,7 +202,7 @@ extern int gforth_memcmp(const char * s1 #elif DEBUG # define NAME(string) {Cell __depth=sp0+3-sp; int i; fprintf(stderr,"%08lx depth=%3ld: "string,(Cell)ip,sp0+3-sp); for (i=__depth-1; i>0; i--) fprintf(stderr, " $%lx",sp[i]); fprintf(stderr, " $%lx\n",spTOS); } #else -# define NAME(string) +# define NAME(string) asm("# "string); #endif #ifdef DEBUG @@ -268,6 +268,7 @@ Label *engine(Xt *ip0, Cell *sp0, Cell * register Float *fp FPREG = fp0; register Address lp LPREG = lp0; register Xt cfa CFAREG; + register Label real_ca; #ifdef MORE_VARS MORE_VARS #endif @@ -282,8 +283,8 @@ Label *engine(Xt *ip0, Cell *sp0, Cell * #endif register Address up UPREG = UP; IF_spTOS(register Cell MAYBE_UNUSED spTOS TOSREG;) - register Cell MAYBE_UNUSED spb spaREG; - register Cell MAYBE_UNUSED spc spbREG; + register Cell MAYBE_UNUSED spb spbREG; + register Cell MAYBE_UNUSED spc spcREG; IF_fpTOS(register Float fpTOS FTOSREG;) #if defined(DOUBLY_INDIRECT) static Label *symbols; @@ -303,7 +304,9 @@ Label *engine(Xt *ip0, Cell *sp0, Cell * #define INST_ADDR(name) ((Label)&&J_##name) #include PRIM_LAB_I #undef INST_ADDR - (Label)&&after_last + (Label)&&after_last, + (Label)&&before_goto, + (Label)&&after_goto }; #ifdef CPU_DEP2 CPU_DEP2 @@ -354,6 +357,10 @@ Label *engine(Xt *ip0, Cell *sp0, Cell * CPU_DEP3 #endif + before_goto: + goto *real_ca; + after_goto: + #include PRIM_I after_last: return (Label *)0; /*needed only to get the length of the last primitive */