don't throw away float <-> double conversions for FORTRAN.
[unix-history] / usr / src / old / as.vax / asmain.c
index e56de1d..488d488 100644 (file)
@@ -2,7 +2,7 @@
  *     Copyright (c) 1982 Regents of the University of California
  */
 #ifndef lint
  *     Copyright (c) 1982 Regents of the University of California
  */
 #ifndef lint
-static char sccsid[] = "@(#)asmain.c 4.11 %G%";
+static char sccsid[] = "@(#)asmain.c 4.15 %G%";
 #endif not lint
 
 #include <stdio.h>
 #endif not lint
 
 #include <stdio.h>
@@ -14,14 +14,9 @@ static char sccsid[] = "@(#)asmain.c 4.11 %G%";
 #include "asscan.h"
 #include "asexpr.h"
 
 #include "asscan.h"
 #include "asexpr.h"
 
-#ifdef UNIX
-#define        unix_lang_name "VAX/UNIX Assembler V%G% 4.11"
-#endif
-
-#ifdef VMS
-#define vms_lang_name "VAX/VMS C Assembler V1.00"
-#endif VMS
+#include <sys/stat.h>
 
 
+#define        unix_lang_name "VAX/UNIX Assembler V%G% 4.15"
 /*
  *     variables to manage reading the assembly source files
  */
 /*
  *     variables to manage reading the assembly source files
  */
@@ -35,6 +30,7 @@ int   ninfiles;       /*how many interesting files there are*/
 int    silent = 0;     /*don't complain about any errors*/
 int    savelabels = 0; /*write the labels to the a.out file*/
 int    d124 = 4;       /*default allocate 4 bytes for unknown pointers*/
 int    silent = 0;     /*don't complain about any errors*/
 int    savelabels = 0; /*write the labels to the a.out file*/
 int    d124 = 4;       /*default allocate 4 bytes for unknown pointers*/
+int    maxalign = 2;   /*default .align maximum*/
 int    anyerrs = 0;    /*no errors yet*/
 int    anywarnings=0;  /*no warnings yet*/
 int    orgwarn = 0;    /*Bad origins*/
 int    anyerrs = 0;    /*no errors yet*/
 int    anywarnings=0;  /*no warnings yet*/
 int    orgwarn = 0;    /*Bad origins*/
@@ -51,13 +47,7 @@ int  debug = 0;
 int    toktrace = 0;
 #endif
 
 int    toktrace = 0;
 #endif
 
-int    useVM =         /*put the temp file in virtual memory*/
-#ifdef VMS
-       1;              /*VMS has virtual memory (duh)*/
-#endif VMS
-#ifdef UNIX
-       0;
-#endif
+int    useVM = 0;
 
 char   *endcore;       /*where to get more symbol space*/
 
 
 char   *endcore;       /*where to get more symbol space*/
 
@@ -171,15 +161,7 @@ BFILE      *relocfile;                     /* concatnated relocation info */
  *
  *     We use relfil to output the symbol table information.
  */
  *
  *     We use relfil to output the symbol table information.
  */
-
-char   *tmpdirprefix =
-#ifdef UNIX
-                       "/tmp/";
-#else VMS
-                       "/usr/tmp/";
-#endif
-
-
+char   *tmpdirprefix = "/tmp/";
 int delexit();
 
 main(argc, argv)
 int delexit();
 
 main(argc, argv)
@@ -235,7 +217,7 @@ main(argc, argv)
                yywarning("These are not defined for all implementations of the VAX architecture.\n");
 
        exit(anyerrs != 0);
                yywarning("These are not defined for all implementations of the VAX architecture.\n");
 
        exit(anyerrs != 0);
-}      /*end of UNIX main*/
+}
 
 argprocess(argc, argv)
        int     argc;
 
 argprocess(argc, argv)
        int     argc;
@@ -277,6 +259,15 @@ argprocess(argc, argv)
                                                exit(1);
                                        }
                                        break;
                                                exit(1);
                                        }
                                        break;
+                                case 'a':
+                                       maxalign = atoi(cp+1);
+                                       for (cp++; isdigit(*cp); cp++)
+                                               /*VOID*/;
+                                       if ( (maxalign > 16) || (maxalign < 0)){
+                                               yyerror("-a: 0<=align<=16");
+                                               exit(1);
+                                       }
+                                       break;
                                 case 'o':
                                        if (argc < 3){
                                                yyerror("-o what???");
                                 case 'o':
                                        if (argc < 3){
                                                yyerror("-o what???");
@@ -491,6 +482,8 @@ pass1_5()
 
 open_a_out()
 {
 
 open_a_out()
 {
+       struct stat stb;
+
        /*
         *      Open up the a.out file now, and get set to build
         *      up offsets into it for all of the various text,data
        /*
         *      Open up the a.out file now, and get set to build
         *      up offsets into it for all of the various text,data
@@ -502,6 +495,8 @@ open_a_out()
                delexit();
        }
        biofd = a_out_file->_file;
                delexit();
        }
        biofd = a_out_file->_file;
+       fstat(biofd, &stb);
+       biobufsize = stb.st_blksize;
        a_out_off = 0;
 }
 
        a_out_off = 0;
 }
 
@@ -652,8 +647,7 @@ reloc_syms()
                hdr.a_drsize = 0;
        }
        /*
                hdr.a_drsize = 0;
        }
        /*
-        *      Output the symbol table
-        *      and if FLEXNAMES is set, the string pool
+        *      Output the symbol table and the string pool
         *
         *      We must first rewind the string pool file to its beginning,
         *      in case it was seek'ed into for fetching ascii and asciz
         *
         *      We must first rewind the string pool file to its beginning,
         *      in case it was seek'ed into for fetching ascii and asciz