SCCS-vsn: old/as.vax/asmain.c 4.13
SCCS-vsn: old/as.vax/asparse.c 4.16
SCCS-vsn: old/as.vax/assyms.c 4.12
SCCS-vsn: old/as.vax/as.h 4.17
SCCS-vsn: old/as.vax/asscan2.c 4.11
/*
* Copyright (c) 1982 Regents of the University of California
/*
* Copyright (c) 1982 Regents of the University of California
*/
#define reg register
#include <sys/types.h>
*/
#define reg register
#include <sys/types.h>
-#ifdef FLEXNAMES
-# include <a.out.h>
-# include <stab.h>
-#else not FLEXNAMES
-# define ONLIST
-# include "a.out.h"
-# include <stab.h>
-#endif FLEXNAMES
+#include <a.out.h>
+#include <stab.h>
#define readonly
#define NINST 300
#define readonly
#define NINST 300
*
* source file reads ASINBUFSIZ integral of BUFSIZ
* string assembly NCPString large for .stabs
*
* source file reads ASINBUFSIZ integral of BUFSIZ
* string assembly NCPString large for .stabs
- * name assembly NCPName depends on FLEXNAMES
+ * name assembly NCPName
* string save STRPOOLDALLOP
*
*
* string save STRPOOLDALLOP
*
*
#endif not NCPString
#define NCPName NCPS
#endif not NCPString
#define NCPName NCPS
-# 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
+#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
*/
* 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.
*/
#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_nmx s_nm.n_un.n_strx /* string table index */
#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_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 */
#define ITABFETCH(o) itab[o.Op_eopcode][o.Op_popcode]
struct Instab{
#define ITABFETCH(o) itab[o.Op_eopcode][o.Op_popcode]
struct Instab{
-#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];
* 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.12 %G%";
+static char sccsid[] = "@(#)asmain.c 4.13 %G%";
#endif not lint
#include <stdio.h>
#endif not lint
#include <stdio.h>
#include "asscan.h"
#include "asexpr.h"
#include "asscan.h"
#include "asexpr.h"
-#define unix_lang_name "VAX/UNIX Assembler V%G% 4.12"
+#define unix_lang_name "VAX/UNIX Assembler V%G% 4.13"
/*
* variables to manage reading the assembly source files
*/
/*
* variables to manage reading the assembly source files
*/
- * 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
* 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[] = "@(#)asparse.c 4.15 %G%";
+static char sccsid[] = "@(#)asparse.c 4.16 %G%";
#endif not lint
#include <stdio.h>
#endif not lint
#include <stdio.h>
np = (struct symtab *)yylval;
shiftover(NAME);
if (val != COLON) {
np = (struct symtab *)yylval;
shiftover(NAME);
if (val != COLON) {
yyerror("\"%s\" is not followed by a ':' for a label definition",
yyerror("\"%s\" is not followed by a ':' for a label definition",
-#else not FLEXNAMES
- yyerror("\"%.*s\" is not followed by a ':' for a label definition",
- NCPName,
-#endif not FLEXNAMES
FETCHNAME(np));
goto errorfix;
}
FETCHNAME(np));
goto errorfix;
}
#endif not DEBUG
{
if (passno == 1)
#endif not DEBUG
{
if (passno == 1)
-#else not FLEXNAMES
- yyerror("%.*s redefined",
- NCPName,
-#endif not FLEXNAMES
yyerror("%s redefined: PHASE ERROR, 1st: %d, 2nd: %d",
yyerror("%s redefined: PHASE ERROR, 1st: %d, 2nd: %d",
-#else not FLEXNAMES
- yyerror("%.*s redefined: PHASE ERROR, 1st: %d, 2nd: %d",
- NCPName,
-#endif not FLEXNAMES
FETCHNAME(np),
np->s_value,
dotp->e_xvalue);
FETCHNAME(np),
np->s_value,
dotp->e_xvalue);
*/
if (passno == 1){
stpt = (struct symtab *)symalloc();
*/
if (passno == 1){
stpt = (struct symtab *)symalloc();
stpt->s_name = np->s_name;
stpt->s_name = np->s_name;
-#else
- movestr(FETCHNAME(stpt), FETCHNAME(np), NCPName);
-#endif
np->s_tag = OBSOLETE; /*invalidate original */
nforgotten++;
np = stpt;
np->s_tag = OBSOLETE; /*invalidate original */
nforgotten++;
np = stpt;
* .stabd <expr>, <expr>, <expr> # .
*/
case ISTAB:
* .stabd <expr>, <expr>, <expr> # .
*/
case ISTAB:
-#ifndef FLEXNAMES
- stabname = ".stab";
- if (passno == 2) goto errorfix;
- stpt = (struct symtab *)yylval;
- /*
- * Make a pointer to the .stab slot.
- * There is a pointer in the way (stpt), and
- * tokptr points to the next token.
- */
- stabstart = tokptr;
- (char *)stabstart -= sizeof(struct symtab *);
- (char *)stabstart -= sizeof(bytetoktype);
- shift;
- for (argcnt = 0; argcnt < NCPName; argcnt++){
- expr(locxp, val);
- FETCHNAME(stpt)[argcnt] = locxp->e_xvalue;
- xp = explist;
- shiftover(CM);
- }
- goto tailstab;
-#else FLEXNAMES
- yyerror(".stab directive not supported in; report this compiler bug to system administrator");
+ yyerror(".stab directive no longer supported");
tailstab:
expr(locxp, val);
tailstab:
expr(locxp, val);
if (auxval == ISTABSTR){
stringp = (struct strdesc *)yylval;
shiftover(STRING);
if (auxval == ISTABSTR){
stringp = (struct strdesc *)yylval;
shiftover(STRING);
-#ifndef FLEXNAMES
- movestr(FETCHNAME(stpt), stringp,
- min(stringp->sd_strlen, NCPName));
-#else
stpt->s_name = (char *)stringp;
/*
* We want the trailing null included in this string.
stpt->s_name = (char *)stringp;
/*
* We want the trailing null included in this string.
* and merely increment the string length
*/
stringp->sd_strlen += 1;
* and merely increment the string length
*/
stringp->sd_strlen += 1;
-#ifndef FLEXNAMES
- static char nullstr[NCPName];
- movestr(FETCHNAME(stpt), nullstr, NCPName);
-#else
static char nullstr[1];
static struct strdesc strdp;
strdp.sd_stroff = strfilepos;
strdp.sd_strlen = 0;
strdp.sd_place = STR_BOTH;
stpt->s_name = (char *)savestr(nullstr, &strdp);
static char nullstr[1];
static struct strdesc strdp;
strdp.sd_stroff = strfilepos;
strdp.sd_strlen = 0;
strdp.sd_place = STR_BOTH;
stpt->s_name = (char *)savestr(nullstr, &strdp);
if ( (locxp->e_xtype & XTYPE) != XABS) /* tekmdp */
yyerror("comm size not absolute");
if (passno == 1 && (np->s_type&XTYPE) != XUNDEF)
if ( (locxp->e_xtype & XTYPE) != XABS) /* tekmdp */
yyerror("comm size not absolute");
if (passno == 1 && (np->s_type&XTYPE) != XUNDEF)
-#ifdef FLEXNAMES
- yyerror("Redefinition of %s",
-#else not FLEXNAMES
- yyerror("Redefinition of %.*s",
- NCPName,
-#endif not FLEXNAMES
- FETCHNAME(np));
+ yyerror("Redefinition of %s", FETCHNAME(np));
if (passno==1) {
np->s_value = locxp->e_xvalue;
if (auxval == ICOMM)
if (passno==1) {
np->s_value = locxp->e_xvalue;
if (auxval == ICOMM)
* 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[] = "@(#)asscan2.c 4.10 %G%";
+static char sccsid[] = "@(#)asscan2.c 4.11 %G%";
#endif not lint
#include "asscanl.h"
#endif not lint
#include "asscanl.h"
Ginbufptr = inbuffer + 1;
}
Ginbufptr = inbuffer + 1;
}
char strtext[NCPString + 1];
char strtext[NCPString + 1];
-#else FLEXNAMES
-# if NCPName < NCPString
-char strtext[NCPString + 1];
-# else
-#define strtext yytext
-# endif
-#endif FLEXNAMES
+#else
+# define strtext yytext
+#endif
scan_dot_s(bufferbox)
struct tokbufdesc *bufferbox;
scan_dot_s(bufferbox)
struct tokbufdesc *bufferbox;
* 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[] = "@(#)assyms.c 4.11 %G%";
+static char sccsid[] = "@(#)assyms.c 4.12 %G%";
#endif not lint
#include <stdio.h>
#endif not lint
#include <stdio.h>
for (segno = 0; segno < NLOC + NLOC; segno++){
printf("Segment number: %d\n", segno);
SEGITERATE(segno, 0, 0, cosp, sp, ub, ++){
for (segno = 0; segno < NLOC + NLOC; segno++){
printf("Segment number: %d\n", segno);
SEGITERATE(segno, 0, 0, cosp, sp, ub, ++){
printf("\tSeg: %d \"%s\" value: %d index: %d tag %s\n",
segno, FETCHNAME(sp),
sp->s_value, sp->s_index,
tagstring(sp->s_tag));
printf("\tSeg: %d \"%s\" value: %d index: %d tag %s\n",
segno, FETCHNAME(sp),
sp->s_value, sp->s_index,
tagstring(sp->s_tag));
-#else not FLEXNAMES
- printf("\tSeg: %d \"%*.*s\" value: %d index: %d tag %s\n",
- segno, NCPName, NCPName, FETCHNAME(sp),
- sp->s_value, sp->s_index,
- tagstring(sp->s_tag));
-#endif not FLEXNAMES
printf("\t\ttype: %d jxbump %d jxfear: %d\n",
sp->s_type, sp->s_jxbump, sp->s_jxfear);
}
printf("\t\ttype: %d jxbump %d jxfear: %d\n",
sp->s_type, sp->s_jxbump, sp->s_jxfear);
}
{
from = yytext;
to = FETCHNAME(*hp);
{
from = yytext;
to = FETCHNAME(*hp);
-#ifndef FLEXNAMES
- for (len = 0; (len<NCPName) && *from; len++)
- if (*from++ != *to++)
- goto nextprobe;
- if (len >= NCPName) /*both are maximal length*/
- return(hp);
- if (*to == 0) /*assert *from == 0*/
- return(hp);
-#else FLEXNAMES
while (*from && *to)
if (*from++ != *to++)
goto nextprobe;
if (*to == *from) /*assert both are == 0*/
return(hp);
while (*from && *to)
if (*from++ != *to++)
goto nextprobe;
if (*to == *from) /*assert both are == 0*/
return(hp);
-#endif FLEXNAMES
-
- nextprobe: ;
}
if (*hp == 0 && emptyslot == 0 &&
hdallop->h_nused < HASHCLOGGED) {
}
if (*hp == 0 && emptyslot == 0 &&
hdallop->h_nused < HASHCLOGGED) {
if (instflg) {
*hp = symalloc();
hdallop->h_nused++;
if (instflg) {
*hp = symalloc();
hdallop->h_nused++;
-#ifndef FLEXNAMES
- strncpy(FETCHNAME(*hp), yytext, NCPName);
-#else FLEXNAMES
for (from = yytext, len = 0; *from++; len++)
continue;
/*
for (from = yytext, len = 0; *from++; len++)
continue;
/*
putc(0, strfile); /* null */
strfilepos += strdp.sd_strlen;
(*hp)->s_name = (char *)savestr(yytext, &strdp);
putc(0, strfile); /* null */
strfilepos += strdp.sd_strlen;
(*hp)->s_name = (char *)savestr(yytext, &strdp);
}
return(hp);
} /*end of lookup*/
}
return(hp);
} /*end of lookup*/
{
return (sizeof (struct nlist) * NOUTSYMS);
}
{
return (sizeof (struct nlist) * NOUTSYMS);
}
-
-#ifdef FLEXNAMES
-/*
- * We write out the flexible length character strings for names
- * in two stages.
- * 1) We always! maintain a fixed sized name list entry;
- * the string is indexed by a four byte quantity from the beginning
- * of the string pool area. Index 0 is reserved, and indicates
- * that there is no associated string. The first valid index is 4.
- * 2) We concatenate together and write all of the strings
- * in the string pool at the end of the name list. The first
- * four bytes in the string pool are indexed only by 0 (see above);
- * they contain the total number of bytes in the string pool.
- */
-#endif FLEXNAMES
-
/*
* Write out n symbols to file f, beginning at p
* ignoring symbols that are obsolete, jxxx instructions, and
* possibly, labels
*/
/*
* Write out n symbols to file f, beginning at p
* ignoring symbols that are obsolete, jxxx instructions, and
* possibly, labels
*/
int symwrite(symfile)
BFILE *symfile;
{
int symsout; /*those actually written*/
int symsdesired = NOUTSYMS;
reg struct symtab *sp, *ub;
int symwrite(symfile)
BFILE *symfile;
{
int symsout; /*those actually written*/
int symsdesired = NOUTSYMS;
reg struct symtab *sp, *ub;
char *name; /* temp to save the name */
int nread;
char rbuf[2048];
char *name; /* temp to save the name */
int nread;
char rbuf[2048];
* We use sp->s_index to hold the length of the
* name; it isn't used for anything else
*/
* We use sp->s_index to hold the length of the
* name; it isn't used for anything else
*/
register struct allocbox *allocwalk;
symsout = 0;
register struct allocbox *allocwalk;
symsout = 0;
name = sp->s_name; /* save pointer */
/*
* the length of the symbol table string
name = sp->s_name; /* save pointer */
/*
* the length of the symbol table string
} else {
sp->s_nmx = 0;
}
} else {
sp->s_nmx = 0;
}
-#ifdef DEBUG
- printf("symbol %d: nmx == %d\n", symsout, sp->s_nmx);
-#endif DEBUG
-#endif FLEXNAMES
sp->s_type = (sp->s_ptype != 0) ? sp->s_ptype : (sp->s_type & (~XFORW));
if (readonlydata && (sp->s_type&~N_EXT) == N_DATA)
sp->s_type = N_TEXT | (sp->s_type & N_EXT);
bwrite((char *)&sp->s_nm, sizeof (struct nlist), symfile);
sp->s_type = (sp->s_ptype != 0) ? sp->s_ptype : (sp->s_type & (~XFORW));
if (readonlydata && (sp->s_type&~N_EXT) == N_DATA)
sp->s_type = N_TEXT | (sp->s_type & N_EXT);
bwrite((char *)&sp->s_nm, sizeof (struct nlist), symfile);
sp->s_name = name; /* restore pointer */
sp->s_name = name; /* restore pointer */
}
if (symsout != symsdesired)
yyerror("INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols\n",
symsout, symsdesired);
}
if (symsout != symsdesired)
yyerror("INTERNAL ERROR: Wrote %d symbols, wanted to write %d symbols\n",
symsout, symsdesired);
/*
* Copy the string temporary file to the symbol file,
* copying all the strings and symbols we ever saw,
/*
* Copy the string temporary file to the symbol file,
* copying all the strings and symbols we ever saw,
i = 0;
while((nread = read(strfile->_file, rbuf, sizeof(rbuf))) > 0){
if (i == 0){
i = 0;
while((nread = read(strfile->_file, rbuf, sizeof(rbuf))) > 0){
if (i == 0){
-#ifdef DEBUG
- printf("%d bytes of strings\n", strfilepos);
-#endif DEBUG
((int *)rbuf)[0] = strfilepos;
}
bwrite(rbuf, nread, symfile);
i++;
}
((int *)rbuf)[0] = strfilepos;
}
bwrite(rbuf, nread, symfile);
i++;
}