commit
6a3ab7c9f4
@ -4690,7 +4690,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
|||||||
/* a variable */
|
/* a variable */
|
||||||
if (sym->parent!=NULL)
|
if (sym->parent!=NULL)
|
||||||
break; /* hierarchical data type */
|
break; /* hierarchical data type */
|
||||||
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK))==0) {
|
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC))==0) {
|
||||||
if (testconst)
|
if (testconst)
|
||||||
errorset(sSETPOS,sym->lnumber);
|
errorset(sSETPOS,sym->lnumber);
|
||||||
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
|
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
|
||||||
|
@ -1343,8 +1343,19 @@ static int command(void)
|
|||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
char s2[20];
|
|
||||||
extern char *sc_tokens[];/* forward declaration */
|
extern char *sc_tokens[];/* forward declaration */
|
||||||
|
char s2[33]="-";
|
||||||
|
if ((char)tok=='-') {
|
||||||
|
if (lex(&val,&str)==tNUMBER) {
|
||||||
|
outval(-val,FALSE);
|
||||||
|
code_idx+=opargs(1);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
strcpy(s2+1, str);
|
||||||
|
error(1,sc_tokens[tSYMBOL-tFIRST],s2);
|
||||||
|
break;
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
if (tok<256)
|
if (tok<256)
|
||||||
sprintf(s2,"%c",(char)tok);
|
sprintf(s2,"%c",(char)tok);
|
||||||
else
|
else
|
||||||
|
@ -747,7 +747,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
mainaddr=sym->addr;
|
mainaddr=sym->addr;
|
||||||
} /* if */
|
} /* if */
|
||||||
} else if (sym->ident==iVARIABLE) {
|
} else if (sym->ident==iVARIABLE) {
|
||||||
if ((sym->usage & uPUBLIC)!=0)
|
if ((sym->usage & uPUBLIC)!=0
|
||||||
|
&& ((sym->usage & uSTOCK)==0 || (sym->usage & (uREAD | uWRITTEN))!=0))
|
||||||
match=++numpubvars;
|
match=++numpubvars;
|
||||||
} /* if */
|
} /* if */
|
||||||
if (match) {
|
if (match) {
|
||||||
@ -925,6 +926,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
count=0;
|
count=0;
|
||||||
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
|
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
|
||||||
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0) {
|
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0) {
|
||||||
|
if ((sym->usage & uSTOCK)!=0 && (sym->usage & (uREAD | uWRITTEN))==0)
|
||||||
|
continue;
|
||||||
assert((sym->usage & uDEFINE)!=0);
|
assert((sym->usage & uDEFINE)!=0);
|
||||||
assert(sym->vclass==sGLOBAL);
|
assert(sym->vclass==sGLOBAL);
|
||||||
func.address=sym->addr;
|
func.address=sym->addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user