| jmp_buf throw_jmp_buf; |
jmp_buf throw_jmp_buf; |
| #endif |
#endif |
| |
|
| #ifndef FUZZ |
|
| # define FUZZ 0x4000 |
|
| #endif |
|
| |
|
| #ifndef DEFAULTPATH |
#ifndef DEFAULTPATH |
| # define DEFAULTPATH "/usr/local/lib/gforth:." |
# define DEFAULTPATH "/usr/local/lib/gforth:." |
| #endif |
#endif |
| Cell preamblesize=0; |
Cell preamblesize=0; |
| Label *symbols=engine(0,0,0,0,0); |
Label *symbols=engine(0,0,0,0,0); |
| UCell check_sum=checksum(symbols); |
UCell check_sum=checksum(symbols); |
| Cell fuzz=FUZZ; /* 16 k fuzz to move fixed size images around */ |
|
| |
|
| static char* endianstring[]= { "big","little" }; |
static char* endianstring[]= { "big","little" }; |
| |
|
| |
|
| wholesize = preamblesize+dictsize+dsize+rsize+fsize+lsize; |
wholesize = preamblesize+dictsize+dsize+rsize+fsize+lsize; |
| imagesize = preamblesize+header.image_size+((header.image_size-1)/sizeof(Cell))/8+1; |
imagesize = preamblesize+header.image_size+((header.image_size-1)/sizeof(Cell))/8+1; |
| image=malloc((wholesize>imagesize?wholesize:imagesize)+fuzz); |
image=malloc((wholesize>imagesize?wholesize:imagesize)/*+sizeof(Float)*/); |
| /*image = maxaligned(image);*/ |
/*image = maxaligned(image);*/ |
| /* memset(image,0,wholesize); */ /* why? - anton */ |
memset(image,0,wholesize); /* why? - anton */ |
| |
|
| if(header.base==0) image += fuzz/2; |
|
| else if((UCell)(header.base - (Cell)image + preamblesize) < fuzz) |
|
| image = header.base - preamblesize; |
|
| |
|
| rewind(imagefile); /* fseek(imagefile,0L,SEEK_SET); */ |
rewind(imagefile); /* fseek(imagefile,0L,SEEK_SET); */ |
| fread(image,1,imagesize,imagefile); |
fread(image,1,imagesize,imagefile); |
| fclose(imagefile); |
fclose(imagefile); |
| |
|
| progname = argv[0]; |
progname = argv[0]; |
| if ((path=getenv("GFORTHPATH"))==NULL) |
if ((path=getenv("GFORTHPATH"))==NULL) |
| path = strcpy(malloc(strlen(DEFAULTPATH)+1),DEFAULTPATH); |
path = DEFAULTPATH; |
| opterr=0; |
opterr=0; |
| while (1) { |
while (1) { |
| int option_index=0; |
int option_index=0; |