Diff for /gforth/engine/engine.c between versions 1.22 and 1.25

version 1.22, 2000/09/23 15:06:07 version 1.25, 2001/01/27 20:14:55
Line 16 Line 16
   
   You should have received a copy of the GNU General Public License    You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software    along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 */  */
   
 #include "config.h"  #include "config.h"
Line 72  struct F83Name { Line 72  struct F83Name {
   char          name[0];    char          name[0];
 };  };
   
 /* are macros for setting necessary? */  
 #define F83NAME_COUNT(np)       ((np)->countetc & 0x1f)  #define F83NAME_COUNT(np)       ((np)->countetc & 0x1f)
 #define F83NAME_SMUDGE(np)      (((np)->countetc & 0x40) != 0)  
 #define F83NAME_IMMEDIATE(np)   (((np)->countetc & 0x20) != 0)  struct Longname {
     struct Longname *next;  /* the link field for old hands */
     Cell          countetc;
     char          name[0];
   };
   
   #define LONGNAME_COUNT(np)      ((np)->countetc & (((~((UCell)0))<<3)>>3))
   
 Cell *SP;  Cell *SP;
 Float *FP;  Float *FP;
Line 273  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 278  Label *engine(Xt *ip0, Cell *sp0, Cell *
   MORE_VARS    MORE_VARS
 #endif  #endif
   register Address up UPREG = UP;    register Address up UPREG = UP;
   IF_TOS(register Cell TOS TOSREG;)    IF_spTOS(register Cell spTOS TOSREG;)
   IF_FTOS(register Float FTOS FTOSREG;)    IF_fpTOS(register Float fpTOS FTOSREG;)
 #if defined(DOUBLY_INDIRECT)  #if defined(DOUBLY_INDIRECT)
   static Label *symbols;    static Label *symbols;
   static void *routines[]= {    static void *routines[]= {
Line 327  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 332  Label *engine(Xt *ip0, Cell *sp0, Cell *
     return symbols;      return symbols;
   }    }
   
   IF_TOS(TOS = sp[0]);    IF_spTOS(spTOS = sp[0]);
   IF_FTOS(FTOS = fp[0]);    IF_fpTOS(fpTOS = fp[0]);
 /*  prep_terminal(); */  /*  prep_terminal(); */
   SET_IP(ip);    SET_IP(ip);
   NEXT;    NEXT;
Line 369  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 374  Label *engine(Xt *ip0, Cell *sp0, Cell *
     fprintf(stderr,"%08lx: con: %08lx\n",(Cell)ip,*(Cell*)PFA1(cfa));      fprintf(stderr,"%08lx: con: %08lx\n",(Cell)ip,*(Cell*)PFA1(cfa));
 #endif  #endif
 #ifdef USE_TOS  #ifdef USE_TOS
     *sp-- = TOS;      *sp-- = spTOS;
     TOS = *(Cell *)PFA1(cfa);      spTOS = *(Cell *)PFA1(cfa);
 #else  #else
     *--sp = *(Cell *)PFA1(cfa);      *--sp = *(Cell *)PFA1(cfa);
 #endif  #endif
Line 385  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 390  Label *engine(Xt *ip0, Cell *sp0, Cell *
     fprintf(stderr,"%08lx: var: %08lx\n",(Cell)ip,(Cell)PFA1(cfa));      fprintf(stderr,"%08lx: var: %08lx\n",(Cell)ip,(Cell)PFA1(cfa));
 #endif  #endif
 #ifdef USE_TOS  #ifdef USE_TOS
     *sp-- = TOS;      *sp-- = spTOS;
     TOS = (Cell)PFA1(cfa);      spTOS = (Cell)PFA1(cfa);
 #else  #else
     *--sp = (Cell)PFA1(cfa);      *--sp = (Cell)PFA1(cfa);
 #endif  #endif
Line 401  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 406  Label *engine(Xt *ip0, Cell *sp0, Cell *
     fprintf(stderr,"%08lx: user: %08lx\n",(Cell)ip,(Cell)PFA1(cfa));      fprintf(stderr,"%08lx: user: %08lx\n",(Cell)ip,(Cell)PFA1(cfa));
 #endif  #endif
 #ifdef USE_TOS  #ifdef USE_TOS
     *sp-- = TOS;      *sp-- = spTOS;
     TOS = (Cell)(up+*(Cell*)PFA1(cfa));      spTOS = (Cell)(up+*(Cell*)PFA1(cfa));
 #else  #else
     *--sp = (Cell)(up+*(Cell*)PFA1(cfa));      *--sp = (Cell)(up+*(Cell*)PFA1(cfa));
 #endif  #endif
Line 425  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 430  Label *engine(Xt *ip0, Cell *sp0, Cell *
 #ifdef DEBUG  #ifdef DEBUG
     fprintf(stderr,"%08lx: field: %08lx\n",(Cell)ip,(Cell)PFA1(cfa));      fprintf(stderr,"%08lx: field: %08lx\n",(Cell)ip,(Cell)PFA1(cfa));
 #endif  #endif
     TOS += *(Cell*)PFA1(cfa);      spTOS += *(Cell*)PFA1(cfa);
   }    }
   NEXT_P0;    NEXT_P0;
   NEXT;    NEXT;
Line 459  Label *engine(Xt *ip0, Cell *sp0, Cell * Line 464  Label *engine(Xt *ip0, Cell *sp0, Cell *
     *--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 */
 #ifdef USE_TOS  #ifdef USE_TOS
     *sp-- = TOS;      *sp-- = spTOS;
     TOS = (Cell)PFA(cfa);      spTOS = (Cell)PFA(cfa);
 #else  #else
     *--sp = (Cell)PFA(cfa);      *--sp = (Cell)PFA(cfa);
 #endif  #endif
     SET_IP(DOES_CODE1(cfa));      SET_IP(DOES_CODE1(cfa));
     /*    fprintf(stderr,"TOS = %08lx, IP=%08lx\n", TOS, IP);*/      /*    fprintf(stderr,"TOS = %08lx, IP=%08lx\n", spTOS, IP);*/
   }    }
   NEXT;    NEXT;
   

Removed from v.1.22  
changed lines
  Added in v.1.25


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>