};
int j;
- if(packflag_and_stacksize)
+ if(packflag)
{
for (j=0; rel2[j][0]!=0; j++)
{
else if (!strcmp(ap->a_id, "BSEG_BYTES")) { ap->a_addr=0x20; ap->a_type=1; }
else if (!strcmp(ap->a_id, "SSEG"))
{
- if(packflag_and_stacksize>1) ap->a_axp->a_size=packflag_and_stacksize;
+ if(stacksize) ap->a_axp->a_size=stacksize;
}
}
}
/*
* Link all area addresses.
*/
- if(!packflag_and_stacksize)
+ if(!packflag)
lnkarea();
else
lnkarea2();
if (sflag) /*JCF: memory usage summary output*/
{
- if(!packflag_and_stacksize)
+ if(!packflag)
{
if(summary(areap)) lkexit(1);
}
}
}
- if ((iram_size) && (!packflag_and_stacksize))
+ if ((iram_size) && (!packflag))
iramcheck();
/*
char fid[NINPUT];
while ((c = getnb()) != 0) {
+ if ( c == ';')
+ return(0);
if ( c == '-') {
while (ctype[c=get()] & LETTER) {
switch(c) {
case 'Y':
unget(getnb());
- /*The stack segment default size is 16 bytes. Use -Yxx for xx bytes*/
- packflag_and_stacksize=(ip && *ip)?expr(0):16;
+ packflag=1;
break;
+ case 'A':
+ unget(getnb());
+ if (ip && *ip)
+ {
+ stacksize=expr(0);
+ if(stacksize>256) stacksize=256;
+ else if(stacksize<0) stacksize=0;
+ }
+ return(0);
+
case 'j':
case 'J':
jflag = 1;
return(0);
case 'a':
- case 'A':
iramsav();
return(0);
lkexit(1);
}
}
+ if ( c == ';')
+ return(0);
} else
if (ctype[c] & ILL) {
fprintf(stderr, "Invalid input");
/*Look backward the name path and get rid of the extension, if any*/
i=strlen(fn);
- for(; (fn[i]!='.')&&(fn[i]!='\\')&&(fn[i]!='/')&&(i>=0); i--);
+ for(; (fn[i]!='.')&&(fn[i]!='\\')&&(fn[i]!='/')&&(i>0); i--);
if( (fn[i]=='.') && strcmp(ft, "lnk") )
{
strncpy(fb, fn, i);
}
/*Add the extension*/
- strcat(fb, ".");
- strcat(fb, strlen(ft)?ft:"rel");
+ if (fb[i] != '.')
+ {
+ strcat(fb, ".");
+ strcat(fb, strlen(ft)?ft:"rel");
+ }
fp = fopen(fb, omode);
if (fp==NULL)
" -v [xram-size] Check for external RAM overflow",
" -w [code-size] Check for code overflow",
" -y Generate memory usage summary file[mem]",
- " -Y [stack-size] Pack internal ram and allocate space for stack",
+ " -Y Pack internal ram",
+ " -A [stack-size] Allocate space for stack",
"End:",
" -e or null line terminates input",
0