Diff for /gforth/engine/main.c between versions 1.52 and 1.53

version 1.52, 2002/01/05 22:59:00 version 1.53, 2002/01/14 08:40:24
Line 57 Line 57
 jmp_buf throw_jmp_buf;  jmp_buf throw_jmp_buf;
 #endif  #endif
   
 #if defined(DIRECT_THREADED)   #if defined(DIRECT_THREADED)
 #  define CA(n) (symbols[(n)])  /*#  define CA(n) (symbols[(n)])*/
   #  define CA(n) (symbols[(n)&~0x4000UL])
   #elif defined(DOUBLY_INDIRECT)
   /* #  define CA(n)      ((Cell)(symbols+((n)&~0x4000UL))) */
   #  define CA(n) ({Cell _n = (n); ((Cell)(((_n & 0x4000) ? symbols : xts)+(_n&~0x4000UL)));})
 #else  #else
 #  define CA(n) ((Cell)(symbols+(n)))  #  define CA(n) ((Cell)(symbols+((n)&~0x4000UL)))
 #endif  #endif
   
 #define maxaligned(n)   (typeof(n))((((Cell)n)+sizeof(Float)-1)&-sizeof(Float))  #define maxaligned(n)   (typeof(n))((((Cell)n)+sizeof(Float)-1)&-sizeof(Float))
Line 94  static int debug=0; Line 98  static int debug=0;
   
 ImageHeader *gforth_header;  ImageHeader *gforth_header;
 Label *vm_prims;  Label *vm_prims;
   #ifdef DOUBLY_INDIRECT
   Label *xts; /* same content as vm_prims, but should only be used for xts */
   #endif
   
 #ifdef MEMCMP_AS_SUBROUTINE  #ifdef MEMCMP_AS_SUBROUTINE
 int gforth_memcmp(const char * s1, const char * s2, size_t n)  int gforth_memcmp(const char * s1, const char * s2, size_t n)
Line 179  void relocate(Cell *image, const char *b Line 186  void relocate(Cell *image, const char *b
                      i, CF(image[i])); */                       i, CF(image[i])); */
 #if !defined(DOUBLY_INDIRECT)  #if !defined(DOUBLY_INDIRECT)
               if (((token | 0x4000) >= CF(DODOES)) && (token < -0x4000))                if (((token | 0x4000) >= CF(DODOES)) && (token < -0x4000))
                 fprintf(stderr,"Doer %d used in this image at $%lx is marked as Xt; executing this code will crash.\n",CF((token | 0x4000)),(long)&image[i],VERSION);                  fprintf(stderr,"Doer %d used in this image at $%lx is marked as Xt;\n executing this code will crash.\n",CF((token | 0x4000)),(long)&image[i],VERSION);
 #endif  #endif
               token |= 0x4000; /* only meaningful for hybrid engines */                if (CF((token | 0x4000))<max_symbols)
               if (CF(token)<max_symbols)  
                 image[i]=(Cell)CA(CF(token));                  image[i]=(Cell)CA(CF(token));
               else                else
                 fprintf(stderr,"Primitive %d used in this image at $%lx is not implemented by this\n engine (%s); executing this code will crash.\n",CF(token),(long)&image[i],VERSION);                  fprintf(stderr,"Primitive %d used in this image at $%lx is not implemented by this\n engine (%s); executing this code will crash.\n",CF(token),(long)&image[i],VERSION);
Line 634  Address loader(FILE *imagefile, char* fi Line 640  Address loader(FILE *imagefile, char* fi
             progname, (unsigned long)(header.checksum),(unsigned long)check_sum);              progname, (unsigned long)(header.checksum),(unsigned long)check_sum);
     exit(1);      exit(1);
   }    }
   #ifdef DOUBLY_INDIRECT
     ((ImageHeader *)imp)->xt_base = xts;
   #endif
   fclose(imagefile);    fclose(imagefile);
   
   alloc_stacks((ImageHeader *)imp);    alloc_stacks((ImageHeader *)imp);

Removed from v.1.52  
changed lines
  Added in v.1.53


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