use struct nlist; change field names; vgrind format fixes
authorRobert R. Henry <henry@ucbvax.Berkeley.EDU>
Sat, 16 Aug 1980 09:04:25 +0000 (01:04 -0800)
committerRobert R. Henry <henry@ucbvax.Berkeley.EDU>
Sat, 16 Aug 1980 09:04:25 +0000 (01:04 -0800)
SCCS-vsn: old/as.vax/ascode.c 4.2
SCCS-vsn: old/as.vax/asexpr.c 4.2
SCCS-vsn: old/as.vax/asio.c 4.2
SCCS-vsn: old/as.vax/asjxxx.c 4.2
SCCS-vsn: old/as.vax/asmain.c 4.2
SCCS-vsn: old/as.vax/asparse.c 4.2
SCCS-vsn: old/as.vax/aspseudo.c 4.2
SCCS-vsn: old/as.vax/asscan.c 4.3
SCCS-vsn: old/as.vax/assyms.c 4.2
SCCS-vsn: old/as.vax/as.h 4.3
SCCS-vsn: old/as.vax/asexpr.h 4.2
SCCS-vsn: old/as.vax/asscan.h 4.3
SCCS-vsn: old/as.vax/assyms.h 4.2

13 files changed:
usr/src/old/as.vax/as.h
usr/src/old/as.vax/ascode.c
usr/src/old/as.vax/asexpr.c
usr/src/old/as.vax/asexpr.h
usr/src/old/as.vax/asio.c
usr/src/old/as.vax/asjxxx.c
usr/src/old/as.vax/asmain.c
usr/src/old/as.vax/asparse.c
usr/src/old/as.vax/aspseudo.c
usr/src/old/as.vax/asscan.c
usr/src/old/as.vax/asscan.h
usr/src/old/as.vax/assyms.c
usr/src/old/as.vax/assyms.h

index d380871..1d9a551 100644 (file)
@@ -1,12 +1,33 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* "@(#)as.h 4.2 %G%" */
+/* "@(#)as.h 4.3 %G%" */
 #ifdef VMS
 # define       vax     1
 # define       VAX     1
 #endif VMS
 
 #ifdef VMS
 # define       vax     1
 # define       VAX     1
 #endif VMS
 
-#define readonly
+#include <sys/types.h>
+#ifdef UNIX
+
+#ifdef FLEXNAMES
+#  include <a.out.h>
+#  include <stab.h>
+#else not FLEXNAMES
+#  include <olda.out.h>
+#  include <stab.h>
+#endif FLEXNAMES
+
+#endif UNIX 
+#ifdef VMS
+
+#ifdef UNIXDEVEL
+#  include <a.out.h>
+#else not UNIXDEVEL
+#  include <aout.h>
+#endif not UNIXDEVEL
+
+#endif VMS
 
 
+#define readonly
 #define        NINST           300
 
 #define        NEXP            20      /* max number of expr. terms per instruction */
 #define        NINST           300
 
 #define        NEXP            20      /* max number of expr. terms per instruction */
  *     Symbol table entries are used for both user defined symbols,
  *     and symbol slots generated to create the jxxx jump from
  *     slots.
  *     Symbol table entries are used for both user defined symbols,
  *     and symbol slots generated to create the jxxx jump from
  *     slots.
+ *     Caution: the instructions are stored in a shorter version
+ *     of the struct symtab, using all fields in sym_nm and
+ *     tag.  The fields used in sym_nm are carefully redeclared
+ *     in struct Instab and struct instab (see below).
+ *     If struct nlist gets changed, then Instab and instab may
+ *     have to be changed.
  */
 
  */
 
-#define symfirstfields char    *name;  unsigned char tag, type
-
 struct symtab{
 struct symtab{
-               symfirstfields;
-               short   ___hole;
-               char    ptype;          /*tag == NAME*/
-
-#define                jxbump  ptype           /*tag == JX..., how far to expand*/
-
-               char    other;          /*for stab info*/
-
-               short   desc;           /*tag == NAME*/
-
-#define                jxfear  desc            /*how far needs to be bumped*/
-
-               long    value;          /*address in the segment*/
-               char    jxoveralign;    /*if a JXXX, jumped over an align*/
-               short   index;          /*which segment*/
-               struct  symtab *dest;   /*if JXXX, where going to*/
+               struct  nlist   s_nm;
+               u_char  s_tag;          /* assembler tag */
+               u_char  s_ptype;        /* if tag == NAME */
+               u_char  s_jxoveralign;  /* if a JXXX, jumped over align */
+               short   s_index;        /* which segment */
+               struct  symtab *s_dest; /* if JXXX, where going to */
 #ifdef DJXXX
 #ifdef DJXXX
-               short   jxline;         /*source line of the jump from*/
+               short   s_jxline;       /* source line of the jump from */
 #endif
 };
 #endif
 };
-
-struct instab{
-       symfirstfields;
-
-#define                opcode type             /*use the same field as symtab.type*/
-
-       char    nargs;                  /*how many arguments*/
-       char    argtype[6];             /*argument type info*/
+/*
+ *     Redefinitions of the fields in symtab for
+ *     use when the symbol table entry marks a jxxx instruction.
+ */
+#define        s_jxbump        s_ptype         /* tag == JX..., how far to expand */
+#define        s_jxfear        s_desc          /* how far needs to be bumped */
+/*
+ *     Redefinitions of fields in the struct nlist for symbols so that
+ *     one saves typing, and so that they conform 
+ *     with the old naming conventions.
+ */
+#ifdef FLEXNAMES
+#define        s_name  s_nm.n_un.n_name        /* name pointer */
+#define        s_nmx   s_nm.n_un.n_strx        /* string table index */
+#else  not FLEXNAMES
+#define        s_name  s_nm.n_name
+#endif
+#define        s_type  s_nm.n_type             /* type of the symbol */
+#define        s_other s_nm.n_other            /* other information for sdb */
+#define        s_desc  s_nm.n_desc             /* type descriptor */
+#define        s_value s_nm.n_value            /* value of the symbol, or sdb delta */
+
+struct instab{
+       struct  nlist   s_nm;           /* instruction name, type (opcode) */
+       u_char  s_tag;                  
 };
 };
+/*
+ *     The fields nm.n_desc and nm.n_value total 6 bytes; this is
+ *     just enough for the 6 bytes describing the argument types.
+ *     We use a macro to define access to these 6 bytes, assuming that
+ *     they are allocated adjacently.
+ *     IF THE FORMAT OF STRUCT nlist CHANGES, THESE MAY HAVE TO BE CHANGED.
+ *
+ *     Instab is cleverly declared to look very much the combination of
+ *     a struct symtab and a struct nlist.
+ */
+struct Instab{
+#ifdef FLEXNAMES
+       char    *I_name;
+#else not FLEXNAMES
+       char    I_name[NCPS];
+#endif
+       u_char  I_opcode;
+       char    I_nargs;
+       char    I_args[6];
+       u_char  I_s_tag;
+};
+/*
+ *     Redefinitions of fields in the struct nlist for instructions so that
+ *     one saves typing, and conforms to the old naming conventions
+ */
+#define        i_opcode        s_nm.n_type     /* use the same field as symtab.type */
+#define        i_nargs         s_nm.n_other    /* number of arguments */
+#define        fetcharg(ptr, n) ((struct Instab *)ptr)->I_args[n]
 
 struct arg {                           /*one argument to an instruction*/
 
 struct arg {                           /*one argument to an instruction*/
-       char    atype;
-       char    areg1;
-       char    areg2;
-       char    dispsize;               /*usually d124, unless have B^, etc*/
-       struct  exp *xp;
+       char    a_atype;
+       char    a_areg1;
+       char    a_areg2;
+       char    a_dispsize;             /*usually d124, unless have B^, etc*/
+       struct  exp *a_xp;
 };
 
 struct exp {
 };
 
 struct exp {
-       long    xvalue;         /* MUST be the first field (look at union Double) */
-       long    yvalue;         /* MUST be second field; least sig word of a double */
-       char    xtype;
-       char    xloc;
-       struct  symtab *xname;
+       long    e_xvalue;               /* MUST be the first field (look at union Double) */
+       long    e_yvalue;               /* MUST be second field; least sig word of a double */
+       char    e_xtype;
+       char    e_xloc;
+       struct  symtab *e_xname;
 };
 
 };
 
-#define doub_MSW xvalue
-#define doub_LSW yvalue
+#define doub_MSW e_xvalue
+#define doub_LSW e_yvalue
 
 
-union Double {
+union  Double {
        struct{
                long    doub_MSW;
                long    doub_LSW;
        struct{
                long    doub_MSW;
                long    doub_LSW;
@@ -233,7 +293,7 @@ union Double {
        double  dvalue;
 };
 
        double  dvalue;
 };
 
-struct Quad {
+struct Quad {
        long    quad_low_long;
        long    quad_high_long;
 };
        long    quad_low_long;
        long    quad_high_long;
 };
@@ -274,8 +334,8 @@ struct Quad {
        extern  struct  symtab  *lastjxxx;      
 
 #ifdef VMS
        extern  struct  symtab  *lastjxxx;      
 
 #ifdef VMS
-       extern char     *vms_obj_ptr;           /* object buffer pointer */
-       extern char     sobuf[];                /* object buffer         */
+       extern  char    *vms_obj_ptr;           /* object buffer pointer */
+       extern  char    sobuf[];                /* object buffer         */
        extern  int     objfil;                 /* VMS object file descriptor */
 #endif VMS
 
        extern  int     objfil;                 /* VMS object file descriptor */
 #endif VMS
 
@@ -336,7 +396,7 @@ struct Quad {
         *      Information about the instructions
         */
        extern  struct  instab  *itab[NINST];   /*maps opcodes to instructions*/
         *      Information about the instructions
         */
        extern  struct  instab  *itab[NINST];   /*maps opcodes to instructions*/
-       extern  readonly struct instab instab[];
+       extern  readonly struct Instab instab[];
 
        extern  int     curlen;                 /*current literal storage size*/
        extern  int     d124;                   /*current pointer storage size*/
 
        extern  int     curlen;                 /*current literal storage size*/
        extern  int     d124;                   /*current pointer storage size*/
@@ -344,9 +404,9 @@ struct Quad {
        struct  symtab  **lookup();             /*argument in yytext*/
        struct  symtab  *symalloc();
 
        struct  symtab  **lookup();             /*argument in yytext*/
        struct  symtab  *symalloc();
 
-#define outb(val) {dotp->xvalue++; if (passno==2) bputc((val), (txtfil));}
+#define outb(val) {dotp->e_xvalue++; if (passno==2) bputc((val), (txtfil));}
 
 
-#define outs(cp, lg) dotp->xvalue += (lg); if (passno == 2) bwrite((cp), (lg), (txtfil))
+#define outs(cp, lg) dotp->e_xvalue += (lg); if (passno == 2) bwrite((cp), (lg), (txtfil))
 
 /*
  *     Most of the time, the argument to flushfield is a power of two constant,
 
 /*
  *     Most of the time, the argument to flushfield is a power of two constant,
index e5d9c50..ba0001f 100644 (file)
@@ -1,8 +1,6 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)ascode.c 4.1 %G%";
+static char sccsid[] = "@(#)ascode.c 4.2 %G%";
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <a.out.h>
 #include "as.h"
 #include "assyms.h"
 
 #include "as.h"
 #include "assyms.h"
 
@@ -20,7 +18,7 @@ insout(op, ap, nact)
                register struct instab  *ip;
                int                     i,nexp;
                ip = itab[op];
                register struct instab  *ip;
                int                     i,nexp;
                ip = itab[op];
-               nexp = ip->nargs;
+               nexp = ip->i_nargs;
                if (nact < nexp)
                        yyerror("Too few arguments");
                if (nact > nexp) {
                if (nact < nexp)
                        yyerror("Too few arguments");
                if (nact > nexp) {
@@ -31,7 +29,7 @@ insout(op, ap, nact)
                 *      Check argument compatability with instruction template
                 */
                for (ap2 = ap+nact, i = nact; --i >= 0;)
                 *      Check argument compatability with instruction template
                 */
                for (ap2 = ap+nact, i = nact; --i >= 0;)
-                       argcompat(--ap2, ip->argtype[i], i+1);
+                       argcompat(--ap2, fetcharg(ip, i), i+1);
        }
        if (jxxflg < 0)
                ijxout(op, ap, nact);
        }
        if (jxxflg < 0)
                ijxout(op, ap, nact);
@@ -44,7 +42,7 @@ argcompat(act, exp, i)
 {
        register        at,atm;
 
 {
        register        at,atm;
 
-       at = act->atype;
+       at = act->a_atype;
        atm = at & AMASK;
 
        if ( (exp & ACCB) && (!((atm == AEXP) || (atm == AIMM))) ){
        atm = at & AMASK;
 
        if ( (exp & ACCB) && (!((atm == AEXP) || (atm == AIMM))) ){
@@ -60,7 +58,7 @@ argcompat(act, exp, i)
                return;
        }
        if (at & AINDX) {
                return;
        }
        if (at & AINDX) {
-               if (act->areg2==017) {
+               if (act->a_areg2==017) {
                        yyerror("arg %d, PC used as index",i);
                        return;
                }
                        yyerror("arg %d, PC used as index",i);
                        return;
                }
@@ -72,7 +70,7 @@ argcompat(act, exp, i)
                        yyerror("arg %d, indexing a constant",i);
                        return;
                }
                        yyerror("arg %d, indexing a constant",i);
                        return;
                }
-               if (((atm==ADECR) || (atm==AINCR)) && (act->areg1==act->areg2)) {
+               if (((atm==ADECR) || (atm==AINCR)) && (act->a_areg1==act->a_areg2)) {
                        yyerror("arg %d, indexing with modified register",i);
                        return;
                }
                        yyerror("arg %d, indexing with modified register",i);
                        return;
                }
@@ -99,57 +97,55 @@ putins(op, ap, n)
        if (passno == 2)
                goto PASS2;
 
        if (passno == 2)
                goto PASS2;
 
-       dotp->xvalue += n+1;    /* 1 for the opcode, at least 1 per arg */
-       for (i=0; i<n; i++,ap++) {/* some args take more than 1 byte */
-           xtrab = 0;
-           a=ap->atype;
+       dotp->e_xvalue += n+1;          /* 1 for the opcode, at least 1 per arg */
+       for (i=0; i<n; i++,ap++) {      /* some args take more than 1 byte */
+           a = ap->a_atype;
            if (a & AINDX)
            if (a & AINDX)
-               dotp->xvalue++;
+               dotp->e_xvalue++;
            switch (a&~(AINDX|ASTAR)) {
                case AEXP: 
            switch (a&~(AINDX|ASTAR)) {
                case AEXP: 
-                       a = itab[op]->argtype[i];
+                       a = fetcharg(itab[op], i);
                        if (a == ACCB+TYPB)
                                break;
                        if (a==ACCB+TYPW){
                        if (a == ACCB+TYPB)
                                break;
                        if (a==ACCB+TYPW){
-                               dotp->xvalue++;
+                               dotp->e_xvalue++;
                                break;
                        }
                        /*
                         *      Reduces to PC relative
                         */
                                break;
                        }
                        /*
                         *      Reduces to PC relative
                         */
-                       xtrab++;
-                       dotp->xvalue += ap->dispsize;
+                       dotp->e_xvalue += ap->a_dispsize;
                        break;
                
                case ADISP: 
                        break;
                
                case ADISP: 
-                       xp=ap->xp;
-                       if ((xp->xtype&XTYPE)!=XABS || xp->xtype&XFORW){
-                               dotp->xvalue += ap->dispsize;
+                       xp=ap->a_xp;
+                       if ((xp->e_xtype&XTYPE)!=XABS || xp->e_xtype&XFORW){
+                               dotp->e_xvalue += ap->a_dispsize;
                                break;
                        }
                                break;
                        }
-                       if (xp->xvalue==0 && !(a&ASTAR))
+                       if (xp->e_xvalue==0 && !(a&ASTAR))
                                break;
                                break;
-                       dotp->xvalue++;
-                       if ((xp->xvalue<MINBYTE) || (xp->xvalue>MAXBYTE))
-                               dotp->xvalue++;
-                       if ((xp->xvalue<MINWORD) || (xp->xvalue>MAXWORD))
-                               dotp->xvalue += 2;
+                       dotp->e_xvalue++;
+                       if ((xp->e_xvalue<MINBYTE) || (xp->e_xvalue>MAXBYTE))
+                               dotp->e_xvalue++;
+                       if ((xp->e_xvalue<MINWORD) || (xp->e_xvalue>MAXWORD))
+                               dotp->e_xvalue += 2;
                        break;
 
                case AIMM: 
                        break;
 
                case AIMM: 
-                       if (ap->atype&ASTAR) a=TYPL;
+                       if (ap->a_atype&ASTAR) a=TYPL;
                        else {
                        else {
-                               a = itab[op]->argtype[i];
+                               a = fetcharg(itab[op], i);
                                if (a&ACCA)
                                        a = TYPL;
                                else
                                        a &= TYPMASK;
                                if (a&ACCA)
                                        a = TYPL;
                                else
                                        a &= TYPMASK;
-                               xp = ap->xp;
-                               if (   ((xp->xtype&XTYPE)==XABS)
-                                   && (!(xp->xtype&XFORW))
-                                   && (xp->xvalue>=0)
-                                   && (xp->xvalue<=63) 
-                                   && (xp->yvalue == 0)
+                               xp = ap->a_xp;
+                               if (   ((xp->e_xtype&XTYPE)==XABS)
+                                   && (!(xp->e_xtype&XFORW))
+                                   && (xp->e_xvalue>=0)
+                                   && (xp->e_xvalue<=63) 
+                                   && (xp->e_yvalue == 0)
                                    && (a != TYPD)
                                    && (a != TYPF)
                                )
                                    && (a != TYPD)
                                    && (a != TYPF)
                                )
@@ -158,23 +154,23 @@ putins(op, ap, n)
                        switch (a) {
                        case TYPD:
                        case TYPF:
                        switch (a) {
                        case TYPD:
                        case TYPF:
-                               if (   !(((xp->xtype&XTYPE)==XABS)
-                                   && (!(xp->xtype&XFORW))
+                               if (   !(((xp->e_xtype&XTYPE)==XABS)
+                                   && (!(xp->e_xtype&XFORW))
                                    && (slitflt(xp)))
                                ){
                                /* it is NOT short */
                                    && (slitflt(xp)))
                                ){
                                /* it is NOT short */
-                                       dotp->xvalue += ((a==TYPF)?
+                                       dotp->e_xvalue += ((a==TYPF)?
                                                4 : 8);
                                }
                                break;
                        case TYPQ: 
                                                4 : 8);
                                }
                                break;
                        case TYPQ: 
-                               dotp->xvalue += 8;break;
+                               dotp->e_xvalue += 8;break;
                        case TYPL:
                        case TYPL:
-                               dotp->xvalue += 4;break;
+                               dotp->e_xvalue += 4;break;
                        case TYPW: 
                        case TYPW: 
-                               dotp->xvalue += 2;break;
+                               dotp->e_xvalue += 2;break;
                        case TYPB: 
                        case TYPB: 
-                               dotp->xvalue += 1;break;
+                               dotp->e_xvalue += 1;break;
                        }       /*end of the switch on a*/
            }   /*end of the switch on the type*/
        }       /*end of looping for all arguments*/
                        }       /*end of the switch on a*/
            }   /*end of the switch on the type*/
        }       /*end of looping for all arguments*/
@@ -187,115 +183,115 @@ PASS2:
 #endif UNIX
 #ifdef VMS
        *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)op;
 #endif UNIX
 #ifdef VMS
        *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)op;
-       dotp->xvalue += 1;
+       dotp->e_xvalue += 1;
 #endif VMS
 
        for (i=0; i<n; i++,ap++) {/* now for the arguments */
 #endif VMS
 
        for (i=0; i<n; i++,ap++) {/* now for the arguments */
-               a=ap->atype;
-               xp=ap->xp;
+               a=ap->a_atype;
+               xp=ap->a_xp;
                xtrab=0;
                if (a&AINDX) {
 #ifdef UNIX
                xtrab=0;
                if (a&AINDX) {
 #ifdef UNIX
-                       { outb(0x40 | ap->areg2); }
+                       { outb(0x40 | ap->a_areg2); }
 #endif UNIX
 #ifdef VMS
                        { *vms_obj_ptr++ = -1;
 #endif UNIX
 #ifdef VMS
                        { *vms_obj_ptr++ = -1;
-                         *vms_obj_ptr++ = (0x40 | ap->areg2);
-                         dotp->xvalue += 1; }
+                         *vms_obj_ptr++ = (0x40 | ap->a_areg2);
+                         dotp->e_xvalue += 1; }
 #endif VMS
                        a &= ~AINDX;
                }
                if (a&ASTAR) {
 #endif VMS
                        a &= ~AINDX;
                }
                if (a&ASTAR) {
-                       ap->areg1 |= 0x10;
+                       ap->a_areg1 |= 0x10;
                        a &= ~ASTAR;
                }
                switch (a) {
                case AREG:              /* %r */
                        a &= ~ASTAR;
                }
                switch (a) {
                case AREG:              /* %r */
-                       ap->areg1 |= 0x50;
+                       ap->a_areg1 |= 0x50;
                        break; 
                case ABASE:             /* (%r) */
                        break; 
                case ABASE:             /* (%r) */
-                       ap->areg1 |= 0x60;
+                       ap->a_areg1 |= 0x60;
                        break; 
                case ADECR:             /* -(%r) */
                        break; 
                case ADECR:             /* -(%r) */
-                       ap->areg1 |= 0x70;
+                       ap->a_areg1 |= 0x70;
                        break; 
                case AINCR:             /* (%r) */
                        break; 
                case AINCR:             /* (%r) */
-                       ap->areg1 |= 0x80;
+                       ap->a_areg1 |= 0x80;
                        break;
                case AEXP: /* expr */
                        break;
                case AEXP: /* expr */
-                       a = itab[op]->argtype[i];
+                       a = fetcharg(itab[op], i);
                        if (a == ACCB+TYPB) {
                        if (a == ACCB+TYPB) {
-                               ap->areg1 = a = 
-                                       xp->xvalue - (dotp->xvalue + 1);
+                               ap->a_areg1 = a = 
+                                       xp->e_xvalue - (dotp->e_xvalue + 1);
                                if (a<MINBYTE || a>MAXBYTE)
                                        yyerror("Branch too far"); break;
                        }
                        if (a == ACCB+TYPW) {
                                if (a<MINBYTE || a>MAXBYTE)
                                        yyerror("Branch too far"); break;
                        }
                        if (a == ACCB+TYPW) {
-                               ap->areg1 = a = xp->xvalue
-                                       -= dotp->xvalue + 2;
-                               xp->xtype = XABS;
+                               ap->a_areg1 = a = xp->e_xvalue
+                                       -= dotp->e_xvalue + 2;
+                               xp->e_xtype = XABS;
                                if (a<MINWORD || a>MAXWORD) 
                                        yyerror("Branch too far");
                                if (a<MINWORD || a>MAXWORD) 
                                        yyerror("Branch too far");
-                               xp->xvalue = a>>8;
+                               xp->e_xvalue = a>>8;
                                xtrab = LEN1;
                                break;
                        }
                        /* reduces to expr(pc) mode */
                                xtrab = LEN1;
                                break;
                        }
                        /* reduces to expr(pc) mode */
-                       ap->areg1 |= (0xAF + mod124[ap->dispsize]);
-                       xtrab = len124[ap->dispsize]+PCREL;
+                       ap->a_areg1 |= (0xAF + mod124[ap->a_dispsize]);
+                       xtrab = len124[ap->a_dispsize]+PCREL;
                        break;
                
                case ADISP: /* expr(%r) */
                        break;
                
                case ADISP: /* expr(%r) */
-                       ap->areg1 |= 0xA0;
-                       if ((xp->xtype&XTYPE)!=XABS || xp->xtype&XFORW){
-                               ap->areg1 += mod124[ap->dispsize];
-                               xtrab=len124[ap->dispsize];
+                       ap->a_areg1 |= 0xA0;
+                       if ((xp->e_xtype&XTYPE)!=XABS || xp->e_xtype&XFORW){
+                               ap->a_areg1 += mod124[ap->a_dispsize];
+                               xtrab=len124[ap->a_dispsize];
                                break;
                        }
                                break;
                        }
-                       if (xp->xvalue==0 && !(ap->areg1&0x10)) {
-                               ap->areg1 ^= 0xC0;
+                       if (xp->e_xvalue==0 && !(ap->a_areg1&0x10)) {
+                               ap->a_areg1 ^= 0xC0;
                                break;
                        }
                        xtrab=LEN1;
                                break;
                        }
                        xtrab=LEN1;
-                       if ((xp->xvalue<MINBYTE) || (xp->xvalue>MAXBYTE)){
-                               ap->areg1 += 0x20;
+                       if ((xp->e_xvalue<MINBYTE) || (xp->e_xvalue>MAXBYTE)){
+                               ap->a_areg1 += 0x20;
                                xtrab=LEN2;
                        }
                                xtrab=LEN2;
                        }
-                       if ((xp->xvalue<MINWORD) || (xp->xvalue>MAXWORD)){
-                               ap->areg1 += 0x20;
+                       if ((xp->e_xvalue<MINWORD) || (xp->e_xvalue>MAXWORD)){
+                               ap->a_areg1 += 0x20;
                                xtrab=LEN4;
                        }
                        break;
                
                case AIMM:  /* $expr */
                                xtrab=LEN4;
                        }
                        break;
                
                case AIMM:  /* $expr */
-                       if (ap->atype&ASTAR)
+                       if (ap->a_atype&ASTAR)
                                a=TYPL;
                        else {
                                a=TYPL;
                        else {
-                               a = itab[op]->argtype[i];
+                               a = fetcharg(itab[op], i);
                                if (a&ACCA)
                                        a=TYPL;
                                else
                                        a &= TYPMASK;
                                if (a&ACCA)
                                        a=TYPL;
                                else
                                        a &= TYPMASK;
-                               if (    ( (xp->xtype&XTYPE) == XABS) 
-                                   && !(xp->xtype&XFORW)
-                                   &&  (xp->xvalue >= 0)
-                                   &&  (xp->xvalue <= 63)
-                                   &&  (xp->yvalue == 0)
+                               if (    ( (xp->e_xtype&XTYPE) == XABS) 
+                                   && !(xp->e_xtype&XFORW)
+                                   &&  (xp->e_xvalue >= 0)
+                                   &&  (xp->e_xvalue <= 63)
+                                   &&  (xp->e_yvalue == 0)
                                    &&  (a != TYPF)
                                    &&  (a != TYPD) ) {
                                    &&  (a != TYPF)
                                    &&  (a != TYPD) ) {
-                                       ap->areg1 = xp->xvalue;
+                                       ap->a_areg1 = xp->e_xvalue;
                                        break;
                                }
                        }
                                        break;
                                }
                        }
-                       ap->areg1 |= 0x8F;
+                       ap->a_areg1 |= 0x8F;
                        switch (a) {
                        case TYPD:
                        case TYPF:
                        switch (a) {
                        case TYPD:
                        case TYPF:
-                               if (   ((xp->xtype&XTYPE)==XABS)
-                                   && (!(xp->xtype&XFORW))
+                               if (   ((xp->e_xtype&XTYPE)==XABS)
+                                   && (!(xp->e_xtype&XFORW))
                                    && (slitflt(xp))
                                ){
                                    && (slitflt(xp))
                                ){
-                                       ap->areg1=extlitflt(xp);
+                                       ap->a_areg1=extlitflt(xp);
                                } else {
                                        xtrab = (a==TYPF) ? LEN4: LEN8;
                                }
                                } else {
                                        xtrab = (a==TYPF) ? LEN4: LEN8;
                                }
@@ -312,11 +308,11 @@ PASS2:
                 *      use the first byte to describe the argument
                 */
 #ifdef UNIX
                 *      use the first byte to describe the argument
                 */
 #ifdef UNIX
-               outb(ap->areg1);
+               outb(ap->a_areg1);
 #endif UNIX
 #ifdef VMS
 #endif UNIX
 #ifdef VMS
-               *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)(ap->areg1);
-               dotp->xvalue += 1;
+               *vms_obj_ptr++ = -1; *vms_obj_ptr++ = (char)(ap->a_areg1);
+               dotp->e_xvalue += 1;
                if ((vms_obj_ptr-sobuf) > 400) {
                        write(objfil,sobuf,vms_obj_ptr-sobuf);
                        vms_obj_ptr=sobuf+1;
                if ((vms_obj_ptr-sobuf) > 400) {
                        write(objfil,sobuf,vms_obj_ptr-sobuf);
                        vms_obj_ptr=sobuf+1;
@@ -330,6 +326,6 @@ PASS2:
                         *      immediately follow the field xvalue, which
                         *      they do.
                         */
                         *      immediately follow the field xvalue, which
                         *      they do.
                         */
-                       outrel(&xp->xvalue, xtrab, xp->xtype, xp->xname);
+                       outrel(&xp->e_xvalue, xtrab, xp->e_xtype, xp->e_xname);
        }       /*end of the for to pick up all arguments*/
 }
        }       /*end of the for to pick up all arguments*/
 }
index 9a24964..fa07f44 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asexpr.c 4.1 %G%";
+static char sccsid[] = "@(#)asexpr.c 4.2 %G%";
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include "as.h"
 #include "asexpr.h"
 
 #include "as.h"
 #include "asexpr.h"
 
@@ -57,81 +56,81 @@ combine(op, exp1, exp2)
        register struct exp *exp1, *exp2;
 {
        register        e1_type, e2_type;
        register struct exp *exp1, *exp2;
 {
        register        e1_type, e2_type;
-       register        type;
+       register        back_type;
 
        lastnam=0;                      /* kludge for jxxx instructions */
 
 
        lastnam=0;                      /* kludge for jxxx instructions */
 
-       e1_type = exp1->xtype&XTYPE;
-       e2_type = exp2->xtype&XTYPE;
+       e1_type = exp1->e_xtype&XTYPE;
+       e2_type = exp2->e_xtype&XTYPE;
 
 
-       if (exp1->xtype==XXTRN+XUNDEF)
+       if (exp1->e_xtype==XXTRN+XUNDEF)
                e1_type = XTXRN;
                e1_type = XTXRN;
-       if (exp2->xtype==XXTRN+XUNDEF)
+       if (exp2->e_xtype==XXTRN+XUNDEF)
                e2_type = XTXRN;
        if (passno==1)
                e2_type = XTXRN;
        if (passno==1)
-               if (exp1->xloc!=exp2->xloc && e1_type==e2_type)
+               if (exp1->e_xloc!=exp2->e_xloc && e1_type==e2_type)
                        e1_type = e2_type = XTXRN;      /* error on != loc ctrs */
        e1_type >>= 1;          /*dispose of the external (XXTRN) bit*/
        e2_type >>= 1;
 
        switch (op) {
        case PLUS:
                        e1_type = e2_type = XTXRN;      /* error on != loc ctrs */
        e1_type >>= 1;          /*dispose of the external (XXTRN) bit*/
        e2_type >>= 1;
 
        switch (op) {
        case PLUS:
-               exp1->xvalue += exp2->xvalue;
-               type = pltab[e1_type][e2_type];
+               exp1->e_xvalue += exp2->e_xvalue;
+               back_type = pltab[e1_type][e2_type];
                break;
        case MINUS:
                break;
        case MINUS:
-               exp1->xvalue -= exp2->xvalue;
-               type = mintab[e1_type][e2_type];
+               exp1->e_xvalue -= exp2->e_xvalue;
+               back_type = mintab[e1_type][e2_type];
                break;
        case IOR:
                break;
        case IOR:
-               exp1->xvalue |= exp2->xvalue;
+               exp1->e_xvalue |= exp2->e_xvalue;
                goto comm;
        case XOR:
                goto comm;
        case XOR:
-               exp1->xvalue ^= exp2->xvalue;
+               exp1->e_xvalue ^= exp2->e_xvalue;
                goto comm;
        case AND:
                goto comm;
        case AND:
-               exp1->xvalue &= exp2->xvalue;
+               exp1->e_xvalue &= exp2->e_xvalue;
                goto comm;
        case ORNOT:
                goto comm;
        case ORNOT:
-               exp1->xvalue |= ~exp2->xvalue;
+               exp1->e_xvalue |= ~exp2->e_xvalue;
                goto comm;
        case LSH:
                goto comm;
        case LSH:
-               exp1->xvalue <<= exp2->xvalue;
+               exp1->e_xvalue <<= exp2->e_xvalue;
                goto comm;
        case RSH:
                goto comm;
        case RSH:
-               exp1->xvalue >>= exp2->xvalue;
+               exp1->e_xvalue >>= exp2->e_xvalue;
                goto comm;
        case TILDE:
                goto comm;
        case TILDE:
-               exp1->xvalue |= ~ exp2->xvalue;
+               exp1->e_xvalue |= ~ exp2->e_xvalue;
                goto comm;
        case MUL:
                goto comm;
        case MUL:
-               exp1->xvalue *= exp2->xvalue;
+               exp1->e_xvalue *= exp2->e_xvalue;
                goto comm;
        case DIV:
                goto comm;
        case DIV:
-               if (exp2->xvalue == 0)
+               if (exp2->e_xvalue == 0)
                        yyerror("Divide check");
                else
                        yyerror("Divide check");
                else
-                       exp1->xvalue /= exp2->xvalue;
+                       exp1->e_xvalue /= exp2->e_xvalue;
                goto comm;
        case REGOP:
                goto comm;
        case REGOP:
-               if (exp2->xvalue == 0)
+               if (exp2->e_xvalue == 0)
                        yyerror("Divide check (modulo)");
                else
                        yyerror("Divide check (modulo)");
                else
-                       exp1->xvalue %= exp2->xvalue;
+                       exp1->e_xvalue %= exp2->e_xvalue;
                goto comm;
        
        comm:
                goto comm;
        
        comm:
-               type = othtab[e1_type][e2_type];
+               back_type = othtab[e1_type][e2_type];
                break;
        default:
                yyerror("Internal error: unknown operator");
        }
 
        if (e2_type==(XTXRN>>1))
                break;
        default:
                yyerror("Internal error: unknown operator");
        }
 
        if (e2_type==(XTXRN>>1))
-               exp1->xname = exp2->xname;
-       exp1->xtype = type | (
-                       (exp1->xtype|exp2->xtype) & (XFORW|XXTRN) );
-       if (type==ERR)
+               exp1->e_xname = exp2->e_xname;
+       exp1->e_xtype = back_type | (
+                       (exp1->e_xtype|exp2->e_xtype) & (XFORW|XXTRN) );
+       if (back_type==ERR)
                yyerror("Relocation error");
        return(exp1);
 }
                yyerror("Relocation error");
        return(exp1);
 }
@@ -257,15 +256,15 @@ struct exp *factor()
                op = val;
                shift;
                lexpr = xp++;
                op = val;
                shift;
                lexpr = xp++;
-               lexpr->xtype = XABS;
-               lexpr->xvalue = 0;
+               lexpr->e_xtype = XABS;
+               lexpr->e_xvalue = 0;
                lexpr = combine(op, lexpr, factor());
        }
        else {
                yyerror("Bad expression syntax");
                lexpr = xp++;
                lexpr = combine(op, lexpr, factor());
        }
        else {
                yyerror("Bad expression syntax");
                lexpr = xp++;
-               lexpr->xtype = XABS;
-               lexpr->xvalue = 0;
+               lexpr->e_xtype = XABS;
+               lexpr->e_xvalue = 0;
        }
        return(lexpr);
 }
        }
        return(lexpr);
 }
@@ -282,7 +281,7 @@ struct exp *yukkyexpr(val, np)
        if (val == NAME || val == BFINT){
                if (val == BFINT) {
                        int off = 0;
        if (val == NAME || val == BFINT){
                if (val == BFINT) {
                        int off = 0;
-                       yylval = ((struct exp *)np)->xvalue;
+                       yylval = ((struct exp *)np)->e_xvalue;
                        if (yylval < 0) {
                                yylval = -yylval;
                                yylval--;
                        if (yylval < 0) {
                                yylval = -yylval;
                                yylval--;
@@ -298,21 +297,21 @@ struct exp *yukkyexpr(val, np)
                        lastnam = (struct symtab *)np;
                }
                exprisname++;
                        lastnam = (struct symtab *)np;
                }
                exprisname++;
-               locxp->xtype = ((struct symtab *)np)->type;
-               if (( ((struct symtab *)np)->type&XTYPE)==XUNDEF) { /*forward*/
-                       locxp->xname = (struct symtab *)np;
-                       locxp->xvalue = 0;
+               locxp->e_xtype = ((struct symtab *)np)->s_type;
+               if (( ((struct symtab *)np)->s_type&XTYPE)==XUNDEF) { /*forward*/
+                       locxp->e_xname = (struct symtab *)np;
+                       locxp->e_xvalue = 0;
                        if (passno==1)
                        if (passno==1)
-                               ((struct symtab *)np)->type |= XFORW;
+                               ((struct symtab *)np)->s_type |= XFORW;
                } else {        /*otherwise, just get the value*/
                } else {        /*otherwise, just get the value*/
-                       locxp->xvalue = ((struct symtab *)np)->value;
-                       locxp->xname = NULL;
+                       locxp->e_xvalue = ((struct symtab *)np)->s_value;
+                       locxp->e_xname = NULL;
                }
        } else {        /*INSTn or INST0 or REG*/
                }
        } else {        /*INSTn or INST0 or REG*/
-               locxp->xtype = XABS;
-               locxp->xvalue = ( (int)np) & 0xFF;
-               locxp->xloc = 0;
-               locxp->xname = NULL;
+               locxp->e_xtype = XABS;
+               locxp->e_xvalue = ( (int)np) & 0xFF;
+               locxp->e_xloc = 0;
+               locxp->e_xname = NULL;
        }
 
        return(locxp);
        }
 
        return(locxp);
index c3ebd6b..2246ffa 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* "@(#)asexpr.h 4.1 %G%" */
+/* "@(#)asexpr.h 4.2 %G%" */
 /*
  *     Definitions to parse tokens
  */
 /*
  *     Definitions to parse tokens
  */
@@ -45,13 +45,13 @@ struct      exp     *yukkyexpr();
 
 extern char    tokensets[(LASTTOKEN) - (FIRSTTOKEN) + 1];
 
 
 extern char    tokensets[(LASTTOKEN) - (FIRSTTOKEN) + 1];
 
-#define LINSTBEGIN     01      /*SEMI, NL, NAME*/
+#define        LINSTBEGIN      01      /*SEMI, NL, NAME*/
 #define        EBEGOPS         02      /*LP, MINUS, TILDE*/
 #define        EBEGOPS         02      /*LP, MINUS, TILDE*/
-#define        YUKKYEXPRBEG    04      /*NAME, INSTn, INST0, REG, DOT*/
+#define        YUKKYEXPRBEG    04      /*NAME, INSTn, INST0, REG, BFINT*/
 #define        SAFEEXPRBEG     010     /*INT, FLTNUM*/
 #define        SAFEEXPRBEG     010     /*INT, FLTNUM*/
-#define ADDOPS         020     /*PLUS, MINUS*/
+#define        ADDOPS          020     /*PLUS, MINUS*/
 #define        BOOLOPS         040     /*IOR, XOR, AND*/
 #define        BOOLOPS         040     /*IOR, XOR, AND*/
-#define MULOPS         0100    /*LSH, RSH, MUL, DIV, TILDE*/
+#define        MULOPS          0100    /*LSH, RSH, MUL, DIV, TILDE*/
 
 #define        INTOKSET(val, set)      (tokensets[(val)] & (set) )
 
 
 #define        INTOKSET(val, set)      (tokensets[(val)] & (set) )
 
index d9f1a31..873b92a 100644 (file)
@@ -1,7 +1,6 @@
 /* Coypright (c) 1980 Regents of the University of California */
 /* Coypright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asio.c 4.1 %G%";
+static char sccsid[] = "@(#)asio.c 4.2 %G%";
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include "as.h"
 /*
  *     Block I/O routines for logical I/O concurrently in
 #include "as.h"
 /*
  *     Block I/O routines for logical I/O concurrently in
index a416426..a3d4a45 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asjxxx.c 4.1 %G%";
+static char sccsid[] = "@(#)asjxxx.c 4.2 %G%";
 #include       <stdio.h>
 #include       <stdio.h>
-#include       <sys/types.h>
 #include       "as.h"
 #include       "assyms.h"
 
 #include       "as.h"
 #include       "assyms.h"
 
@@ -42,23 +41,23 @@ ijxout(op,ap,nact)
                 */
                putins(op,ap,nact); 
                jumpfrom = lastjxxx;
                 */
                putins(op,ap,nact); 
                jumpfrom = lastjxxx;
-               jumpfrom->tag = JXACTIVE;
-               jumpfrom->jxbump = 0;
+               jumpfrom->s_tag = JXACTIVE;
+               jumpfrom->s_jxbump = 0;
                if (op == JBR)
                if (op == JBR)
-                       jumpfrom->jxfear = JBRFSIZE;
+                       jumpfrom->s_jxfear = JBRFSIZE;
                else
                else
-                       jumpfrom->jxfear = JXXXFSIZE;
+                       jumpfrom->s_jxfear = JXXXFSIZE;
                if (lastnam == 0)
                        yyerror("jxxx destination not a label");
                if (lastnam == 0)
                        yyerror("jxxx destination not a label");
-               jumpfrom->dest = lastnam;
-               jumpfrom->type = dotp->xtype;   /*only TEXT or DATA*/
-               jumpfrom->index = dotp-usedot;
+               jumpfrom->s_dest = lastnam;
+               jumpfrom->s_type = dotp->e_xtype;       /*only TEXT or DATA*/
+               jumpfrom->s_index = dotp-usedot;
                /*
                 *      value ALWAYS (ALWAYS!!!) indexes the next instruction
                 *      after the jump, even in the jump must be exploded
                 *      (bumped)
                 */
                /*
                 *      value ALWAYS (ALWAYS!!!) indexes the next instruction
                 *      after the jump, even in the jump must be exploded
                 *      (bumped)
                 */
-               jumpfrom->value = dotp->xvalue;
+               jumpfrom->s_value = dotp->e_xvalue;
                njxxx++;
        } else {/* pass2, resolve */
                /*
                njxxx++;
        } else {/* pass2, resolve */
                /*
@@ -70,25 +69,25 @@ ijxout(op,ap,nact)
                register struct arg     *aplast;
 
                aplast = ap + nact - 1;
                register struct arg     *aplast;
 
                aplast = ap + nact - 1;
-               xp = aplast->xp;
-               if (lastjxxx->tag == JXTUNNEL){
-                       lastjxxx->tag = JXINACTIVE;
-                       tunnel = lastjxxx->dest;
-                       xp->xvalue = tunnel->value      /*index of instruction following*/
+               xp = aplast->a_xp;
+               if (lastjxxx->s_tag == JXTUNNEL){
+                       lastjxxx->s_tag = JXINACTIVE;
+                       tunnel = lastjxxx->s_dest;
+                       xp->e_xvalue = tunnel->s_value  /*index of instruction following*/
                                    - 3                 /* size of brw + word*/
                                    - 3                 /* size of brw + word*/
-                                   + ( ( (tunnel->jxfear == JBRFSIZE) &&
-                                         (tunnel->jxbump == 0))?1:0);
+                                   + ( ( (tunnel->s_jxfear == JBRFSIZE) &&
+                                         (tunnel->s_jxbump == 0))?1:0);
                                                        /*non bumped branch byteis only 2 back*/
                }
                                                        /*non bumped branch byteis only 2 back*/
                }
-               if (lastjxxx->jxbump == 0){     /*wasn't bumped, so is short form*/
+               if (lastjxxx->s_jxbump == 0){   /*wasn't bumped, so is short form*/
                        putins(op, ap, nact);
                } else {
                        if (op != JBR){ /*branch reverse conditional byte over 
                                          branch unconditional word*/
                        putins(op, ap, nact);
                } else {
                        if (op != JBR){ /*branch reverse conditional byte over 
                                          branch unconditional word*/
-                               oxvalue = xp->xvalue;
-                               xp->xvalue = lastjxxx->value;
+                               oxvalue = xp->e_xvalue;
+                               xp->e_xvalue = lastjxxx->s_value;
                                putins(op^1, ap, nact);
                                putins(op^1, ap, nact);
-                               xp->xvalue = oxvalue;
+                               xp->e_xvalue = oxvalue;
                        }
                        putins(BRW, aplast, 1);
                }
                        }
                        putins(BRW, aplast, 1);
                }
@@ -100,16 +99,16 @@ jalign(xp, sp)
        register struct symtab *sp;
 {
        register        int     mask;
        register struct symtab *sp;
 {
        register        int     mask;
-       if (xp->xtype != XABS || xp->xvalue < 0 || xp->xvalue > 16) {
+       if (xp->e_xtype != XABS || xp->e_xvalue < 0 || xp->e_xvalue > 16) {
                yyerror("Illegal `align' argument");
                return;
        }
        flushfield(NBPW/4);
        if (passno == 1) {
                yyerror("Illegal `align' argument");
                return;
        }
        flushfield(NBPW/4);
        if (passno == 1) {
-               sp->tag = JXALIGN;
-               sp->jxfear = (1 << xp->xvalue) - 1;
-               sp->type = dotp->xtype;
-               sp->index = dotp-usedot;
+               sp->s_tag = JXALIGN;
+               sp->s_jxfear = (1 << xp->e_xvalue) - 1;
+               sp->s_type = dotp->e_xtype;
+               sp->s_index = dotp-usedot;
                /*
                 *      We guess that the align will take up at least one
                 *      byte in the code output.  We will correct for this
                /*
                 *      We guess that the align will take up at least one
                 *      byte in the code output.  We will correct for this
@@ -123,19 +122,19 @@ jalign(xp, sp)
                 *      the code stream point to the next byte following
                 *      the logical entry in the symbol table
                 */
                 *      the code stream point to the next byte following
                 *      the logical entry in the symbol table
                 */
-               dotp->xvalue += 1;
-               sp->value = dotp->xvalue;
+               dotp->e_xvalue += 1;
+               sp->s_value = dotp->e_xvalue;
                njxxx++;
        } else {
                njxxx++;
        } else {
-               mask = (1 << xp->xvalue) - 1;
-               while (dotp->xvalue & mask){
+               mask = (1 << xp->e_xvalue) - 1;
+               while (dotp->e_xvalue & mask){
 #ifdef UNIX
                        outb(0);
 #endif UNIX
 #ifdef VMS
                        *vms_obj_ptr++ = -1;
                        *vms_obj_ptr++ = 0;
 #ifdef UNIX
                        outb(0);
 #endif UNIX
 #ifdef VMS
                        *vms_obj_ptr++ = -1;
                        *vms_obj_ptr++ = 0;
-                       dotp->xvalue += 1;
+                       dotp->e_xvalue += 1;
 #endif VMS
                }
        }
 #endif VMS
                }
        }
@@ -189,26 +188,26 @@ jxxxfix()
                 */
                tunnel = 0;     /*initially, no tunnel*/
                SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){
                 */
                tunnel = 0;     /*initially, no tunnel*/
                SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){
-                       tag = jumpfrom->tag;
+                       tag = jumpfrom->s_tag;
                        if (tag <= IGNOREBOUND)
                                continue;       /*just an ordinary symbol*/
                        if (tag == JXALIGN){
                                tunnel = 0;     /*avoid tunneling across a flex alocation*/
                                continue;       /*we take care of these later*/
                        }
                        if (tag <= IGNOREBOUND)
                                continue;       /*just an ordinary symbol*/
                        if (tag == JXALIGN){
                                tunnel = 0;     /*avoid tunneling across a flex alocation*/
                                continue;       /*we take care of these later*/
                        }
-                       if (   jumpfrom->jxfear == JBRFSIZE     /*unconditional*/
+                       if (   jumpfrom->s_jxfear == JBRFSIZE   /*unconditional*/
                            || (   tag == JXINACTIVE            /*inactive bumped*/
                            || (   tag == JXINACTIVE            /*inactive bumped*/
-                               && (jumpfrom->jxbump != 0)
+                               && (jumpfrom->s_jxbump != 0)
                               )
                           ) tunnel = jumpfrom;
                        if (tag != JXACTIVE)
                                continue;
                               )
                           ) tunnel = jumpfrom;
                        if (tag != JXACTIVE)
                                continue;
-                       dest = jumpfrom->dest;
-                       if (jumpfrom->index != dest->index){
+                       dest = jumpfrom->s_dest;
+                       if (jumpfrom->s_index != dest->s_index){
                                yyerror("Intersegment jxxx");
                                continue;
                        }
                                yyerror("Intersegment jxxx");
                                continue;
                        }
-                       displ = dest->value - jumpfrom->value;
+                       displ = dest->s_value - jumpfrom->s_value;
                        if (displ < MINBYTE || displ > MAXBYTE) {
                                /*
                                 *      This is an immediate lose!
                        if (displ < MINBYTE || displ > MAXBYTE) {
                                /*
                                 *      This is an immediate lose!
@@ -222,27 +221,27 @@ jxxxfix()
                                 *      its relative position will be unaffected
                                 *      by future jxxx expansions.
                                 */
                                 *      its relative position will be unaffected
                                 *      by future jxxx expansions.
                                 */
-                               if (    (jumpfrom->jxfear > JBRFSIZE)
+                               if (    (jumpfrom->s_jxfear > JBRFSIZE)
                                     && (tunnel) 
                                     && (tunnel) 
-                                    && (tunnel->dest == jumpfrom->dest)        
-                                    && (tunnel->index == jumpfrom->index)
-                                    && (tunnel->value - jumpfrom->value >=
+                                    && (tunnel->s_dest == jumpfrom->s_dest)    
+                                    && (tunnel->s_index == jumpfrom->s_index)
+                                    && (tunnel->s_value - jumpfrom->s_value >=
                                                MINBYTE + JXXXFSIZE)
                                   ) {
                                                /*
                                                 *      tunnelling is OK
                                                 */
                                                MINBYTE + JXXXFSIZE)
                                   ) {
                                                /*
                                                 *      tunnelling is OK
                                                 */
-                                               jumpfrom->dest = tunnel;
+                                               jumpfrom->s_dest = tunnel;
                                                /*
                                                 * no bumping needed, this
                                                 * is now effectively inactive
                                                 * but must be remembered
                                                 */
                                                /*
                                                 * no bumping needed, this
                                                 * is now effectively inactive
                                                 * but must be remembered
                                                 */
-                                               jumpfrom->tag = JXTUNNEL;
+                                               jumpfrom->s_tag = JXTUNNEL;
 #ifdef DEBUG
                                                if(debug)
                                                printf("Tunnel from %s from line %d\n",
 #ifdef DEBUG
                                                if(debug)
                                                printf("Tunnel from %s from line %d\n",
-                                                       jumpfrom->name, lineno);
+                                                       jumpfrom->s_name, lineno);
 #endif
                                                continue;
                                } else {        /*tunneling not possible*/
 #endif
                                                continue;
                                } else {        /*tunneling not possible*/
@@ -253,7 +252,7 @@ jxxxfix()
                                         *      as a tunnel
                                         */
                                        tunnel = jumpfrom;
                                         *      as a tunnel
                                         */
                                        tunnel = jumpfrom;
-                                       jumpfrom->tag = JXNOTYET;
+                                       jumpfrom->s_tag = JXNOTYET;
                                        ++nchange;
                                        continue;
                                }
                                        ++nchange;
                                        continue;
                                }
@@ -264,19 +263,19 @@ jxxxfix()
                        if (displ >= 0) {
                                SEGITERATE(segno, cojumpfrom + 1,0,cointdest,
                                                intdest, ubintdest, ++){
                        if (displ >= 0) {
                                SEGITERATE(segno, cojumpfrom + 1,0,cointdest,
                                                intdest, ubintdest, ++){
-                                       if (intdest->value > dest->value) 
+                                       if (intdest->s_value > dest->s_value) 
                                                break; /* beyond destination */
                                                break; /* beyond destination */
-                                       if (intdest->tag <= JXQUESTIONABLE)
+                                       if (intdest->s_tag <= JXQUESTIONABLE)
                                                continue;       /*frozen solid*/
                                                continue;       /*frozen solid*/
-                                       if (intdest->tag == JXALIGN){
-                                               jumpfrom->jxoveralign = 1;
+                                       if (intdest->s_tag == JXALIGN){
+                                               jumpfrom->s_jxoveralign = 1;
                                                badjxalign++;
                                        }
                                        /*
                                         *      we assume the worst case
                                         *      for unfrozen jxxxxes
                                         */
                                                badjxalign++;
                                        }
                                        /*
                                         *      we assume the worst case
                                         *      for unfrozen jxxxxes
                                         */
-                                       displ += intdest->jxfear;
+                                       displ += intdest->s_jxfear;
                                }
                                if (displ <= MAXBYTE){
                                        /*
                                }
                                if (displ <= MAXBYTE){
                                        /*
@@ -284,7 +283,7 @@ jxxxfix()
                                         *      can't hurt us, so forget about
                                         *      this jump
                                         */
                                         *      can't hurt us, so forget about
                                         *      this jump
                                         */
-                                       jumpfrom->tag = JXINACTIVE;
+                                       jumpfrom->s_tag = JXINACTIVE;
                                } else {
                                        stillactives++;
                                }
                                } else {
                                        stillactives++;
                                }
@@ -294,18 +293,18 @@ jxxxfix()
                         */
                                SEGITERATE(segno, cojumpfrom - 1,1,cointdest,
                                  intdest, ubintdest, --){
                         */
                                SEGITERATE(segno, cojumpfrom - 1,1,cointdest,
                                  intdest, ubintdest, --){
-                                       if (intdest->value <= dest->value) 
+                                       if (intdest->s_value <= dest->s_value) 
                                                break; /* beyond destination */
                                                break; /* beyond destination */
-                                       if (intdest->tag <= JXQUESTIONABLE)
+                                       if (intdest->s_tag <= JXQUESTIONABLE)
                                                continue;       /*frozen solid*/
                                                continue;       /*frozen solid*/
-                                       if (intdest->tag == JXALIGN){
-                                               jumpfrom->jxoveralign = 1;
+                                       if (intdest->s_tag == JXALIGN){
+                                               jumpfrom->s_jxoveralign = 1;
                                                badjxalign++;
                                        }
                                                badjxalign++;
                                        }
-                                       displ -= intdest->jxfear; 
+                                       displ -= intdest->s_jxfear; 
                                }
                                if (displ >= MINBYTE) {
                                }
                                if (displ >= MINBYTE) {
-                                       jumpfrom->tag = JXINACTIVE;
+                                       jumpfrom->s_tag = JXINACTIVE;
                                } else {
                                        stillactives++;
                                }
                                } else {
                                        stillactives++;
                                }
@@ -334,8 +333,8 @@ jxxxfix()
                        if (stillactives){
                                SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
                                    ubjumpfrom, ++){
                        if (stillactives){
                                SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
                                    ubjumpfrom, ++){
-                                       if (jumpfrom->tag == JXACTIVE){
-                                               jumpfrom->tag =
+                                       if (jumpfrom->s_tag == JXACTIVE){
+                                               jumpfrom->s_tag =
                                                  badjxalign?JXNOTYET:JXINACTIVE;
                                        }
                                }
                                                  badjxalign?JXNOTYET:JXINACTIVE;
                                        }
                                }
@@ -348,35 +347,35 @@ jxxxfix()
                         */
                        SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
                           ubjumpfrom, ++){
                         */
                        SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
                           ubjumpfrom, ++){
-                           if (jumpfrom->tag == JXALIGN){
+                           if (jumpfrom->s_tag == JXALIGN){
                                /*
                                 *      Predict the true displacement
                                 *      needed, irregardless of the
                                 *      fact that we guessed 1
                                 */
                                /*
                                 *      Predict the true displacement
                                 *      needed, irregardless of the
                                 *      fact that we guessed 1
                                 */
-                               displ = (jumpfrom->value - 1) & (unsigned)jumpfrom->jxfear;
+                               displ = (jumpfrom->s_value - 1) & (unsigned)jumpfrom->s_jxfear;
                                if (displ == 0){        /*no virtual displacement*/
                                if (displ == 0){        /*no virtual displacement*/
-                                       jumpfrom->jxfear = -1;
+                                       jumpfrom->s_jxfear = -1;
                                } else {
                                } else {
-                                       jumpfrom->jxfear = (jumpfrom->jxfear + 1) - displ;
+                                       jumpfrom->s_jxfear = (jumpfrom->s_jxfear + 1) - displ;
                                        /*
                                        /*
-                                        *      assert jumpfrom->jxfear > 0
+                                        *      assert jumpfrom->s_jxfear > 0
                                         */
                                         */
-                                       if (jumpfrom->jxfear == 1){
+                                       if (jumpfrom->s_jxfear == 1){
                                                /*our prediction was correct*/
                                                continue;
                                        }
                                        /*
                                                /*our prediction was correct*/
                                                continue;
                                        }
                                        /*
-                                        *      assert jumpfrom->jxfear > 1
+                                        *      assert jumpfrom->s_jxfear > 1
                                         */
                                         */
-                                       jumpfrom->jxfear -= 1;  /*correct guess*/
+                                       jumpfrom->s_jxfear -= 1;        /*correct guess*/
                                }
                                /*
                                }
                                /*
-                                *      assert jumpfrom->jxfear = -1, +1...2**n-1
+                                *      assert jumpfrom->s_jxfear = -1, +1...2**n-1
                                 */
                                 */
-                               jumpfrom->tag = JXNOTYET;       /*signal*/
+                               jumpfrom->s_tag = JXNOTYET;     /*signal*/
                                jxxxbump(segno, cojumpfrom);
                                jxxxbump(segno, cojumpfrom);
-                               jumpfrom->tag = JXINACTIVE;
+                               jumpfrom->s_tag = JXINACTIVE;
                                /*
                                 *      Assert jxfrom->jxvalue indexes the first
                                 *      code byte after the added bytes, and
                                /*
                                 *      Assert jxfrom->jxvalue indexes the first
                                 *      code byte after the added bytes, and
@@ -411,20 +410,20 @@ jxxxbump(segno, starthint)
 
        cum_bump = 0;
        SEGITERATE(segno, starthint, 0, cosp, sp, ub, ++){
 
        cum_bump = 0;
        SEGITERATE(segno, starthint, 0, cosp, sp, ub, ++){
-               tag = sp->tag;
+               tag = sp->s_tag;
                if (tag == JXNOTYET){
 #ifdef DEBUG
                        if (debug){
                if (tag == JXNOTYET){
 #ifdef DEBUG
                        if (debug){
-                       if (sp->dest != 0)
+                       if (sp->s_dest != 0)
                                printf("Explode jump to %s on line %d\n",
                                printf("Explode jump to %s on line %d\n",
-                                       sp->dest->name, lineno);
+                                       sp->s_dest->s_name, lineno);
                        else
                                printf("Explode an align!\n");
                        }
 #endif
                        else
                                printf("Explode an align!\n");
                        }
 #endif
-                       sp->tag = JXINACTIVE;
-                       sp->jxbump = 1;
-                       cum_bump += sp->jxfear;
+                       sp->s_tag = JXINACTIVE;
+                       sp->s_jxbump = 1;
+                       cum_bump += sp->s_jxfear;
                }
                /*
                 *      Only bump labels and jxxxes. Ignored entries can
                }
                /*
                 *      Only bump labels and jxxxes. Ignored entries can
@@ -433,7 +432,7 @@ jxxxbump(segno, starthint)
                 *      pass.
                 */
                if (tag >= OKTOBUMP)    /*only bump labels and jxxxes and floating stabs*/
                 *      pass.
                 */
                if (tag >= OKTOBUMP)    /*only bump labels and jxxxes and floating stabs*/
-                       sp->value += cum_bump;
+                       sp->s_value += cum_bump;
        }
        }
-       usedot[segno].xvalue += cum_bump;
+       usedot[segno].e_xvalue += cum_bump;
 }
 }
index d22a9c5..f1a04ac 100644 (file)
@@ -1,10 +1,8 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asmain.c 4.1 %G%";
+static char sccsid[] = "@(#)asmain.c 4.2 %G%";
 #include <stdio.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <ctype.h>
-#include <sys/types.h>
 #include <signal.h>
 #include <signal.h>
-#include <a.out.h>
 
 #include "as.h"
 #include "assyms.h"
 
 #include "as.h"
 #include "assyms.h"
@@ -12,11 +10,11 @@ static      char sccsid[] = "@(#)asmain.c 4.1 %G%";
 #include "asscan.h"
 
 #ifdef UNIX
 #include "asscan.h"
 
 #ifdef UNIX
-#define        unix_lang_name "VAX/UNIX Assembler V3.0"
+#define        unix_lang_name "VAX/UNIX Assembler Vasmain.c"
 #endif
 
 #ifdef VMS
 #endif
 
 #ifdef VMS
-#define vms_lang_name "VAX/VMS C assembler V1.00"
+#define vms_lang_name "VAX/VMS C Assembler V1.00"
 #endif VMS
 
 /*
 #endif VMS
 
 /*
@@ -317,12 +315,12 @@ zeroorigins()
         *      the next for named data segments.
         */
        for (locindex = 0; locindex < NLOC; locindex++){
         *      the next for named data segments.
         */
        for (locindex = 0; locindex < NLOC; locindex++){
-               usedot[locindex].xtype = XTEXT;
-               usedot[NLOC + locindex].xtype = XDATA;
-               usedot[locindex].xvalue = 0;
-               usedot[NLOC + locindex].xvalue = 0;
-               usedot[locindex].yvalue = 0;
-               usedot[NLOC + locindex].yvalue = 0;
+               usedot[locindex].e_xtype = XTEXT;
+               usedot[NLOC + locindex].e_xtype = XDATA;
+               usedot[locindex].e_xvalue = 0;
+               usedot[NLOC + locindex].e_xvalue = 0;
+               usedot[locindex].e_yvalue = 0;
+               usedot[NLOC + locindex].e_yvalue = 0;
        }
 }
 
        }
 }
 
@@ -432,8 +430,8 @@ roundsegments()
         */
        tsize = 0;
        for (locindex=0; locindex<NLOC; locindex++) {
         */
        tsize = 0;
        for (locindex=0; locindex<NLOC; locindex++) {
-               v = round(usedot[locindex].xvalue, FW);
-               usedot[locindex].xvalue = tsize;
+               v = round(usedot[locindex].e_xvalue, FW);
+               usedot[locindex].e_xvalue = tsize;
                if ((locindex == 0) || (v != 0) ){
                        usefile[locindex] = (BFILE *)Calloc(1, sizeof(BFILE));
                        bopen(usefile[locindex], a_out_off);
                if ((locindex == 0) || (v != 0) ){
                        usefile[locindex] = (BFILE *)Calloc(1, sizeof(BFILE));
                        bopen(usefile[locindex], a_out_off);
@@ -450,8 +448,8 @@ roundsegments()
         */
        datbase = round(tsize, PAGRND);
        for (locindex=0; locindex<NLOC; locindex++) {
         */
        datbase = round(tsize, PAGRND);
        for (locindex=0; locindex<NLOC; locindex++) {
-               v = round(usedot[NLOC+locindex].xvalue, FW);
-               usedot[NLOC+locindex].xvalue = datbase + dsize;
+               v = round(usedot[NLOC+locindex].e_xvalue, FW);
+               usedot[NLOC+locindex].e_xvalue = datbase + dsize;
                if (v != 0){
                        usefile[NLOC + locindex] = (BFILE *)Calloc(1,sizeof(BFILE));
                        bopen(usefile[NLOC + locindex], a_out_off);
                if (v != 0){
                        usefile[NLOC + locindex] = (BFILE *)Calloc(1,sizeof(BFILE));
                        bopen(usefile[NLOC + locindex], a_out_off);
@@ -540,7 +538,7 @@ fillsegments()
                if (usefile[locindex]) {
                        txtfil = usefile[locindex];
                        dotp = &usedot[locindex];
                if (usefile[locindex]) {
                        txtfil = usefile[locindex];
                        dotp = &usedot[locindex];
-                       while (usedot[locindex].xvalue & FW)
+                       while (usedot[locindex].e_xvalue & FW)
                                outb(0);
                }
        }
                                outb(0);
                }
        }
index 64159c6..e35a178 100644 (file)
@@ -1,18 +1,6 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asparse.c 4.1 %G%";
+static char sccsid[] = "@(#)asparse.c 4.2 %G%";
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/types.h>
-#ifdef UNIX
-#  include <a.out.h>
-#endif UNIX
-
-#ifdef VMS
-#  ifdef UNIXDEVEL
-#      include <a.out.h>
-#  else VMSDEVEL
-#      include <aout.h>
-#  endif
-#endif VMS
 #include "as.h"
 #include "asexpr.h"
 #include "asscan.h"
 #include "as.h"
 #include "asexpr.h"
 #include "asscan.h"
@@ -98,7 +86,7 @@ int   yyparse()
 
        while (INTOKSET(val, LINSTBEGIN)){
                if (val == INT) {
 
        while (INTOKSET(val, LINSTBEGIN)){
                if (val == INT) {
-                       int i = ((struct exp *)yylval)->xvalue;
+                       int i = ((struct exp *)yylval)->e_xvalue;
                        shift;
                        if (val != COLON)
                                goto nocolon;
                        shift;
                        if (val != COLON)
                                goto nocolon;
@@ -128,43 +116,59 @@ int       yyparse()
                        shiftover(NAME);
 nocolon:
                        if (val != COLON) {
                        shiftover(NAME);
 nocolon:
                        if (val != COLON) {
+#ifdef FLEXNAMES
                                yyerror("\"%s\" is not followed by a ':' for a label definition",
                                yyerror("\"%s\" is not followed by a ':' for a label definition",
-                                       np->name);
+#else not FLEXNAMES
+                               yyerror("\"%.*s\" is not followed by a ':' for a label definition",
+                                       NCPS,
+#endif not FLEXNAMES
+                                       np->s_name);
                                goto  errorfix;
                        }
 restlab:
                        shift;
                        flushfield(NBPW/4);
                                goto  errorfix;
                        }
 restlab:
                        shift;
                        flushfield(NBPW/4);
-                       if ((np->type&XTYPE)!=XUNDEF) {
-                               if(  (np->type&XTYPE)!=dotp->xtype 
-                                  || np->value!=dotp->xvalue
+                       if ((np->s_type&XTYPE)!=XUNDEF) {
+                               if(  (np->s_type&XTYPE)!=dotp->e_xtype 
+                                  || np->s_value!=dotp->e_xvalue
                                   || (  (passno==1)
                                   || (  (passno==1)
-                                      &&(np->index != dotp->xloc)
+                                      &&(np->s_index != dotp->e_xloc)
                                      )
                                  ){
 #ifndef DEBUG
                                      )
                                  ){
 #ifndef DEBUG
-                                       if (np->name[0] != 'L')
+                                       if (np->s_name[0] != 'L')
 #endif not DEBUG
                                        {
                                                if (passno == 1)
 #endif not DEBUG
                                        {
                                                if (passno == 1)
-                                                 yyerror("%.8s redefined", np->name);
+#ifdef FLEXNAMES
+                                                 yyerror("%s redefined",
+#else not FLEXNAMES
+                                                 yyerror("%.*s redefined",
+                                                       NCPS,
+#endif not FLEXNAMES 
+                                                       np->s_name);
                                                else
                                                else
-                                                 yyerror("%.8s redefined: PHASE ERROR, 1st: %d, 2nd: %d",
-                                                  np->name,
-                                                  np->value,
-                                                  dotp->xvalue);
+#ifdef FLEXNAMES
+                                                 yyerror("%s redefined: PHASE ERROR, 1st: %d, 2nd: %d",
+#else not FLEXNAMES
+                                                 yyerror("%.*s redefined: PHASE ERROR, 1st: %d, 2nd: %d",
+                                                       NCPS,
+#endif not FLEXNAMES
+                                                       np->s_name,
+                                                       np->s_value,
+                                                       dotp->e_xvalue);
                                        }
                                }
                        }
                                        }
                                }
                        }
-                       np->type &= ~(XTYPE|XFORW);
-                       np->type |= dotp->xtype;
-                       np->value = dotp->xvalue;
+                       np->s_type &= ~(XTYPE|XFORW);
+                       np->s_type |= dotp->e_xtype;
+                       np->s_value = dotp->e_xvalue;
                        if (passno == 1){
                        if (passno == 1){
-                               np->index = dotp-usedot;
-                               if (np->name[0] == 'L'){
+                               np->s_index = dotp-usedot;
+                               if (np->s_name[0] == 'L'){
                                        nlabels++;
                                }
                                        nlabels++;
                                }
-                               np->tag = LABELID;
+                               np->s_tag = LABELID;
                        }
                }       /*end of this being a label*/
        }       /*end of to consuming all labels, NLs and SEMIS */ 
                        }
                }       /*end of this being a label*/
        }       /*end of to consuming all labels, NLs and SEMIS */ 
@@ -206,7 +210,7 @@ restlab:
    case ILINENO:
        shift;          /*over the ILINENO*/
        expr(locxp, val);
    case ILINENO:
        shift;          /*over the ILINENO*/
        expr(locxp, val);
-       lineno = locxp->xvalue;
+       lineno = locxp->e_xvalue;
        break;
 
    case ISET:  /* .set  <name> , <expr> */
        break;
 
    case ISET:  /* .set  <name> , <expr> */
@@ -215,12 +219,12 @@ restlab:
        shiftover(NAME);
        shiftover(CM);
        expr(locxp, val);
        shiftover(NAME);
        shiftover(CM);
        expr(locxp, val);
-       np->type &= (XXTRN|XFORW);
-       np->type |= locxp->xtype&(XTYPE|XFORW);
-       np->value = locxp->xvalue;
+       np->s_type &= (XXTRN|XFORW);
+       np->s_type |= locxp->e_xtype&(XTYPE|XFORW);
+       np->s_value = locxp->e_xvalue;
        if (passno==1)
        if (passno==1)
-               np->index = locxp->xloc;
-       if ((locxp->xtype&XTYPE) == XUNDEF)
+               np->s_index = locxp->e_xloc;
+       if ((locxp->e_xtype&XTYPE) == XUNDEF)
                yyerror("Illegal set?");
        break;
 
                yyerror("Illegal set?");
        break;
 
@@ -240,18 +244,18 @@ restlab:
        if (passno == 1){
                stpt = (struct symtab *)symalloc();
 #ifdef FLEXNAMES
        if (passno == 1){
                stpt = (struct symtab *)symalloc();
 #ifdef FLEXNAMES
-               stpt->name = np->name;
+               stpt->s_name = np->s_name;
 #else
 #else
-               movestr(stpt->name, np->name, NCPS);
+               movestr(stpt->s_name, np->s_name, NCPS);
 #endif
 #endif
-               np->tag = OBSOLETE;     /*invalidate original */
+               np->s_tag = OBSOLETE;   /*invalidate original */
                nforgotten++;
                np = stpt;
                nforgotten++;
                np = stpt;
-               if (locxp->xtype != XABS) 
+               if (locxp->e_xtype != XABS) 
                        ("Illegal lsym");
                        ("Illegal lsym");
-               np->value=locxp->xvalue;
-               np->type=XABS;
-               np->tag = ILSYM;
+               np->s_value=locxp->e_xvalue;
+               np->s_type=XABS;
+               np->s_tag = ILSYM;
        }
        break;
 
        }
        break;
 
@@ -259,7 +263,7 @@ restlab:
        shift;
        np = (struct symtab *)yylval;
        shiftover(NAME);
        shift;
        np = (struct symtab *)yylval;
        shiftover(NAME);
-       np->type |= XXTRN;
+       np->s_type |= XXTRN;
        break;
 
    case IDATA:         /*.data [ <expr> ] */
        break;
 
    case IDATA:         /*.data [ <expr> ] */
@@ -275,7 +279,7 @@ restlab:
                seg_number = 0;
                seg_type = -seg_type;
        } else {
                seg_number = 0;
                seg_type = -seg_type;
        } else {
-               if (locxp->xtype != XABS || (seg_number=locxp->xvalue) >= NLOC) {
+               if (locxp->e_xtype != XABS || (seg_number=locxp->e_xvalue) >= NLOC) {
                        yyerror("illegal location counter");
                        seg_number = 0;
                }
                        yyerror("illegal location counter");
                        seg_number = 0;
                }
@@ -294,7 +298,7 @@ restlab:
        if (passno==2) {
                puchar(vms_obj_ptr,6);          /*  setpl  */
                puchar(vms_obj_ptr,seg_number); /* psect # */
        if (passno==2) {
                puchar(vms_obj_ptr,6);          /*  setpl  */
                puchar(vms_obj_ptr,seg_number); /* psect # */
-               plong(vms_obj_ptr,dotp->xvalue);/*  offset */
+               plong(vms_obj_ptr,dotp->e_xvalue);/*  offset */
                puchar(vms_obj_ptr,80);         /*  setrb  */
                if((vms_obj_ptr-sobuf) > 400){
                        write(objfil,sobuf,vms_obj_ptr-sobuf);
                puchar(vms_obj_ptr,80);         /*  setrb  */
                if((vms_obj_ptr-sobuf) > 400){
                        write(objfil,sobuf,vms_obj_ptr-sobuf);
@@ -341,9 +345,9 @@ restlab:
                if (val == COLON){
                        shiftover(COLON);
                        expr(pval, val);
                if (val == COLON){
                        shiftover(COLON);
                        expr(pval, val);
-                       if (locxp->xtype != XABS)
+                       if (locxp->e_xtype != XABS)
                          yyerror("Width not absolute");
                          yyerror("Width not absolute");
-                       field_width = locxp->xvalue;
+                       field_width = locxp->e_xvalue;
                        locxp = pval;
                        if (bitoff + field_width >
                          curlen)
                        locxp = pval;
                        if (bitoff + field_width >
                          curlen)
@@ -355,7 +359,7 @@ restlab:
                        flushfield(curlen);
                }
 
                        flushfield(curlen);
                }
 
-                if ((locxp->xtype&XTYPE)!=XABS) {
+                if ((locxp->e_xtype&XTYPE)!=XABS) {
                        if (bitoff)
                                yyerror("Illegal relocation in field");
                        field_width=LEN1;
                        if (bitoff)
                                yyerror("Illegal relocation in field");
                        field_width=LEN1;
@@ -364,15 +368,15 @@ restlab:
                        if (curlen==NBPW/2)
                                field_width = LEN2;
                        if (passno == 1){
                        if (curlen==NBPW/2)
                                field_width = LEN2;
                        if (passno == 1){
-                               dotp->xvalue += reflen[field_width];
+                               dotp->e_xvalue += reflen[field_width];
                        } else {
                        } else {
-                               outrel(&locxp->xvalue,
+                               outrel(&locxp->e_xvalue,
                                        field_width,
                                        field_width,
-                                       locxp->xtype,
-                                       locxp->xname);
+                                       locxp->e_xtype,
+                                       locxp->e_xname);
                        }
                } else {
                        }
                } else {
-                       field_value = locxp->xvalue & ( (1L << field_width)-1);
+                       field_value = locxp->e_xvalue & ( (1L << field_width)-1);
                        bitfield |= field_value << bitoff;
                        bitoff += field_width;
                }
                        bitfield |= field_value << bitoff;
                        bitoff += field_width;
                }
@@ -383,16 +387,16 @@ restlab:
 
        flushfield(curlen);
        if ( ( curlen == NBPW/4) && bitoff)
 
        flushfield(curlen);
        if ( ( curlen == NBPW/4) && bitoff)
-               dotp->xvalue ++;
+               dotp->e_xvalue ++;
        break;
        /*end of case IBYTE, IWORD, ILONG, IINT*/
 
    case ISPACE:        /* .space <expr> */
        shift;
        expr(locxp, val);
        break;
        /*end of case IBYTE, IWORD, ILONG, IINT*/
 
    case ISPACE:        /* .space <expr> */
        shift;
        expr(locxp, val);
-       if (locxp->xtype != XABS)
+       if (locxp->e_xtype != XABS)
                yyerror("Space size not absolute");
                yyerror("Space size not absolute");
-       space_value = locxp->xvalue;
+       space_value = locxp->e_xvalue;
   ospace:
        flushfield(NBPW/4);
 #ifdef UNIX
   ospace:
        flushfield(NBPW/4);
 #ifdef UNIX
@@ -403,7 +407,7 @@ restlab:
        outs(strbuf[2].str, space_value);
 #endif UNIX
 #ifdef VMS
        outs(strbuf[2].str, space_value);
 #endif UNIX
 #ifdef VMS
-       dotp->xvalue += space_value;            /*bump pc*/
+       dotp->e_xvalue += space_value;          /*bump pc*/
        if (passno==2){
          if(*(strbuf[2].str)==0) {
                puchar(vms_obj_ptr,81);         /* AUGR  */
        if (passno==2){
          if(*(strbuf[2].str)==0) {
                puchar(vms_obj_ptr,81);         /* AUGR  */
@@ -422,16 +426,16 @@ restlab:
                /* fill count bytes with value */
        shift;
        expr(locxp, val);
                /* fill count bytes with value */
        shift;
        expr(locxp, val);
-       if (locxp->xtype != XABS)
+       if (locxp->e_xtype != XABS)
                yyerror("Fill repetition count not absolute");
                yyerror("Fill repetition count not absolute");
-       space_value = locxp->xvalue;
+       space_value = locxp->e_xvalue;
        shiftover(CM);
        expr(locxp, val);
        shiftover(CM);
        expr(locxp, val);
-       if (locxp->xtype != XABS)
+       if (locxp->e_xtype != XABS)
                yyerror("Fill value not absolute");
        flushfield(NBPW/4);
        while(space_value-- > 0)
                yyerror("Fill value not absolute");
        flushfield(NBPW/4);
        while(space_value-- > 0)
-               outb(locxp->xvalue & 0xFF);
+               outb(locxp->e_xvalue & 0xFF);
        break;
 #endif UNIX
 
        break;
 #endif UNIX
 
@@ -448,7 +452,7 @@ restlab:
        while (val ==  STRING){
                flushfield(NBPW/4);
                if (bitoff)
        while (val ==  STRING){
                flushfield(NBPW/4);
                if (bitoff)
-                 dotp->xvalue++;
+                 dotp->e_xvalue++;
                stringp = (struct strdesc *)yylval;
 #ifdef UNIX
                outs(stringp->str, stringp->str_lg);
                stringp = (struct strdesc *)yylval;
 #ifdef UNIX
                outs(stringp->str, stringp->str_lg);
@@ -457,7 +461,7 @@ restlab:
                {
                        register int i;
                        for (i=0; i < stringp->str_lg; i++){
                {
                        register int i;
                        for (i=0; i < stringp->str_lg; i++){
-                         dotp->xvalue += 1;
+                         dotp->e_xvalue += 1;
                            if (passno==2){
                                puchar(vms_obj_ptr,-1);
                                puchar(vms_obj_ptr,stringp->str[i]);
                            if (passno==2){
                                puchar(vms_obj_ptr,-1);
                                puchar(vms_obj_ptr,stringp->str[i]);
@@ -484,7 +488,7 @@ restlab:
                        puchar(vms_obj_ptr,-1);
                        puchar(vms_obj_ptr,0);
                }
                        puchar(vms_obj_ptr,-1);
                        puchar(vms_obj_ptr,0);
                }
-               dotp->xvalue += 1;
+               dotp->e_xvalue += 1;
 #endif VMS
        }
        break;
 #endif VMS
        }
        break;
@@ -493,11 +497,11 @@ restlab:
        shift;
        expr(locxp, val);
 
        shift;
        expr(locxp, val);
 
-       if (locxp->xtype==XABS)
+       if (locxp->e_xtype==XABS)
                orgwarn++;
                orgwarn++;
-       else if ((locxp->xtype & ~XXTRN) != dotp->xtype)
+       else if ((locxp->e_xtype & ~XXTRN) != dotp->e_xtype)
                yyerror("Illegal expression to set origin");
                yyerror("Illegal expression to set origin");
-       space_value = locxp->xvalue - dotp->xvalue;
+       space_value = locxp->e_xvalue - dotp->e_xvalue;
        if (space_value < 0)
                yyerror("Backwards 'org'");
        goto ospace;
        if (space_value < 0)
                yyerror("Backwards 'org'");
        goto ospace;
@@ -548,7 +552,7 @@ restlab:
        shift;
        for (argcnt = 0; argcnt < 8; argcnt++){
                expr(locxp, val);
        shift;
        for (argcnt = 0; argcnt < 8; argcnt++){
                expr(locxp, val);
-               stpt->name[argcnt] = locxp->xvalue;
+               stpt->s_name[argcnt] = locxp->e_xvalue;
                xp = explist;
                shiftover(CM);
        }
                xp = explist;
                shiftover(CM);
        }
@@ -560,26 +564,26 @@ restlab:
 
   tailstab:
        expr(locxp, val);
 
   tailstab:
        expr(locxp, val);
-       if (! (locxp->xvalue & STABTYPS)){
+       if (! (locxp->e_xvalue & STABTYPS)){
                yyerror("Invalid type in %s",stabname);
                goto errorfix;
        }
                yyerror("Invalid type in %s",stabname);
                goto errorfix;
        }
-       stpt->ptype = locxp->xvalue;
+       stpt->s_ptype = locxp->e_xvalue;
        shiftover(CM);
        expr(locxp, val);
        shiftover(CM);
        expr(locxp, val);
-       stpt->other = locxp->xvalue;
+       stpt->s_other = locxp->e_xvalue;
        shiftover(CM);
        expr(locxp, val);
        shiftover(CM);
        expr(locxp, val);
-       stpt->desc = locxp->xvalue;
+       stpt->s_desc = locxp->e_xvalue;
        shiftover(CM);
        exprisname = 0;
        expr(locxp, val);
        shiftover(CM);
        exprisname = 0;
        expr(locxp, val);
-       p = locxp->xname;
+       p = locxp->e_xname;
        if (p == NULL) {        /*absolute expr to begin with*/
        if (p == NULL) {        /*absolute expr to begin with*/
-               stpt->value = locxp->xvalue;
-               stpt->index = dotp - usedot;
+               stpt->s_value = locxp->e_xvalue;
+               stpt->s_index = dotp - usedot;
                if (exprisname){
                if (exprisname){
-                       switch(stpt->ptype){
+                       switch(stpt->s_ptype){
                                case N_GSYM:
                                case N_FNAME:
                                case N_RSYM:
                                case N_GSYM:
                                case N_FNAME:
                                case N_RSYM:
@@ -589,19 +593,19 @@ restlab:
                                case N_BCOMM:
                                case N_ECOMM:
                                case N_LENG:
                                case N_BCOMM:
                                case N_ECOMM:
                                case N_LENG:
-                                       stpt->tag = STABFIXED;
+                                       stpt->s_tag = STABFIXED;
                                        break;
                                default:
                                        break;
                                default:
-                                       stpt->tag = STABFLOATING;
+                                       stpt->s_tag = STABFLOATING;
                                        break;
                        }
                } else
                                        break;
                        }
                } else
-                       stpt->tag = STABFIXED;
+                       stpt->s_tag = STABFIXED;
        }
        else {          /*really have a name*/
        }
        else {          /*really have a name*/
-               stpt->dest = locxp->xname;
-               stpt->index = p->index;
-               stpt->type = p->type | STABFLAG;
+               stpt->s_dest = locxp->e_xname;
+               stpt->s_index = p->s_index;
+               stpt->s_type = p->s_type | STABFLAG;
                /*
                 *      We will assign a more accruate
                 *      guess of locxp's location when
                /*
                 *      We will assign a more accruate
                 *      guess of locxp's location when
@@ -609,7 +613,7 @@ restlab:
                 *      The final value of value is
                 *      given by stabfix()
                 */
                 *      The final value of value is
                 *      given by stabfix()
                 */
-               stpt->tag = STABFLOATING;
+               stpt->s_tag = STABFLOATING;
        }
        /*
         *      tokptr now points at one token beyond
        }
        /*
         *      tokptr now points at one token beyond
@@ -636,17 +640,17 @@ restlab:
        shift;          /*over the ISTABDOT*/
        if (passno == 1){
                expr(locxp, val);
        shift;          /*over the ISTABDOT*/
        if (passno == 1){
                expr(locxp, val);
-               if (! (locxp->xvalue & STABTYPS)){
+               if (! (locxp->e_xvalue & STABTYPS)){
                        yyerror("Invalid type in .stabd");
                        goto errorfix;
                }
                        yyerror("Invalid type in .stabd");
                        goto errorfix;
                }
-               stpt->ptype = locxp->xvalue;
+               stpt->s_ptype = locxp->e_xvalue;
                shiftover(CM);
                expr(locxp, val);
                shiftover(CM);
                expr(locxp, val);
-               stpt->other = locxp->xvalue;
+               stpt->s_other = locxp->e_xvalue;
                shiftover(CM);
                expr(locxp, val);
                shiftover(CM);
                expr(locxp, val);
-               stpt->desc = locxp->xvalue;
+               stpt->s_desc = locxp->e_xvalue;
                /*
                 *
                 *      Now, clobber everything but the
                /*
                 *
                 *      Now, clobber everything but the
@@ -662,9 +666,9 @@ restlab:
         *              (ensures they are sorted into right place)/
         *      pass 2: Fix the actual value
         */
         *              (ensures they are sorted into right place)/
         *      pass 2: Fix the actual value
         */
-       stpt->value = dotp->xvalue;
-       stpt->index = dotp - usedot;
-       stpt->tag = STABFLOATING;       /*although it has no effect in pass 2*/
+       stpt->s_value = dotp->e_xvalue;
+       stpt->s_index = dotp - usedot;
+       stpt->s_tag = STABFLOATING;     /*although it has no effect in pass 2*/
        break;
 
    case ISTABNONE:     stabname = ".stabn"; goto shortstab;
        break;
 
    case ISTABNONE:     stabname = ".stabn"; goto shortstab;
@@ -694,9 +698,9 @@ restlab:
 #endif
        }
 #ifndef FLEXNAMES
 #endif
        }
 #ifndef FLEXNAMES
-       movestr(stpt->name, stringp->str, auxval);
+       movestr(stpt->s_name, stringp->str, auxval);
 #else
 #else
-       stpt->name = savestr(stringp->str);
+       stpt->s_name = savestr(stringp->str);
 #endif
        goto tailstab;
        break;
 #endif
        goto tailstab;
        break;
@@ -710,17 +714,23 @@ restlab:
        shiftover(CM);
        expr(locxp, val);
 
        shiftover(CM);
        expr(locxp, val);
 
-       if (locxp->xtype != XABS)
+       if (locxp->e_xtype != XABS)
                yyerror("comm size not absolute");
                yyerror("comm size not absolute");
-       if (passno==1 && (np->type&XTYPE)!=XUNDEF)
-               yyerror("Redefinition of %.8s", np->name);
+       if (passno==1 && (np->s_type&XTYPE)!=XUNDEF)
+#ifdef FLEXNAMES
+               yyerror("Redefinition of %s",
+#else not FLEXNAMES
+               yyerror("Redefinition of %.*s",
+                       NCPS,
+#endif not FLEXNAMES
+                       np->s_name);
        if (passno==1) {
        if (passno==1) {
-               np->value = locxp->xvalue;
+               np->s_value = locxp->e_xvalue;
                if (auxval == ICOMM)
                if (auxval == ICOMM)
-                       np->type |= XXTRN;
+                       np->s_type |= XXTRN;
                else {
                else {
-                       np->type &= ~XTYPE;
-                       np->type |= XBSS;
+                       np->s_type &= ~XTYPE;
+                       np->s_type |= XBSS;
                }
        }
        break;
                }
        }
        break;
@@ -765,17 +775,17 @@ restlab:
                                +SAFEEXPRBEG)) ) {
                                ERROR("expression expected");
                        }
                                +SAFEEXPRBEG)) ) {
                                ERROR("expression expected");
                        }
-                       expr(ap->xp,val);
+                       expr(ap->a_xp,val);
                     overdisp:
                        if ( val == LP || sawsize){
                                shiftover(LP);
                                findreg(regno);
                                shiftover(RP);
                     overdisp:
                        if ( val == LP || sawsize){
                                shiftover(LP);
                                findreg(regno);
                                shiftover(RP);
-                               ap->atype = ADISP;
-                               ap->areg1 = regno;
+                               ap->a_atype = ADISP;
+                               ap->a_areg1 = regno;
                        } else {
                        } else {
-                               ap->atype = AEXP;
-                               ap->areg1 = 0;
+                               ap->a_atype = AEXP;
+                               ap->a_areg1 = 0;
                        }
                        goto index;
 
                        }
                        goto index;
 
@@ -788,8 +798,8 @@ restlab:
                   case REG:
                   case REGOP: 
                        findreg(regno);
                   case REG:
                   case REGOP: 
                        findreg(regno);
-                       ap->atype = AREG;
-                       ap->areg1 = regno;
+                       ap->a_atype = AREG;
+                       ap->a_areg1 = regno;
                        break;
                    
                   case MUL: 
                        break;
                    
                   case MUL: 
@@ -819,7 +829,7 @@ restlab:
                         */
                        if (val != REG && val != REGOP){
                                droppedLP = 1;
                         */
                        if (val != REG && val != REGOP){
                                droppedLP = 1;
-                               val = exprparse(val, &(ap->xp));
+                               val = exprparse(val, &(ap->a_xp));
                                droppedLP = 0;
                                goto overdisp;
                        }
                                droppedLP = 0;
                                goto overdisp;
                        }
@@ -827,34 +837,34 @@ restlab:
                        shiftover(RP);
                        if (val == PLUS){
                                shift;
                        shiftover(RP);
                        if (val == PLUS){
                                shift;
-                               ap->atype = AINCR;
+                               ap->a_atype = AINCR;
                        } else
                        } else
-                               ap->atype = ABASE;
-                       ap->areg1 = regno;
+                               ap->a_atype = ABASE;
+                       ap->a_areg1 = regno;
                        goto index;
 
                   case LITOP: 
                      imm:
                        shift;
                        expr(locxp, val);
                        goto index;
 
                   case LITOP: 
                      imm:
                        shift;
                        expr(locxp, val);
-                       ap->atype = AIMM;
-                       ap->areg1 = 0;
-                       ap->xp = locxp;
+                       ap->a_atype = AIMM;
+                       ap->a_areg1 = 0;
+                       ap->a_xp = locxp;
                        goto index;
 
                   case MP: 
                        shift;  /* -(reg) */
                        findreg(regno);
                        shiftover(RP);
                        goto index;
 
                   case MP: 
                        shift;  /* -(reg) */
                        findreg(regno);
                        shiftover(RP);
-                       ap->atype = ADECR;
-                       ap->areg1 = regno;
+                       ap->a_atype = ADECR;
+                       ap->a_areg1 = regno;
          index:                        /*look for [reg] */
                        if (val == LB){
                                shift;
                                findreg(regno);
                                shiftover(RB);
                                sawindex = 1;
          index:                        /*look for [reg] */
                        if (val == LB){
                                shift;
                                findreg(regno);
                                shiftover(RB);
                                sawindex = 1;
-                               ap->areg2 = regno;
+                               ap->a_areg2 = regno;
                        }
                        break;
 
                        }
                        break;
 
@@ -866,21 +876,21 @@ restlab:
                         * Make a concession for *(%r)
                         * meaning *0(%r) 
                         */
                         * Make a concession for *(%r)
                         * meaning *0(%r) 
                         */
-                       if (ap->atype == ABASE) {
-                               ap->atype = ADISP;
-                               xp->xtype = XABS;
-                               xp->xvalue = 0;
-                               xp->xloc = 0;
-                               ap->xp = xp++;
+                       if (ap->a_atype == ABASE) {
+                               ap->a_atype = ADISP;
+                               xp->e_xtype = XABS;
+                               xp->e_xvalue = 0;
+                               xp->e_xloc = 0;
+                               ap->a_xp = xp++;
                        }
                        }
-                       ap->atype |= ASTAR;
+                       ap->a_atype |= ASTAR;
                        sawmul = 0;
            }
            if (sawindex){
                        sawmul = 0;
            }
            if (sawindex){
-               ap->atype |= AINDX;
+               ap->a_atype |= AINDX;
                sawindex = 0;
            }
                sawindex = 0;
            }
-           ap->dispsize = sawsize == 0 ? d124 : sawsize;
+           ap->a_dispsize = sawsize == 0 ? d124 : sawsize;
                if (val != CM) break;
                shiftover(CM);
        }       /*processing all the arguments*/
                if (val != CM) break;
                shiftover(CM);
        }       /*processing all the arguments*/
@@ -910,7 +920,7 @@ restlab:
                        if (val != FLTNUM) {
                          ERROR("floating number expected");
                        }
                        if (val != FLTNUM) {
                          ERROR("floating number expected");
                        }
-                       dotp->xvalue += curlen;
+                       dotp->e_xvalue += curlen;
 #ifdef UNIX
                        if (passno == 2) {
                          if(curlen == 8)
 #ifdef UNIX
                        if (passno == 2) {
                          if(curlen == 8)
@@ -991,15 +1001,15 @@ int funnyreg(val, regnoback)             /*what the read head will sit on*/
 
        expr(locxp, val);       /*and leave the current read head with value*/
        if ( (passno == 2) &&
 
        expr(locxp, val);       /*and leave the current read head with value*/
        if ( (passno == 2) &&
-           (   locxp->xtype & XTYPE != XABS
-            || locxp->xvalue < 0
-            || locxp->xvalue >= 16 
+           (   locxp->e_xtype & XTYPE != XABS
+            || locxp->e_xvalue < 0
+            || locxp->e_xvalue >= 16 
            )
          ){
                yyerror("Illegal register");
                return(0);
        }
            )
          ){
                yyerror("Illegal register");
                return(0);
        }
-       *regnoback = locxp->xvalue;
+       *regnoback = locxp->e_xvalue;
        return(val);
 } 
 
        return(val);
 } 
 
index 28ffb41..f6b0d44 100644 (file)
@@ -1,20 +1,20 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)aspseudo.c 4.1 %G%";
+static char sccsid[] = "@(#)aspseudo.c 4.2 %G%";
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include "as.h"
 
 #include "as.h"
 
-#define OP(name,opcode,nargs,arg1,arg2,arg3,arg4,arg5,arg6) \
+#define        OP(name, opcode, nargs, arg1, arg2, arg3, arg4, arg5, arg6) \
        { \
        { \
-               name,(nargs==0 ? INST0:INSTn), opcode,nargs, \
-               arg1,arg2,arg3,arg4,arg5,arg6 \
+               name, opcode, nargs, arg1, arg2, arg3, arg4, arg5, arg6, \
+               (nargs == 0 ? INST0:INSTn) \
        }
        }
-#define PSEUDO(name, type, tag) \
+#define        PSEUDO(name, type, tag) \
        { \
        { \
-               name, tag, type \
+               name, type, 0,   0, 0, 0, 0, 0, 0, \
+               tag \
        }
 
        }
 
-readonly struct instab instab[] = {
+readonly struct Instab instab[] = {
 PSEUDO(".space",       0,      ISPACE),
 PSEUDO(".fill",                0,      IFILL),
 PSEUDO(".byte",                0,      IBYTE),
 PSEUDO(".space",       0,      ISPACE),
 PSEUDO(".fill",                0,      IFILL),
 PSEUDO(".byte",                0,      IBYTE),
index 53a3189..eea081b 100644 (file)
@@ -1,7 +1,6 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asscan.c 4.2 %G%";
+static char sccsid[] = "@(#)asscan.c 4.3 %G%";
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include "as.h"
 #include "asscan.h"
 
 #include "as.h"
 #include "asscan.h"
 
@@ -129,6 +128,7 @@ closetmpfile()
 #endif DEBUG
 
 extern int             yylval;         /*global communication with parser*/
 #endif DEBUG
 
 extern int             yylval;         /*global communication with parser*/
+static int             Lastjxxx;       /*this ONLY shuts up cc; see below*/
 
 toktype yylex()
 {
 
 toktype yylex()
 {
@@ -150,12 +150,12 @@ toktype yylex()
                                     yyerror("Too many expressions; try simplyfing");
                                else
                                    locxp = xp++;
                                     yyerror("Too many expressions; try simplyfing");
                                else
                                    locxp = xp++;
-                               glong(locxp->xvalue, bufptr);
-                               locxp->yvalue = 0;
+                               glong(locxp->e_xvalue, bufptr);
+                               locxp->e_yvalue = 0;
                          makevalue:
                          makevalue:
-                               locxp->xtype = XABS;
-                               locxp->xloc = 0;
-                               locxp->xname = NULL;
+                               locxp->e_xtype = XABS;
+                               locxp->e_xloc = 0;
+                               locxp->e_xname = NULL;
                                yylval = (int)locxp;
                                break;
                case    FLTNUM: 
                                yylval = (int)locxp;
                                break;
                case    FLTNUM: 
@@ -170,8 +170,8 @@ toktype yylex()
                                     yyerror("Too many expressions; try simplyfing");
                                else
                                    locxp = xp++;
                                     yyerror("Too many expressions; try simplyfing");
                                else
                                    locxp = xp++;
-                               glong(locxp->xvalue, bufptr);
-                               glong(locxp->yvalue, bufptr);
+                               glong(locxp->e_xvalue, bufptr);
+                               glong(locxp->e_yvalue, bufptr);
                                yylval = val = INT;
                                goto makevalue;
                case    NAME:
                                yylval = val = INT;
                                goto makevalue;
                case    NAME:
@@ -186,7 +186,9 @@ toktype yylex()
                                break;
                case    IJXXX:
                                gchar(yylval, bufptr);
                                break;
                case    IJXXX:
                                gchar(yylval, bufptr);
-                               gptr(lastjxxx, bufptr);
+                               /* We can't cast Lastjxxx into (int *) here.. */
+                               gptr(Lastjxxx, bufptr);
+                               lastjxxx = (struct symtab *)Lastjxxx;
                                break;
                case    ILINESKIP:
                                gint(yylval, bufptr);
                                break;
                case    ILINESKIP:
                                gint(yylval, bufptr);
@@ -221,20 +223,20 @@ toktype yylex()
                        passno, bufptr -  firsttoken, tok_to_name(val));
                switch(val){
                case    INT:    printf("val %d",
                        passno, bufptr -  firsttoken, tok_to_name(val));
                switch(val){
                case    INT:    printf("val %d",
-                                       ((struct exp *)yylval)->xvalue);
+                                       ((struct exp *)yylval)->e_xvalue);
                                break;
                case    BFINT:  printf("val %d",
                                break;
                case    BFINT:  printf("val %d",
-                                       ((struct exp *)yylval)->xvalue);
+                                       ((struct exp *)yylval)->e_xvalue);
                                break;
                case    QUAD:   printf("val[msd] = 0x%x, val[lsd] = 0x%x.",
                                break;
                case    QUAD:   printf("val[msd] = 0x%x, val[lsd] = 0x%x.",
-                               ((struct exp *)yylval)->xvalue,
-                               ((struct exp *)yylval)->yvalue);
+                               ((struct exp *)yylval)->e_xvalue,
+                               ((struct exp *)yylval)->e_yvalue);
                                break;
                case    FLTNUM: printf("value %20.17f",
                                ((union Double *)yylval)->dvalue);
                                break;
                case    NAME:   printf("\"%.8s\"",
                                break;
                case    FLTNUM: printf("value %20.17f",
                                ((union Double *)yylval)->dvalue);
                                break;
                case    NAME:   printf("\"%.8s\"",
-                                       ((struct symtab *)yylval)->name);
+                                       ((struct symtab *)yylval)->s_name);
                                break;
                case    REG:    printf(" r%d",
                                        yylval);
                                break;
                case    REG:    printf(" r%d",
                                        yylval);
@@ -242,7 +244,7 @@ toktype yylex()
                case    IJXXX:
                case    INST0:  
                case    INSTn:  printf("%.8s",
                case    IJXXX:
                case    INST0:  
                case    INSTn:  printf("%.8s",
-                                       itab[0xFF &yylval]->name);
+                                       itab[0xFF &yylval]->s_name);
                                break;
                case    STRING: printf("length %d ",
                                        ((struct strdesc *)yylval)->str_lg);
                                break;
                case    STRING: printf("length %d ",
                                        ((struct strdesc *)yylval)->str_lg);
@@ -773,10 +775,10 @@ scan_dot_s(bufferbox)
                        val = getchar();
                ungetc(val);
        doit:
                        val = getchar();
                ungetc(val);
        doit:
-               tag = (op = *lookup(1))->tag;
+               tag = (op = *lookup(1))->s_tag;
                if (tag && tag != LABELID){
                if (tag && tag != LABELID){
-                       yylval = ( (struct instab *)op)->opcode;
-                       val = op->tag ;
+                       yylval = ( (struct instab *)op)->i_opcode;
+                       val = op->s_tag ;
                        goto ret;
                } else {
                        /*
                        goto ret;
                } else {
                        /*
index 2425280..d2eaaf5 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* "@(#)asscan.h 4.2 %G%" */
+/* "@(#)asscan.h 4.3 %G%" */
 /*
  *     The character scanner is called to fill up one token buffer
  *
 /*
  *     The character scanner is called to fill up one token buffer
  *
index b994081..a4cedb9 100644 (file)
@@ -1,9 +1,7 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)assyms.c 4.1 %G%";
+static char sccsid[] = "@(#)assyms.c 4.2 %G%";
 #include <stdio.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <ctype.h>
-#include <sys/types.h>
-#include <a.out.h>
 #include "as.h"
 #include "asscan.h"
 #include "assyms.h"
 #include "as.h"
 #include "asscan.h"
 #include "assyms.h"
@@ -47,9 +45,7 @@ int   hshused;        /* number of hash slots used */
  */
 #ifdef FLEXNAMES
 struct strpool         *strplhead = 0;
  */
 #ifdef FLEXNAMES
 struct strpool         *strplhead = 0;
-#else
-char                   *namebuffer;
-#endif
+#endif FLEXNAMES
 
 symtabinit()
 {
 
 symtabinit()
 {
@@ -73,18 +69,22 @@ syminstall()
        register        struct  symtab  **hp;
        register        char    *p1, *p2;
 
        register        struct  symtab  **hp;
        register        char    *p1, *p2;
 
-       for (ip=instab; ip->name!=0; ip++) {
-               p1 = ip->name;
+#ifdef FLEXNAMES
+       for (ip = (struct instab *)instab; ip->s_name != 0; ip++) {
+#else not FLEXNAMES
+       for (ip = (struct instab *)instab; ip->s_name[0] != '\0'; ip++){
+#endif not FLEXNAMES
+               p1 = ip->s_name;
                p2 = yytext;
                while (*p2++ = *p1++);
                hp = lookup(0);         /* 0 => don't install this*/
                if (*hp==NULL) {
                        *hp = (struct symtab *)ip;
                p2 = yytext;
                while (*p2++ = *p1++);
                hp = lookup(0);         /* 0 => don't install this*/
                if (*hp==NULL) {
                        *hp = (struct symtab *)ip;
-                       if (   (ip->tag!=INSTn)
-                           && (ip->tag!=INST0)
-                           && (ip->tag!=0))
+                       if (   (ip->s_tag!=INSTn)
+                           && (ip->s_tag!=INST0)
+                           && (ip->s_tag!=0))
                                continue; /* was pseudo-op */
                                continue; /* was pseudo-op */
-                       itab[ip->opcode & 0xFF] = ip;
+                       itab[ip->i_opcode & 0xFF] = ip;
                }
        }
 }      /*end of syminstall*/
                }
        }
 }      /*end of syminstall*/
@@ -107,30 +107,30 @@ freezesymtab()
 
        DECLITERATE(allocwalk, sp, ubsp)
        {
 
        DECLITERATE(allocwalk, sp, ubsp)
        {
-               if (sp->tag >= IGNOREBOUND)
+               if (sp->s_tag >= IGNOREBOUND)
                        continue;               /*totally ignore jxxx entries */
                /*
                 *      Ignore stabs, but give them a symbol table index
                 */
                        continue;               /*totally ignore jxxx entries */
                /*
                 *      Ignore stabs, but give them a symbol table index
                 */
-               if (sp->type & STABFLAG)
+               if (sp->s_type & STABFLAG)
                        goto assignindex;
                        goto assignindex;
-               if ((sp->type&XTYPE)==XUNDEF)
-                       sp->type = XXTRN+XUNDEF;
-               else if ((sp->type&XTYPE)==XDATA)
-                       sp->value += usedot[sp->index].xvalue;
-               else if ((sp->type&XTYPE)==XTEXT)
-                       sp->value += usedot[sp->index].xvalue;
-               else if ((sp->type&XTYPE)==XBSS) {
-                       bs = sp->value;
-                       sp->value = hdr.a_bss + datbase;
+               if ((sp->s_type&XTYPE)==XUNDEF)
+                       sp->s_type = XXTRN+XUNDEF;
+               else if ((sp->s_type&XTYPE)==XDATA)
+                       sp->s_value += usedot[sp->s_index].e_xvalue;
+               else if ((sp->s_type&XTYPE)==XTEXT)
+                       sp->s_value += usedot[sp->s_index].e_xvalue;
+               else if ((sp->s_type&XTYPE)==XBSS) {
+                       bs = sp->s_value;
+                       sp->s_value = hdr.a_bss + datbase;
                        hdr.a_bss += bs;
                }
           assignindex:
                        hdr.a_bss += bs;
                }
           assignindex:
-               if (    (sp->name[0] != 'L')
-                    || (sp->tag != LABELID)
+               if (    (sp->s_name[0] != 'L')
+                    || (sp->s_tag != LABELID)
                     || savelabels
                     )                  /*then, we will write it later on*/
                     || savelabels
                     )                  /*then, we will write it later on*/
-                               sp->index = relpos++;
+                               sp->s_index = relpos++;
        }
 }
 
        }
 }
 
@@ -148,11 +148,11 @@ stabfix() {
        register struct symtab *p;
        
        SYMITERATE(cosp, sp){
        register struct symtab *p;
        
        SYMITERATE(cosp, sp){
-               if(sp->ptype && (sp->type & STABFLAG)) {        
-                       p = sp->dest;   
-                       sp->value = p->value;   
-                       sp->index = p->index;
-                       sp->type = p->type;
+               if(sp->s_ptype && (sp->s_type & STABFLAG)) {    
+                       p = sp->s_dest; 
+                       sp->s_value = p->s_value;       
+                       sp->s_index = p->s_index;
+                       sp->s_type = p->s_type;
                }
        }
 }
                }
        }
 }
@@ -185,9 +185,6 @@ struct symtab *symalloc()
                newbox = (struct allocbox *)ClearCalloc(1,ALLOCQTY);
                symsleft = SYMDALLOP;
                nextsym = &newbox->symslots[0];
                newbox = (struct allocbox *)ClearCalloc(1,ALLOCQTY);
                symsleft = SYMDALLOP;
                nextsym = &newbox->symslots[0];
-#ifndef FLEXNAMES
-               namebuffer = &newbox->symnames[0];
-#endif not FLEXNAMES
                if (alloctail == 0){
                        allochead = alloctail = newbox;
                } else {
                if (alloctail == 0){
                        allochead = alloctail = newbox;
                } else {
@@ -197,10 +194,6 @@ struct symtab *symalloc()
        }
        --symsleft;
        ++nsyms;
        }
        --symsleft;
        ++nsyms;
-#ifndef FLEXNAMES
-       nextsym->name = namebuffer;
-       namebuffer += NCPS;
-#endif not FLEXNAMES
        return(nextsym++);
 }
 
        return(nextsym++);
 }
 
@@ -221,22 +214,22 @@ symcmp(Pptr, Qptr)
 {
        register struct symtab *p = *Pptr;
        register struct symtab *q = *Qptr;
 {
        register struct symtab *p = *Pptr;
        register struct symtab *q = *Qptr;
-       if (p->index < q->index)
+       if (p->s_index < q->s_index)
                return(-1);
                return(-1);
-       if (p->index > q->index)
+       if (p->s_index > q->s_index)
                return(1);
                return(1);
-       if (p->value < q->value)
+       if (p->s_value < q->s_value)
                return(-1);
                return(-1);
-       if (p->value > q->value)
+       if (p->s_value > q->s_value)
                return(1);
        /*
         *      Force jxxx entries to virtually preceed labels defined
         *      to follow the jxxxx instruction, so that bumping the
         *      jxxx instruction correctly fixes up the following labels
         */
                return(1);
        /*
         *      Force jxxx entries to virtually preceed labels defined
         *      to follow the jxxxx instruction, so that bumping the
         *      jxxx instruction correctly fixes up the following labels
         */
-       if (p->tag >= IGNOREBOUND)      /*p points to a jxxx*/
+       if (p->s_tag >= IGNOREBOUND)    /*p points to a jxxx*/
                return(-1);             
                return(-1);             
-       if (q->tag >= IGNOREBOUND)
+       if (q->s_tag >= IGNOREBOUND)
                return(1);
        /*
         *      both are now just plain labels; the relative order doesn't
                return(1);
        /*
         *      both are now just plain labels; the relative order doesn't
@@ -275,9 +268,9 @@ sortsymtab()
        cowalk = symptrs;
        symsin = 0;
        DECLITERATE(allocwalk, sp, ubsp) {
        cowalk = symptrs;
        symsin = 0;
        DECLITERATE(allocwalk, sp, ubsp) {
-               if (sp->ptype && (sp->type &STABFLAG)){
-                       sp->value = sp->dest->value;
-                       sp->index = sp->dest->index;
+               if (sp->s_ptype && (sp->s_type &STABFLAG)){
+                       sp->s_value = sp->s_dest->s_value;
+                       sp->s_index = sp->s_dest->s_index;
                }
                if (symsin >= nsyms)
                        yyerror("INTERNAL ERROR: overfilled symbol table indirection table");
                }
                if (symsin >= nsyms)
                        yyerror("INTERNAL ERROR: overfilled symbol table indirection table");
@@ -293,7 +286,7 @@ sortsymtab()
        for (cowalk = symptrs, sp = *cowalk, segno = 0, slotno = 1;
             segno < NLOC + NLOC;
             segno++, slotno++){
        for (cowalk = symptrs, sp = *cowalk, segno = 0, slotno = 1;
             segno < NLOC + NLOC;
             segno++, slotno++){
-               for (; sp && sp->index == segno; sp = *++cowalk);
+               for (; sp && sp->s_index == segno; sp = *++cowalk);
                symdelim[slotno] = cowalk;      /*forms the ub delimeter*/
        }
 }      /*end of sortsymtab*/
                symdelim[slotno] = cowalk;      /*forms the ub delimeter*/
        }
 }      /*end of sortsymtab*/
@@ -311,17 +304,17 @@ dumpsymtab()
                SEGITERATE(segno, 0, 0, cosp, sp, ub, ++){
 #ifdef FLEXNAMES
                        printf("\tSeg: %d \"%s\" value: %d index: %d tag %s\n",
                SEGITERATE(segno, 0, 0, cosp, sp, ub, ++){
 #ifdef FLEXNAMES
                        printf("\tSeg: %d \"%s\" value: %d index: %d tag %s\n",
-                               segno, sp->name,
-                               sp->value, sp->index,
-                               tagstring(sp->tag));
+                               segno, sp->s_name,
+                               sp->s_value, sp->s_index,
+                               tagstring(sp->s_tag));
 #else not FLEXNAMES
                        printf("\tSeg: %d \"%*.*s\" value: %d index: %d tag %s\n",
 #else not FLEXNAMES
                        printf("\tSeg: %d \"%*.*s\" value: %d index: %d tag %s\n",
-                               segno, NCPS, NCPS, sp->name,
-                               sp->value, sp->index,
-                               tagstring(sp->tag));
+                               segno, NCPS, NCPS, sp->s_name,
+                               sp->s_value, sp->s_index,
+                               tagstring(sp->s_tag));
 #endif not FLEXNAMES
                        printf("\t\ttype: %d jxbump %d jxfear: %d\n",
 #endif not FLEXNAMES
                        printf("\t\ttype: %d jxbump %d jxfear: %d\n",
-                               sp->type, sp->jxbump, sp->jxfear);
+                               sp->s_type, sp->s_jxbump, sp->s_jxfear);
                }
                printf("\n\n");
        }
                }
                printf("\n\n");
        }
@@ -413,7 +406,7 @@ struct symtab **lookup(instflg)
                                nprobes += 2)
                {
                        from = yytext;
                                nprobes += 2)
                {
                        from = yytext;
-                       to = (*hp)->name;
+                       to = (*hp)->s_name;
 #ifndef FLEXNAMES
                        for (len = 0; (len<NCPS) && *from; len++)
                                if (*from++ != *to++)
 #ifndef FLEXNAMES
                        for (len = 0; (len<NCPS) && *from; len++)
                                if (*from++ != *to++)
@@ -450,7 +443,7 @@ struct symtab **lookup(instflg)
                *hp = symalloc();
                hdallop->h_nused++;
 #ifndef FLEXNAMES
                *hp = symalloc();
                hdallop->h_nused++;
 #ifndef FLEXNAMES
-               for(len = 0, from = yytext, to = (*hp)->name; (len<NCPS); len++)
+               for(len = 0, from = yytext, to = (*hp)->s_name; (len<NCPS); len++)
                        if ((*to++ = *from++) == '\0')
                                break;
 #else FLEXNAMES
                        if ((*to++ = *from++) == '\0')
                                break;
 #else FLEXNAMES
@@ -458,7 +451,7 @@ struct symtab **lookup(instflg)
                        continue;
                if (len >= (STRPOOLDALLOP - strplhead->str_nalloc))
                        strpoolalloc();
                        continue;
                if (len >= (STRPOOLDALLOP - strplhead->str_nalloc))
                        strpoolalloc();
-               for ( (*hp)->name = to = strplhead->str_names + strplhead->str_nalloc, from = yytext;
+               for ( (*hp)->s_name = to = strplhead->str_names + strplhead->str_nalloc, from = yytext;
                     ( (*to++ = *from++) != '\0'); )
                        continue;
                strplhead->str_nalloc += len;
                     ( (*to++ = *from++) != '\0'); )
                        continue;
                strplhead->str_nalloc += len;
@@ -513,11 +506,18 @@ struct    relbufdesc{
 extern struct  relbufdesc      *tok_free;
 #define        rel_free tok_free
 static struct  relbufdesc      *rel_temp;
 extern struct  relbufdesc      *tok_free;
 #define        rel_free tok_free
 static struct  relbufdesc      *rel_temp;
-struct relocation_info r_can_1PC = {0,0,0,0,0,0};
-struct relocation_info r_can_0PC = {0,0,0,0,0,0};
+struct relocation_info r_can_1PC;
+struct relocation_info r_can_0PC;
 
 initoutrel()
 {
 
 initoutrel()
 {
+       r_can_0PC.r_address = 0;
+       r_can_0PC.r_symbolnum = 0;
+       r_can_0PC.r_pcrel = 0;
+       r_can_0PC.r_length = 0;
+       r_can_0PC.r_extern = 0;
+
+       r_can_1PC = r_can_0PC;
        r_can_1PC.r_pcrel = 1;
 }
 
        r_can_1PC.r_pcrel = 1;
 }
 
@@ -543,12 +543,12 @@ outrel(pval,reftype,reltype,xsym)
 
        if (reltype != XABS || reftype & PCREL) {
                reloc = (reftype & PCREL)? r_can_1PC : r_can_0PC;
 
        if (reltype != XABS || reftype & PCREL) {
                reloc = (reftype & PCREL)? r_can_1PC : r_can_0PC;
-               reloc.r_address = dotp->xvalue -
+               reloc.r_address = dotp->e_xvalue -
                        ( (dotp < &usedot[NLOC]) ? 0 : datbase );
                reloc.r_length = lgreflen[reftype];
                switch(reltype){
                        case XXTRN | XUNDEF:
                        ( (dotp < &usedot[NLOC]) ? 0 : datbase );
                reloc.r_length = lgreflen[reftype];
                switch(reltype){
                        case XXTRN | XUNDEF:
-                               reloc.r_symbolnum = xsym->index;
+                               reloc.r_symbolnum = xsym->s_index;
                                reloc.r_extern = 1;
                                break;
                        default:
                                reloc.r_extern = 1;
                                break;
                        default:
@@ -572,9 +572,9 @@ outrel(pval,reftype,reltype,xsym)
        /*
         *      write the unrelocated value to the text file
         */
        /*
         *      write the unrelocated value to the text file
         */
-       dotp->xvalue += this_reflen;
+       dotp->e_xvalue += this_reflen;
        if (reftype & PCREL)
        if (reftype & PCREL)
-               *pval -= dotp->xvalue;
+               *pval -= dotp->e_xvalue;
        bwrite((char *)pval, this_reflen, txtfil);
 }
 /*
        bwrite((char *)pval, this_reflen, txtfil);
 }
 /*
@@ -613,26 +613,10 @@ u_long Closeoutrel(relfil, relocfile)
        return(tail + relfil->rel_count * sizeof (struct relocation_info));
 }
 
        return(tail + relfil->rel_count * sizeof (struct relocation_info));
 }
 
+#define NOUTSYMS (nsyms - njxxx - nforgotten - (savelabels ? 0 : nlabels))
 int sizesymtab()
 {
 int sizesymtab()
 {
-       struct symtab *sp;
-
-#define NOUTSYMS (nsyms - njxxx - nforgotten - (savelabels ? 0 : nlabels))
-
-       return (
-               (
-#ifndef FLEXNAMES
-                NCPS
-#else FLEXNAMES
-                sizeof (long)
-#endif FLEXNAMES
-                + sizeof (sp->ptype)
-                + sizeof (sp->other)
-                + sizeof (sp->desc)
-                + sizeof (sp->value)
-               ) 
-               *       NOUTSYMS
-       );
+       return (sizeof (struct nlist) * NOUTSYMS);
 }
 
 #ifdef FLEXNAMES
 }
 
 #ifdef FLEXNAMES
@@ -663,8 +647,12 @@ int symwrite(symfile)
        int     symsdesired = NOUTSYMS;
        register        struct  symtab *sp, *ub;
 #ifdef FLEXNAMES
        int     symsdesired = NOUTSYMS;
        register        struct  symtab *sp, *ub;
 #ifdef FLEXNAMES
-       register        int     len;
+       char            *name;                  /* temp to save the name */
        long            stroff  = sizeof (stroff);
        long            stroff  = sizeof (stroff);
+       /*
+        *      We use sp->s_index to hold the length of the
+        *      name; it isn't used for anything else
+        */
 #endif FLEXNAMES
 
        register        struct  allocbox        *allocwalk;
 #endif FLEXNAMES
 
        register        struct  allocbox        *allocwalk;
@@ -672,35 +660,26 @@ int symwrite(symfile)
        symsout = 0;
        DECLITERATE(allocwalk, sp, ub)
        {
        symsout = 0;
        DECLITERATE(allocwalk, sp, ub)
        {
-               if (sp->tag >= IGNOREBOUND) 
+               if (sp->s_tag >= IGNOREBOUND) 
                        continue;
                        continue;
-               if ((sp->name[0] == 'L') && (sp->tag == LABELID) && !savelabels)
+               if ((sp->s_name[0] == 'L') && (sp->s_tag == LABELID) && !savelabels)
                        continue;
                symsout++;
                        continue;
                symsout++;
-#ifndef FLEXNAMES
-               bwrite(sp->name, NCPS, symfile);
-#else FLEXNAMES
-               len = strlen(sp->name);
-               if (len != 0) {
-                       bwrite(&stroff, sizeof (stroff), symfile);
-                       stroff += len + 1;
-               } else
-                       bwrite("\0\0\0\0", sizeof (stroff), symfile);
+
+#ifdef FLEXNAMES
+               name = sp->s_name;              /* save pointer */
+               if ( (sp->s_index = strlen(sp->s_name)) != 0){
+                       sp->s_nmx = stroff;     /* clobber pointer */
+                       stroff += sp->s_index + 1;
+               } else {
+                       sp->s_nmx = 0;          /* clobber pointer */
+               }
+#endif
+               sp->s_type = (sp->s_ptype != 0) ? sp->s_ptype : (sp->s_type & (~XFORW));
+               bwrite(&sp->s_nm, sizeof (struct nlist), symfile);
+#ifdef FLEXNAMES
+               sp->s_name = name;              /* restore pointer */
 #endif FLEXNAMES
 #endif FLEXNAMES
-               sp->type &= ~XFORW;
-               bputc( ( (sp->ptype != 0) ? sp->ptype : sp->type ),
-                       symfile);
-       /*
-        *      WATCH OUT.  THIS DEPENDS THAT THE ALLOCATION OF
-        *      the four fields ptype, other, desc and value are
-        *      contiguous, which is compiler dependent.
-        */
-               bwrite((char *)&(sp->other),
-                         sizeof (sp->other)
-                       + sizeof (sp->desc)
-                       + sizeof (sp->value),
-                      symfile
-               );
        }
        if (symsout != symsdesired)
                yyerror("INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols\n",
        }
        if (symsout != symsdesired)
                yyerror("INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols\n",
@@ -715,13 +694,13 @@ int symwrite(symfile)
        symsout = 0;
        DECLITERATE(allocwalk, sp, ub)
        {
        symsout = 0;
        DECLITERATE(allocwalk, sp, ub)
        {
-               if (sp->tag >= IGNOREBOUND) 
+               if (sp->s_tag >= IGNOREBOUND) 
                        continue;
                        continue;
-               if ((sp->name[0] == 'L') && (sp->tag == LABELID) && !savelabels)
+               if ((sp->s_name[0] == 'L') && (sp->s_tag == LABELID) && !savelabels)
                        continue;
                        continue;
-               len = strlen(sp->name);
-               if (len)
-                       bwrite(sp->name, len + 1, symfile);
+               sp->s_index = strlen(sp->s_name);
+               if (sp->s_index)
+                       bwrite(sp->s_name, sp->s_index + 1, symfile);
        }
 #endif FLEXNAMES
 }
        }
 #endif FLEXNAMES
 }
index 7b455dc..18a1ae9 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 1980 Regents of the University of California */
 /* Copyright (c) 1980 Regents of the University of California */
-/* "@(#)assyms.h 4.1 %G%" */
+/* "@(#)assyms.h 4.2 %G%" */
 /*
  *     To speed up walks through symbols defined in a particular
  *     segment, we buil up a table of pointers into the symbol table
 /*
  *     To speed up walks through symbols defined in a particular
  *     segment, we buil up a table of pointers into the symbol table
@@ -40,9 +40,6 @@ extern        int     hshused;                /*how many hash slots used*/
 struct         allocbox{
        struct          allocbox        *nextalloc;
        struct          symtab          symslots[SYMDALLOP];
 struct         allocbox{
        struct          allocbox        *nextalloc;
        struct          symtab          symslots[SYMDALLOP];
-#ifndef        FLEXNAMES
-       char                            symnames[SYMDALLOP * NCPS];
-#endif
 };
 
 #ifdef FLEXNAMES
 };
 
 #ifdef FLEXNAMES