version 1.39, 1996/09/23 20:42:00
|
version 1.40, 1996/09/24 19:15:04
|
Line 39
|
Line 39
|
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 |
Line 165 Address loader(FILE *imagefile, char* fi
|
Line 169 Address loader(FILE *imagefile, char* fi
|
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" }; |
|
|
Line 220 Address loader(FILE *imagefile, char* fi
|
Line 225 Address loader(FILE *imagefile, char* fi
|
|
|
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)/*+sizeof(Float)*/); |
image=malloc((wholesize>imagesize?wholesize:imagesize)+fuzz); |
/*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); |