X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/362ed7a6bd47f5d72276d92f01b694454e3d85bb..acd69f829eb787e980cd770e037afa18220c319a:/usr/src/old/as.vax/asparse.c?ds=inline diff --git a/usr/src/old/as.vax/asparse.c b/usr/src/old/as.vax/asparse.c index d8a8a968db..95ec161e94 100644 --- a/usr/src/old/as.vax/asparse.c +++ b/usr/src/old/as.vax/asparse.c @@ -1,5 +1,5 @@ /* Copyright (c) 1980 Regents of the University of California */ -static char sccsid[] = "@(#)asparse.c 4.5 %G%"; +static char sccsid[] = "@(#)asparse.c 4.7 %G%"; #include #include "as.h" #include "asexpr.h" @@ -78,6 +78,7 @@ int yyparse() int field_value; /*the value to stuff in a field*/ char *stabname; /*name of stab dealing with*/ ptrall stabstart; /*where the stab starts in the buffer*/ + int reloc_how; /* how to relocate expressions */ xp = explist; ap = arglist; @@ -364,18 +365,15 @@ restlab: if ((locxp->e_xtype&XTYPE)!=XABS) { if (bitoff) yyerror("Illegal relocation in field"); - field_width=LEN1; - if (curlen==NBPW) - field_width = LEN4; - if (curlen==NBPW/2) - field_width = LEN2; + switch(curlen){ + case NBPW/4: reloc_how = TYPB; break; + case NBPW/2: reloc_how = TYPW; break; + case NBPW: reloc_how = TYPL; break; + } if (passno == 1){ - dotp->e_xvalue += reflen[field_width]; + dotp->e_xvalue += ty_nbyte[reloc_how]; } else { - outrel(&locxp->e_xvalue, - field_width, - locxp->e_xtype, - locxp->e_xname); + outrel(locxp, reloc_how); } } else { field_value = locxp->e_xvalue & ( (1L << field_width)-1); @@ -548,7 +546,7 @@ restlab: * final expression is taken to be the current * location counter, and is patched by the 2nd pass * - * .stab{,}*8,, , , + * .stab{,}*NCPS,, , , * .stabn , , , * .stabs STRING, , , , * .stabd , , # . @@ -567,7 +565,7 @@ restlab: (char *)stabstart -= sizeof(struct symtab *); (char *)stabstart -= sizeof(toktype); shift; - for (argcnt = 0; argcnt < 8; argcnt++){ + for (argcnt = 0; argcnt < NCPS; argcnt++){ expr(locxp, val); stpt->s_name[argcnt] = locxp->e_xvalue; xp = explist; @@ -1047,3 +1045,19 @@ yyerror(s, a1, a2,a3,a4,a5) fprintf(sink, s, a1, a2,a3,a4,a5); fprintf(sink, "\n"); } + +/*VARARGS1*/ +yywarning(s, a1, a2,a3,a4,a5) + char *s; +{ + +#define sink stdout + + if (anyerrs == 0 && ! silent) + fprintf(sink, "Assembler:\n"); + if (silent) return; + + fprintf(sink, "\"%s\", line %d: WARNING: ", dotsname, lineno); + fprintf(sink, s, a1, a2,a3,a4,a5); + fprintf(sink, "\n"); +}