Add copyright
[unix-history] / usr / src / old / as.vax / as.h
index f9e7dbb..bcf9165 100644 (file)
@@ -1,36 +1,16 @@
 /*
 /*
- *     Copyright (c) 1982 Regents of the University of California
- *     @(#)as.h 4.15 %G%
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)as.h        5.1 (Berkeley) %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
  *     Sizes for character buffers.
  *     what                    size #define name       comments
  *
  *     Sizes for character buffers.
  *     what                    size #define name       comments
  *
- *     source file reads       ASINBUFSIZ              integral of BUFSIZ
- *     string assembly         NCPString               large for .stabs
- *     name assembly           NCPName                 depends on FLEXNAMES
- *     string save             STRPOOLDALLOP   
- *
+ *     name assembly           NCPName 
+ *     name save               STRPOOLDALLOP   
  *
  *
- *     -source file reads should be integral of BUFSIZ for efficient reads
- *     -string saving is a simple first fit
+ *     -name saving is a simple first fit
  */
  */
-#ifndef ASINBUFSIZ
-#      define  ASINBUFSIZ      4096
-#endif not ASINBUFSIZ
 #ifndef STRPOOLDALLOP
 #      define STRPOOLDALLOP    8192
 #endif not STRPOOLDALLOP
 #ifndef STRPOOLDALLOP
 #      define STRPOOLDALLOP    8192
 #endif not STRPOOLDALLOP
-#ifndef NCPString
-#      define  NCPString       4080
-#endif not NCPString
 
 #define        NCPName NCPS
 
 #define        NCPName NCPS
-#ifdef UNIX
-# ifndef FLEXNAMES
-#      ifndef NCPS
-#              undef   NCPName
-#              define  NCPName 8
-#      endif not NCPS
-# else FLEXNAMES
-#      ifndef NCPS
-#              undef   NCPName
-#              define  NCPName 4096
-#      endif not NCPS
-# endif FLEXNAMES
-# endif UNIX
-
-# ifdef VMS
-#      define  NCPName 15
-# endif VMS
-
+#ifndef NCPS
+#      undef   NCPName
+#      define  NCPName 4096
+#endif not NCPS
 /*
  *     Check sizes, and compiler error if sizes botch
  */
 /*
  *     Check sizes, and compiler error if sizes botch
  */
-#if ((STRPOOLDALLOP < NCPString) || (STRPOOLDALLOP < NCPName))
+#if STRPOOLDALLOP < NCPName
        $$$botch with definition sizes
 #endif test botches
 /*
        $$$botch with definition sizes
 #endif test botches
 /*
@@ -159,10 +115,6 @@ extern     char    *ty_string[];   /* {TYPB..TYPH} ==> printable */
 #define        DW      0x7
 #define        OW      0xF
 
 #define        DW      0x7
 #define        OW      0xF
 
-#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
@@ -233,7 +185,7 @@ struct symtab{
                u_char  s_jxoveralign;  /* if a JXXX, jumped over align */
                short   s_index;        /* which segment */
                struct  symtab *s_dest; /* if JXXX, where going to */
                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 DEBUG
                short   s_jxline;       /* source line of the jump from */
 #endif
 };
                short   s_jxline;       /* source line of the jump from */
 #endif
 };
@@ -248,18 +200,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
 #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        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
-#define        i_name  s_name
-#define        FETCHNAME(sp)   ((sp)->s_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 */
@@ -329,11 +276,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[NCPName];
-#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];
@@ -425,13 +368,6 @@ struct strdesc *savestr();
         */
        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
@@ -502,6 +438,7 @@ struct strdesc *savestr();
 
        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*/
+       extern  int     maxalign;               /*maximum .align allowed*/
        
        struct  symtab  **lookup();             /*argument in yytext*/
        struct  symtab  *symalloc();
        
        struct  symtab  **lookup();             /*argument in yytext*/
        struct  symtab  *symalloc();
@@ -513,14 +450,7 @@ struct strdesc *savestr();
 
 #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.
@@ -539,7 +469,7 @@ struct      biobuf {
        short   b_nleft;                /* Number free spaces left in b_buf */
 /* Initialize to be less than BUFSIZ initially, to boundary align in file */
        char    *b_ptr;                 /* Next place to stuff characters */
        short   b_nleft;                /* Number free spaces left in b_buf */
 /* Initialize to be less than BUFSIZ initially, to boundary align in file */
        char    *b_ptr;                 /* Next place to stuff characters */
-       char    b_buf[BUFSIZ];          /* The buffer itself */
+       char    *b_buf;                 /* Pointer to the buffer */
        off_t   b_off;                  /* Current file offset */
        struct  biobuf *b_link;         /* Link in chain for bflush() */
 };
        off_t   b_off;                  /* Current file offset */
        struct  biobuf *b_link;         /* Link in chain for bflush() */
 };
@@ -549,6 +479,7 @@ struct      biobuf {
 
        extern  BFILE   *biobufs;       /* head of the block I/O buffer chain */
        extern  int     biofd;          /* file descriptor for block I/O file */
 
        extern  BFILE   *biobufs;       /* head of the block I/O buffer chain */
        extern  int     biofd;          /* file descriptor for block I/O file */
+       extern  int     biobufsize;     /* optimal block size for I/O */
        extern  off_t   boffset;        /* physical position in logical file */
 
        /*
        extern  off_t   boffset;        /* physical position in logical file */
 
        /*