From 85f491555f5880b3d91076857a8fd6aa6c775a17 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 29 Apr 1987 14:54:16 +0000 Subject: [PATCH] now generates "uninitialized data" descriptors --- util/ass/ass00.h | 2 ++ util/ass/ass80.c | 6 ++++-- util/ass/assci.c | 32 +++++++++++++++++++++++++------- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/util/ass/ass00.h b/util/ass/ass00.h index 840d8204e..f1ed9c0f0 100644 --- a/util/ass/ass00.h +++ b/util/ass/ass00.h @@ -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 */ diff --git a/util/ass/ass80.c b/util/ass/ass80.c index 850d3e44e..649cd1581 100644 --- a/util/ass/ass80.c +++ b/util/ass/ass80.c @@ -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") ; } diff --git a/util/ass/assci.c b/util/ass/assci.c index f27c092b0..d4d7e7e43 100644 --- a/util/ass/assci.c +++ b/util/ass/assci.c @@ -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; {