changed "source file %s.c" to "... %s.f"
[unix-history] / usr / src / old / as.vax / as.h
index b0a4742..f9edae0 100644 (file)
@@ -1,36 +1,12 @@
 /*
  *     Copyright (c) 1982 Regents of the University of California
 /*
  *     Copyright (c) 1982 Regents of the University of California
- *     @(#)as.h 4.9 %G%
+ *     @(#)as.h 4.19 %G%
  */
  */
-#ifdef VMS
-# define       vax     1
-# define       VAX     1
-#endif VMS
-
 #define        reg     register
 
 #include <sys/types.h>
 #define        reg     register
 
 #include <sys/types.h>
-#ifdef UNIX
-
-#ifdef FLEXNAMES
-#  include <a.out.h>
-#  include <stab.h>
-#else not FLEXNAMES
-#  define ONLIST
-#  include "a.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
+#include <a.out.h>
+#include <stab.h>
 
 #define readonly
 #define        NINST           300
 
 #define readonly
 #define        NINST           300
 #define        NHASH           1103    /* hash table is dynamically extended */
 #define        TNAMESIZE       32      /* maximum length of temporary file names */
 #define        NLOC            4       /* number of location ctrs */
 #define        NHASH           1103    /* hash table is dynamically extended */
 #define        TNAMESIZE       32      /* maximum length of temporary file names */
 #define        NLOC            4       /* number of location ctrs */
-
-#ifdef UNIX
-# ifndef       FLEXNAMES
-#      ifndef  NCPS
-#              define  NCPS    8       /* number of characters per symbol*/
-#      endif
-# else
-#      ifdef NCPS
-#              undef   NCPS
-#      endif
-#      define  NCPS    BUFSIZ  /* needed to allocate yytext */
-# endif
-# endif UNIX
-
-# ifdef VMS
-# ifdef NCPS
-#      undef   NCPS
-# endif NCPS
-#      define  NCPS    15
-# endif VMS
-
+/*
+ *     Sizes for character buffers.
+ *     what                    size #define name       comments
+ *
+ *     name assembly           NCPName 
+ *     name save               STRPOOLDALLOP   
+ *
+ *     -name saving is a simple first fit
+ */
+#ifndef STRPOOLDALLOP
+#      define STRPOOLDALLOP    8192
+#endif not STRPOOLDALLOP
+
+#define        NCPName NCPS
+#ifndef NCPS
+#      undef   NCPName
+#      define  NCPName 4096
+#endif not NCPS
+/*
+ *     Check sizes, and compiler error if sizes botch
+ */
+#if STRPOOLDALLOP < NCPName
+       $$$botch with definition sizes
+#endif test botches
 /*
  * Symbol types
  */
 /*
  * Symbol types
  */
@@ -132,14 +111,6 @@ extern     char    *ty_string[];   /* {TYPB..TYPH} ==> printable */
 #define        DW      0x7
 #define        OW      0xF
 
 #define        DW      0x7
 #define        OW      0xF
 
-#ifdef UNIX
-#  include <pagsiz.h>
-#endif UNIX
-
-#ifdef VMS
-#  define PAGRND       0x1FFL
-#endif VMS
-
 #define        round(x,y)      (((x)+(y)) & ~(y))
 
 #define        STABTYPS        0340
 #define        round(x,y)      (((x)+(y)) & ~(y))
 
 #define        STABTYPS        0340
@@ -225,12 +196,13 @@ struct symtab{
  *     one saves typing, and so that they conform 
  *     with the old naming conventions.
  */
  *     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_name  s_nm.n_un.n_name
+#define        i_name  s_name
+#define        FETCHNAME(sp)   (((struct strdesc *)(sp)->s_name)->sd_string)
+#define        STRLEN(sp)      (((struct strdesc *)(sp)->s_name)->sd_strlen)
+#define        STROFF(sp)      (((struct strdesc *)(sp)->s_name)->sd_stroff)
+#define        STRPLACE(sp)    (((struct strdesc *)(sp)->s_name)->sd_place)
 #define        s_nmx   s_nm.n_un.n_strx        /* string table index */
 #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_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 */
@@ -300,11 +272,7 @@ struct Opcode{
 #define        ITABFETCH(o)    itab[o.Op_eopcode][o.Op_popcode]
 
 struct Instab{
 #define        ITABFETCH(o)    itab[o.Op_eopcode][o.Op_popcode]
 
 struct Instab{
-#ifdef FLEXNAMES
        char    *I_name;
        char    *I_name;
-#else not FLEXNAMES
-       char    I_name[NCPS];
-#endif
        u_char  I_popcode;              /* basic op code */
        char    I_nargs;
        char    I_args[6];
        u_char  I_popcode;              /* basic op code */
        char    I_nargs;
        char    I_args[6];
@@ -358,7 +326,33 @@ struct     exp {
 #define                ISUBYTE(x)      (((x) >= MINUBYTE) && ((x) <= MAXUBYTE))
 #define                ISWORD(x)       (((x) >= MINWORD) && ((x) <= MAXWORD))
 #define                ISUWORD(x)      (((x) >= MINUWORD) && ((x) <= MAXUWORD))
 #define                ISUBYTE(x)      (((x) >= MINUBYTE) && ((x) <= MAXUBYTE))
 #define                ISWORD(x)       (((x) >= MINWORD) && ((x) <= MAXWORD))
 #define                ISUWORD(x)      (((x) >= MINUWORD) && ((x) <= MAXUWORD))
+/*
+ *     Definitions for strings.
+ *
+ *     Strings are stored in the string pool; see strsave(str, length)
+ *     Strings are known by their length and values.
+ *     A string pointer points to the beginning of the value bytes;
+ *
+ *     If this structure is changed, change insts also.
+ */
+struct strdesc{
+       int     sd_stroff;      /* offset into string file */
+       short   sd_place;       /* where string is */
+       u_short sd_strlen;      /* string length */
+       char    sd_string[1];   /* the string itself, flexible length */
+};
+/*
+ *     Where a string can be.  If these are changed, also change instrs.
+ */
+#define        STR_FILE        0x1
+#define        STR_CORE        0x2
+#define        STR_BOTH        0x3
 
 
+struct strdesc *savestr();
+\f
+/*
+ *     Global variables
+ */
        extern  struct  arg     arglist[NARG];  /*building operands in instructions*/
        extern  struct  exp     explist[NEXP];  /*building up a list of expressions*/
        extern  struct  exp     *xp;            /*current free expression*/
        extern  struct  arg     arglist[NARG];  /*building operands in instructions*/
        extern  struct  exp     explist[NEXP];  /*building up a list of expressions*/
        extern  struct  exp     *xp;            /*current free expression*/
@@ -370,13 +364,6 @@ struct     exp {
         */
        extern  struct  symtab  *lastnam;
        extern  struct  symtab  *lastjxxx;      
         */
        extern  struct  symtab  *lastnam;
        extern  struct  symtab  *lastjxxx;      
-
-#ifdef VMS
-       extern  char    *vms_obj_ptr;           /* object buffer pointer */
-       extern  char    sobuf[];                /* object buffer         */
-       extern  int     objfil;                 /* VMS object file descriptor */
-#endif VMS
-
        /*
         *      Lgensym is used to make up funny names for local labels.
         *      lgensym[i] is the current funny number to put after
        /*
         *      Lgensym is used to make up funny names for local labels.
         *      lgensym[i] is the current funny number to put after
@@ -389,7 +376,6 @@ struct      exp {
        extern  int     lgensym[10];
        extern  char    genref[10];
 
        extern  int     lgensym[10];
        extern  char    genref[10];
 
-       extern  char    tmpn1[TNAMESIZE];       /* Interpass temporary */
        extern  struct  exp     *dotp;          /* the current dot location */
        extern  int     loctr;
 
        extern  struct  exp     *dotp;          /* the current dot location */
        extern  int     loctr;
 
@@ -410,14 +396,18 @@ struct    exp {
         *      The lexical analyzer builds up symbols in yytext.  Lookup
         *      expects its argument in this buffer
         */
         *      The lexical analyzer builds up symbols in yytext.  Lookup
         *      expects its argument in this buffer
         */
-       extern  char    yytext[NCPS+2];         /* text buffer for lexical */
+       extern  char    yytext[NCPName+2];      /* text buffer for lexical */
        /*
         *      Variables to manage the input assembler source file
         */
        extern  int     lineno;                 /*the line number*/
        extern  char    *dotsname;              /*the name of the as source*/
 
        /*
         *      Variables to manage the input assembler source file
         */
        extern  int     lineno;                 /*the line number*/
        extern  char    *dotsname;              /*the name of the as source*/
 
-       extern  FILE    *tmpfil;                /* interpass communication*/
+       extern  FILE    *tokfile;               /* temp token communication*/
+       extern  FILE    *strfile;               /* temp string file*/
+       extern  char    tokfilename[TNAMESIZE]; /* token file name */
+       extern  char    strfilename[TNAMESIZE]; /* string file name */
+       extern  int     strfilepos;             /* position in string file */
 
        extern  int     passno;                 /* 1 or 2 */
 
 
        extern  int     passno;                 /* 1 or 2 */
 
@@ -455,14 +445,7 @@ struct     exp {
 
 #define outs(cp, lg) dotp->e_xvalue += (lg); if (passno == 2) bwrite((cp), (lg), (txtfil))
 
 
 #define outs(cp, lg) dotp->e_xvalue += (lg); if (passno == 2) bwrite((cp), (lg), (txtfil))
 
-#ifdef UNIX
 #define        Outb(o) outb(o)
 #define        Outb(o) outb(o)
-#endif UNIX
-
-#ifdef VMS
-#define        Outb(o) {*vms_obj_ptr++=-1;*vms_obj_ptr++=(char)o;dotp->e_xvalue+=1;}
-#endif VMS
-
 /*
  *     Most of the time, the argument to flushfield is a power of two constant,
  *     the calculations involving it can be optimized to shifts.
 /*
  *     Most of the time, the argument to flushfield is a power of two constant,
  *     the calculations involving it can be optimized to shifts.