Diff for /gforth/Attic/engine.c between versions 1.10 and 1.12

version 1.10, 1994/07/08 15:00:35 version 1.12, 1994/08/25 15:25:21
Line 80  int emitcounter; Line 80  int emitcounter;
   
 static char* fileattr[6]={"r","rb","r+","r+b","w+","w+b"};  static char* fileattr[6]={"r","rb","r+","r+b","w+","w+b"};
   
   static Address up0=NULL;
   
 Label *engine(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp)  Label *engine(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp)
 /* executes code at ip, if ip!=NULL  /* executes code at ip, if ip!=NULL
    returns array of machine code labels (for use in a loader), if ip==NULL     returns array of machine code labels (for use in a loader), if ip==NULL
 */  */
 {  {
   Xt cfa;    Xt cfa;
   Address up=NULL;    Address up=up0;
   static Label symbols[]= {    static Label symbols[]= {
     &&docol,      &&docol,
     &&docon,      &&docon,
     &&dovar,      &&dovar,
     &&douser,      &&douser,
       &&dodefer,
     &&dodoes,      &&dodoes,
     &&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 105  Label *engine(Xt *ip, Cell *sp, Cell *rp Line 107  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]);
Line 186  Label *engine(Xt *ip, Cell *sp, Cell *rp Line 175  Label *engine(Xt *ip, Cell *sp, Cell *rp
 #endif  #endif
   NEXT;    NEXT;
       
    dodefer:
   #ifdef DEBUG
     printf("%08x: defer: %08x\n",(Cell)ip,(Cell)PFA1(cfa));
   #endif
     cfa = *(Xt *)PFA1(cfa);
     NEXT1;
   
  dodoes:   dodoes:
   /* this assumes the following structure:    /* this assumes the following structure:
      defining-word:       defining-word:

Removed from v.1.10  
changed lines
  Added in v.1.12


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