arrays can now be public variables
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40132
This commit is contained in:
parent
0196df3cc9
commit
4f5f8dced9
@ -1678,8 +1678,10 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
|
|||||||
if (size > INT_MAX)
|
if (size > INT_MAX)
|
||||||
error(105); /* overflow, exceeding capacity */
|
error(105); /* overflow, exceeding capacity */
|
||||||
#endif
|
#endif
|
||||||
|
#if 0 /* We don't actually care */
|
||||||
if (ispublic)
|
if (ispublic)
|
||||||
error(56,name); /* arrays cannot be public */
|
error(56,name); /* arrays cannot be public */
|
||||||
|
#endif
|
||||||
dim[numdim++]=(int)size;
|
dim[numdim++]=(int)size;
|
||||||
} /* while */
|
} /* while */
|
||||||
assert(sc_curstates==0);
|
assert(sc_curstates==0);
|
||||||
@ -1857,7 +1859,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
|
|||||||
assert(sym!=NULL);
|
assert(sym!=NULL);
|
||||||
sc_curstates=0;
|
sc_curstates=0;
|
||||||
if (ispublic)
|
if (ispublic)
|
||||||
sym->usage|=uPUBLIC;
|
sym->usage|=uPUBLIC|uREAD;
|
||||||
if (fconst)
|
if (fconst)
|
||||||
sym->usage|=uCONST;
|
sym->usage|=uCONST;
|
||||||
if (fstock)
|
if (fstock)
|
||||||
|
@ -713,7 +713,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
assert(sym->vclass==sGLOBAL);
|
assert(sym->vclass==sGLOBAL);
|
||||||
mainaddr=sym->addr;
|
mainaddr=sym->addr;
|
||||||
} /* if */
|
} /* if */
|
||||||
} else if (sym->ident==iVARIABLE) {
|
} else if (sym->ident==iVARIABLE || sym->ident == iARRAY || sym->ident == iREFARRAY) {
|
||||||
if ((sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0)
|
if ((sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0)
|
||||||
match=++numpubvars;
|
match=++numpubvars;
|
||||||
} /* if */
|
} /* if */
|
||||||
@ -891,7 +891,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
/* write the public variables table */
|
/* write the public variables table */
|
||||||
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 && (sym->usage & (uREAD | uWRITTEN))!=0) {
|
if ((sym->ident==iVARIABLE || sym->ident==iARRAY || sym->ident==iREFARRAY)
|
||||||
|
&& (sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) {
|
||||||
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…
Reference in New Issue
Block a user