version 1.12, 1998/12/08 22:03:06
|
version 1.13, 1998/12/13 23:30:02
|
Line 69 static UCell fsize=0;
|
Line 69 static UCell fsize=0;
|
static UCell lsize=0; |
static UCell lsize=0; |
int offset_image=0; |
int offset_image=0; |
int die_on_signal=0; |
int die_on_signal=0; |
|
#ifndef INCLUDE_IMAGE |
static int clear_dictionary=0; |
static int clear_dictionary=0; |
static int debug=0; |
|
static size_t pagesize=0; |
static size_t pagesize=0; |
|
#endif |
|
static int debug=0; |
char *progname; |
char *progname; |
|
|
/* image file format: |
/* image file format: |
Line 128 void relocate(Cell *image, const char *b
|
Line 130 void relocate(Cell *image, const char *b
|
/* printf("relocating %x[%x]\n", image, size); */ |
/* printf("relocating %x[%x]\n", image, size); */ |
|
|
for(k=0; k<=steps; k++) |
for(k=0; k<=steps; k++) |
for(j=0, bits=bitstring[k]; j<8; j++, i++, bits<<=1) { |
for(j=0, bits=bitstring[k]; j<RELINFOBITS; j++, i++, bits<<=1) { |
/* fprintf(stderr,"relocate: image[%d]\n", i);*/ |
/* fprintf(stderr,"relocate: image[%d]\n", i);*/ |
if(bits & 0x80) { |
if(bits & (1U << (RELINFOBITS-1))) { |
/* fprintf(stderr,"relocate: image[%d]=%d\n", i, image[i]);*/ |
/* fprintf(stderr,"relocate: image[%d]=%d\n", i, image[i]);*/ |
if((token=image[i])<0) |
if((token=image[i])<0) |
switch(token) |
switch(token) |
Line 294 int go_forth(Address image, int stack, C
|
Line 296 int go_forth(Address image, int stack, C
|
Cell *rp=(Cell *)(((ImageHeader *)image)->return_stack_base + rsize); |
Cell *rp=(Cell *)(((ImageHeader *)image)->return_stack_base + rsize); |
Address lp=((ImageHeader *)image)->locals_stack_base + lsize; |
Address lp=((ImageHeader *)image)->locals_stack_base + lsize; |
Xt *ip=(Xt *)(((ImageHeader *)image)->boot_entry); |
Xt *ip=(Xt *)(((ImageHeader *)image)->boot_entry); |
|
#ifdef SYSSIGNALS |
int throw_code; |
int throw_code; |
|
#endif |
|
|
/* ensure that the cached elements (if any) are accessible */ |
/* ensure that the cached elements (if any) are accessible */ |
IF_TOS(sp--); |
IF_TOS(sp--); |
Line 307 int go_forth(Address image, int stack, C
|
Line 311 int go_forth(Address image, int stack, C
|
get_winsize(); |
get_winsize(); |
#endif |
#endif |
|
|
|
#ifdef SYSSIGNALS |
install_signal_handlers(); /* right place? */ |
install_signal_handlers(); /* right place? */ |
|
|
if ((throw_code=setjmp(throw_jmp_buf))) { |
if ((throw_code=setjmp(throw_jmp_buf))) { |
static Cell signal_data_stack[8]; |
static Cell signal_data_stack[8]; |
static Cell signal_return_stack[8]; |
static Cell signal_return_stack[8]; |
static Float signal_fp_stack[1]; |
static Float signal_fp_stack[1]; |
|
|
signal_data_stack[7]=throw_code; |
signal_data_stack[7]=throw_code; |
|
|
return((int)engine(((ImageHeader *)image)->throw_entry,signal_data_stack+7, |
return((int)engine(((ImageHeader *)image)->throw_entry,signal_data_stack+7, |
signal_return_stack+8,signal_fp_stack,0)); |
signal_return_stack+8,signal_fp_stack,0)); |
} |
} |
|
#endif |
|
|
return((int)engine(ip,sp,rp,fp,lp)); |
return((int)engine(ip,sp,rp,fp,lp)); |
} |
} |
Line 608 extern const char reloc_bits[];
|
Line 614 extern const char reloc_bits[];
|
int main(int argc, char **argv, char **env) |
int main(int argc, char **argv, char **env) |
{ |
{ |
char *path = getenv("GFORTHPATH") ? : DEFAULTPATH; |
char *path = getenv("GFORTHPATH") ? : DEFAULTPATH; |
|
#ifndef INCLUDE_IMAGE |
char *imagename="gforth.fi"; |
char *imagename="gforth.fi"; |
FILE *image_file; |
FILE *image_file; |
#ifndef INCLUDE_IMAGE |
|
Address image; |
Address image; |
#endif |
#endif |
int retvalue; |
int retvalue; |
Line 670 int main(int argc, char **argv, char **e
|
Line 676 int main(int argc, char **argv, char **e
|
*p2='\0'; |
*p2='\0'; |
retvalue = go_forth(image, 4, environ); |
retvalue = go_forth(image, 4, environ); |
deprep_terminal(); |
deprep_terminal(); |
exit(retvalue); |
|
} |
} |
|
return retvalue; |
} |
} |