now generates "uninitialized data" descriptors

This commit is contained in:
ceriel 1987-04-29 14:54:16 +00:00
parent 1dba69eb38
commit 85f491555f
3 changed files with 31 additions and 9 deletions

View file

@ -112,6 +112,8 @@ typedef union {
#define TRUE 1
#define FALSE 0
#define MAXBYTE 255
#define MAXSTRING 200 /* Maximum string length accepted */
#define LOCLABSIZE 128 /* size of local label hash table */
/* may not be smaller */

View file

@ -260,8 +260,6 @@ cons_t xgeta(f) FILE *f ; {
return val ;
}
#define MAXBYTE 255
int icount(size) {
int amount ;
amount=(dataoff-lastoff)/size ;
@ -286,6 +284,7 @@ setmode(mode) {
case DATA_ICON:
case DATA_FCON:
case DATA_UCON:
case DATA_BSS:
break ;
default:
return ;
@ -360,6 +359,9 @@ setmode(mode) {
case DATA_REP:
ext8(HEADREP) ;
break ;
case DATA_BSS:
ext8(HEADBSS) ;
break;
default:
fatal("Unknown mode in setmode") ;
}

View file

@ -737,6 +737,8 @@ extconst(n) cons_t n ; {
extbss(n) cons_t n ; {
cons_t objsize,amount ;
cons_t sv_argval;
int sv_tabval;
if ( n<=0 ) {
if ( n<0 ) werror("negative bss/hol size") ;
@ -752,15 +754,31 @@ extbss(n) cons_t n ; {
return;
}
if ( n%objsize != 0 ) error("BSS/HOL incompatible sizes");
putval();
amount= n/objsize ;
if ( amount>1 ) {
setmode(DATA_REP);
extadr(amount-1) ;
}
databytes +=n ;
sv_tabval = tabval;
sv_argval = argval;
getarg(sp_cst2);
if ( argval<0 || argval>1 ) error("illegal last argument") ;
databytes +=n ;
if (argval == 1) {
tabval = sv_tabval;
argval = sv_argval;
putval();
amount= n/objsize ;
if ( amount>1 ) {
setmode(DATA_REP);
extadr(amount-1) ;
}
}
else {
n = (n + wordsize - 1) / wordsize;
while (n > MAXBYTE) {
setmode(DATA_BSS);
ext8(MAXBYTE);
n -= MAXBYTE;
}
setmode(DATA_BSS);
ext8((int) n);
}
}
extloc(lbp) register locl_t *lbp; {