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 TRUE 1
#define FALSE 0 #define FALSE 0
#define MAXBYTE 255
#define MAXSTRING 200 /* Maximum string length accepted */ #define MAXSTRING 200 /* Maximum string length accepted */
#define LOCLABSIZE 128 /* size of local label hash table */ #define LOCLABSIZE 128 /* size of local label hash table */
/* may not be smaller */ /* may not be smaller */

View file

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

View file

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