struct sym *sp;
int j;
struct area *dseg_ap=NULL;
- struct sym *sp_dseg_s, *sp_dseg_l;
+ struct sym *sp_dseg_s=NULL, *sp_dseg_l=NULL;
for(j=0; j<256; j++) idatamap[j]=' ';
}
/*Compute the size of DSEG*/
- dseg_ap->a_addr=0;
- dseg_ap->a_size=0;
- for(j=0; j<0x80; j++) if(idatamap[j]!=' ') dseg_ap->a_size++;
- sp_dseg_s->s_addr=0;
- sp_dseg_l->s_addr=dseg_ap->a_size;
+ if(dseg_ap!=NULL)
+ {
+ dseg_ap->a_addr=0;
+ dseg_ap->a_size=0;
+ for(j=0; j<0x80; j++) if(idatamap[j]!=' ') dseg_ap->a_size++;
+ }
+ if(sp_dseg_s!=NULL) sp_dseg_s->s_addr=0;
+ if(sp_dseg_l!=NULL) sp_dseg_l->s_addr=dseg_ap->a_size;
#if 0
/*Print the memory map*/
for(j=0, size=0; j<ramlimit; j++)
if(idatamap[j]==fchar) size++;
+ if( (fchar=='S') && (stacksize==0) )
+ {
+ /*Search for the largest space available and use it for stack*/
+ for(j=0, k=0, taxp->a_size=0; j<ramlimit; j++)
+ {
+ if(idatamap[j]==' ')
+ {
+ if((++k)>(int)taxp->a_size) taxp->a_size=k;
+ }
+ else
+ {
+ k=0;
+ }
+ }
+ stacksize=taxp->a_size;
+ }
+
/*If more space required, release the previously allocated areax in
internal RAM and search for a bigger one*/
if((int)taxp->a_size>size)