Research V3 release Research-V3
authorKen Thompson <ken@research.uucp>
Thu, 15 Feb 1973 20:49:36 +0000 (15:49 -0500)
committerKen Thompson <ken@research.uucp>
Thu, 15 Feb 1973 20:49:36 +0000 (15:49 -0500)
Snapshot of the completed development branch

Synthesized-from: v3

328 files changed:
c/c00.c [new file with mode: 0644]
c/c01.c [new file with mode: 0644]
c/c02.c [new file with mode: 0644]
c/c03.c [new file with mode: 0644]
c/c10.c [new file with mode: 0644]
c/c11.c [new file with mode: 0644]
c/cctab.s [deleted file]
c/cvopt.c [deleted file]
c/efftab.s [deleted file]
c/fptab.s [deleted file]
c/nc0/c00.c [deleted file]
c/nc0/c01.c [deleted file]
c/nc0/c02.c [deleted file]
c/nc0/c03.c [deleted file]
c/nc0/c0t.s [deleted file]
c/nc1/c10.c [deleted file]
c/nc1/c11.c [deleted file]
c/nc1/c1t.s [deleted file]
c/nc1/t.c [deleted file]
c/ncc.c [deleted file]
c/regtab.s [deleted file]
c/sptab.s [deleted file]
c/src [deleted file]
cmd/a1.s [deleted file]
cmd/a2.s [deleted file]
cmd/a21.s [deleted file]
cmd/a3.s [deleted file]
cmd/a4.s [deleted file]
cmd/a5.s [deleted file]
cmd/a6.s [deleted file]
cmd/a7.s [deleted file]
cmd/a8.s [deleted file]
cmd/a9.s [deleted file]
cmd/acct.s [deleted file]
cmd/ar.s [deleted file]
cmd/as25.s [deleted file]
cmd/as8.s [deleted file]
cmd/as9.s [deleted file]
cmd/bas0.s [deleted file]
cmd/bas1.s [deleted file]
cmd/cat.s [deleted file]
cmd/cc.c [deleted file]
cmd/chmod.s [deleted file]
cmd/chown.s [deleted file]
cmd/cmp.s [deleted file]
cmd/colon.s [deleted file]
cmd/cp.c [deleted file]
cmd/date.s [deleted file]
cmd/db1.s [deleted file]
cmd/db2.s [deleted file]
cmd/db3.s [deleted file]
cmd/db4.s [deleted file]
cmd/df.s [deleted file]
cmd/dsw.s [deleted file]
cmd/dusg.s [deleted file]
cmd/fc.c [deleted file]
cmd/fstrip.s [deleted file]
cmd/getty.s [deleted file]
cmd/glob.c [deleted file]
cmd/if.c [deleted file]
cmd/init.s [deleted file]
cmd/ld1.s [deleted file]
cmd/ld2.s [deleted file]
cmd/ldx.s [deleted file]
cmd/ln.s [deleted file]
cmd/login.s [deleted file]
cmd/ls.s [deleted file]
lib/bsw.s [deleted file]
lib/chdir.s [deleted file]
lib/chmod.s [deleted file]
lib/chown.s [deleted file]
lib/close.s [deleted file]
lib/creat.s [deleted file]
lib/crt0.s [deleted file]
lib/ctime.s [deleted file]
lib/execl.s [deleted file]
lib/execv.s [deleted file]
lib/exit.s [deleted file]
lib/fork.s [deleted file]
lib/fstat.s [deleted file]
lib/getchr.s [deleted file]
lib/getuid.s [deleted file]
lib/gtty.s [deleted file]
lib/intr.s [deleted file]
lib/link.s [deleted file]
lib/makdir.s [deleted file]
lib/open.s [deleted file]
lib/printf.c [deleted file]
lib/printf.s [deleted file]
lib/putchr.s [deleted file]
lib/read.s [deleted file]
lib/seek.s [deleted file]
lib/setuid.s [deleted file]
lib/stat.s [deleted file]
lib/stty.s [deleted file]
lib/switch.s [deleted file]
lib/time.s [deleted file]
lib/unlink.s [deleted file]
lib/wait.s [deleted file]
lib/write.s [deleted file]
man/man0/aa [new file with mode: 0644]
man/man0/basinf [new file with mode: 0644]
man/man0/headrc [new file with mode: 0644]
man/man0/index [new file with mode: 0644]
man/man0/intro [new file with mode: 0644]
man/man0/toc [new file with mode: 0644]
man/man0/tocrc [new file with mode: 0644]
man/man0/xx [new file with mode: 0644]
man/man1/:.1 [new file with mode: 0644]
man/man1/ar.1 [new file with mode: 0644]
man/man1/as.1 [new file with mode: 0644]
man/man1/bas.1 [new file with mode: 0644]
man/man1/cat.1 [new file with mode: 0644]
man/man1/cc.1 [new file with mode: 0644]
man/man1/cdb.1 [new file with mode: 0644]
man/man1/chdir.1 [new file with mode: 0644]
man/man1/chmod.1 [new file with mode: 0644]
man/man1/chown.1 [new file with mode: 0644]
man/man1/cmp.1 [new file with mode: 0644]
man/man1/cp.1 [new file with mode: 0644]
man/man1/cref.1 [new file with mode: 0644]
man/man1/crypt.1 [new file with mode: 0644]
man/man1/date.1 [new file with mode: 0644]
man/man1/db.1 [new file with mode: 0644]
man/man1/dc.1 [new file with mode: 0644]
man/man1/df.1 [new file with mode: 0644]
man/man1/dsw.1 [new file with mode: 0644]
man/man1/du.1 [new file with mode: 0644]
man/man1/echo.1 [new file with mode: 0644]
man/man1/ed.1 [new file with mode: 0644]
man/man1/exit.1 [new file with mode: 0644]
man/man1/factor.1 [new file with mode: 0644]
man/man1/fc.1 [new file with mode: 0644]
man/man1/fed.1 [new file with mode: 0644]
man/man1/form.1 [new file with mode: 0644]
man/man1/forml.1 [new file with mode: 0644]
man/man1/goto.1 [new file with mode: 0644]
man/man1/hyphen.1 [new file with mode: 0644]
man/man1/if.1 [new file with mode: 0644]
man/man1/ld.1 [new file with mode: 0644]
man/man1/ln.1 [new file with mode: 0644]
man/man1/login.1 [new file with mode: 0644]
man/man1/ls.1 [new file with mode: 0644]
man/man1/m6.1 [new file with mode: 0644]
man/man1/mail.1 [new file with mode: 0644]
man/man1/man.1 [new file with mode: 0644]
man/man1/mesg.1 [new file with mode: 0644]
man/man1/mkdir.1 [new file with mode: 0644]
man/man1/mt.1 [new file with mode: 0644]
man/man1/mv.1 [new file with mode: 0644]
man/man1/nm.1 [new file with mode: 0644]
man/man1/nroff.1 [new file with mode: 0644]
man/man1/od.1 [new file with mode: 0644]
man/man1/opr.1 [new file with mode: 0644]
man/man1/ov.1 [new file with mode: 0644]
man/man1/passwd.1 [new file with mode: 0644]
man/man1/pr.1 [new file with mode: 0644]
man/man1/proof.1 [new file with mode: 0644]
man/man1/reloc.1 [new file with mode: 0644]
man/man1/rew.1 [new file with mode: 0644]
man/man1/rm.1 [new file with mode: 0644]
man/man1/rmdir.1 [new file with mode: 0644]
man/man1/roff.1 [new file with mode: 0644]
man/man1/sh.1 [new file with mode: 0644]
man/man1/size.1 [new file with mode: 0644]
man/man1/sno.1 [new file with mode: 0644]
man/man1/sort.1 [new file with mode: 0644]
man/man1/speak.1 [new file with mode: 0644]
man/man1/split.1 [new file with mode: 0644]
man/man1/stat.1 [new file with mode: 0644]
man/man1/strip.1 [new file with mode: 0644]
man/man1/stty.1 [new file with mode: 0644]
man/man1/sum.1 [new file with mode: 0644]
man/man1/tap.1 [new file with mode: 0644]
man/man1/time.1 [new file with mode: 0644]
man/man1/tmg.1 [new file with mode: 0644]
man/man1/tss.1 [new file with mode: 0644]
man/man1/tty.1 [new file with mode: 0644]
man/man1/type.1 [new file with mode: 0644]
man/man1/typo.1 [new file with mode: 0644]
man/man1/un.1 [new file with mode: 0644]
man/man1/uniq.1 [new file with mode: 0644]
man/man1/vs.1 [new file with mode: 0644]
man/man1/wc.1 [new file with mode: 0644]
man/man1/who.1 [new file with mode: 0644]
man/man1/write.1 [new file with mode: 0644]
man/man2/boot.2 [new file with mode: 0644]
man/man2/break.2 [new file with mode: 0644]
man/man2/cemt.2 [new file with mode: 0644]
man/man2/chdir.2 [new file with mode: 0644]
man/man2/chmod.2 [new file with mode: 0644]
man/man2/chown.2 [new file with mode: 0644]
man/man2/close.2 [new file with mode: 0644]
man/man2/creat.2 [new file with mode: 0644]
man/man2/csw.2 [new file with mode: 0644]
man/man2/dup.2 [new file with mode: 0644]
man/man2/exec.2 [new file with mode: 0644]
man/man2/exit.2 [new file with mode: 0644]
man/man2/fork.2 [new file with mode: 0644]
man/man2/fpe.2 [new file with mode: 0644]
man/man2/fstat.2 [new file with mode: 0644]
man/man2/getuid.2 [new file with mode: 0644]
man/man2/gtty.2 [new file with mode: 0644]
man/man2/ilgins.2 [new file with mode: 0644]
man/man2/intr.2 [new file with mode: 0644]
man/man2/kill.2 [new file with mode: 0644]
man/man2/link.2 [new file with mode: 0644]
man/man2/makdir.2 [new file with mode: 0644]
man/man2/mdate.2 [new file with mode: 0644]
man/man2/mount.2 [new file with mode: 0644]
man/man2/nice.2 [new file with mode: 0644]
man/man2/open.2 [new file with mode: 0644]
man/man2/pipe.2 [new file with mode: 0644]
man/man2/quit.2 [new file with mode: 0644]
man/man2/read.2 [new file with mode: 0644]
man/man2/rele.2 [new file with mode: 0644]
man/man2/seek.2 [new file with mode: 0644]
man/man2/setuid.2 [new file with mode: 0644]
man/man2/sleep.2 [new file with mode: 0644]
man/man2/stat.2 [new file with mode: 0644]
man/man2/stime.2 [new file with mode: 0644]
man/man2/stty.2 [new file with mode: 0644]
man/man2/sync.2 [new file with mode: 0644]
man/man2/time.2 [new file with mode: 0644]
man/man2/times.2 [new file with mode: 0644]
man/man2/umount.2 [new file with mode: 0644]
man/man2/unlink.2 [new file with mode: 0644]
man/man2/wait.2 [new file with mode: 0644]
man/man2/write.2 [new file with mode: 0644]
man/man3/atan.3 [new file with mode: 0644]
man/man3/atof.3 [new file with mode: 0644]
man/man3/atoi.3 [new file with mode: 0644]
man/man3/compar.3 [new file with mode: 0644]
man/man3/crypt.3 [new file with mode: 0644]
man/man3/ctime.3 [new file with mode: 0644]
man/man3/ddsput.3 [new file with mode: 0644]
man/man3/ecvt.3 [new file with mode: 0644]
man/man3/exp.3 [new file with mode: 0644]
man/man3/ftoa.3 [new file with mode: 0644]
man/man3/ftoo.3 [new file with mode: 0644]
man/man3/gerts.3 [new file with mode: 0644]
man/man3/getc.3 [new file with mode: 0644]
man/man3/hypot.3 [new file with mode: 0644]
man/man3/itoa.3 [new file with mode: 0644]
man/man3/log.3 [new file with mode: 0644]
man/man3/mesg.3 [new file with mode: 0644]
man/man3/nlist.3 [new file with mode: 0644]
man/man3/pow.3 [new file with mode: 0644]
man/man3/ptime.3 [new file with mode: 0644]
man/man3/putc.3 [new file with mode: 0644]
man/man3/qsort.3 [new file with mode: 0644]
man/man3/rand.3 [new file with mode: 0644]
man/man3/salloc.3 [new file with mode: 0644]
man/man3/sin.3 [new file with mode: 0644]
man/man3/sqrt.3 [new file with mode: 0644]
man/man3/switch.3 [new file with mode: 0644]
man/man3/ttyn.3 [new file with mode: 0644]
man/man4/dc.4 [new file with mode: 0644]
man/man4/dn.4 [new file with mode: 0644]
man/man4/dp.4 [new file with mode: 0644]
man/man4/kl.4 [new file with mode: 0644]
man/man4/mem.4 [new file with mode: 0644]
man/man4/pc.4 [new file with mode: 0644]
man/man4/rf.4 [new file with mode: 0644]
man/man4/rk.4 [new file with mode: 0644]
man/man4/tc.4 [new file with mode: 0644]
man/man4/tm.4 [new file with mode: 0644]
man/man4/vt.4 [new file with mode: 0644]
man/man5/a.out.5 [new file with mode: 0644]
man/man5/ar.5 [new file with mode: 0644]
man/man5/core.5 [new file with mode: 0644]
man/man5/dir.5 [new file with mode: 0644]
man/man5/fs.5 [new file with mode: 0644]
man/man5/passwd.5 [new file with mode: 0644]
man/man5/tap.5 [new file with mode: 0644]
man/man5/utmp.5 [new file with mode: 0644]
man/man5/wtmp.5 [new file with mode: 0644]
man/man6/bc.6 [new file with mode: 0644]
man/man6/bj.6 [new file with mode: 0644]
man/man6/ptx.6 [new file with mode: 0644]
man/man6/yacc.6 [new file with mode: 0644]
man/man7/ascii.7 [new file with mode: 0644]
man/man7/dpd.7 [new file with mode: 0644]
man/man7/getty.7 [new file with mode: 0644]
man/man7/glob.7 [new file with mode: 0644]
man/man7/greek.7 [new file with mode: 0644]
man/man7/init.7 [new file with mode: 0644]
man/man7/msh.7 [new file with mode: 0644]
man/man7/tabs.7 [new file with mode: 0644]
man/man7/vsp.7 [new file with mode: 0644]
man/man8/20boot.8 [new file with mode: 0644]
man/man8/acct.8 [new file with mode: 0644]
man/man8/bproc.8 [new file with mode: 0644]
man/man8/check.8 [new file with mode: 0644]
man/man8/chk.8 [new file with mode: 0644]
man/man8/clri.8 [new file with mode: 0644]
man/man8/dcheck.8 [new file with mode: 0644]
man/man8/dli.8 [new file with mode: 0644]
man/man8/istat.8 [new file with mode: 0644]
man/man8/kill.8 [new file with mode: 0644]
man/man8/mount.8 [new file with mode: 0644]
man/man8/ps.8 [new file with mode: 0644]
man/man8/salv.8 [new file with mode: 0644]
man/man8/su.8 [new file with mode: 0644]
man/man8/swtmp.8 [new file with mode: 0644]
man/man8/tm.8 [new file with mode: 0644]
man/man8/umount.8 [new file with mode: 0644]
man/manx/as.1 [new file with mode: 0644]
man/manx/asmt.cat [new file with mode: 0644]
man/manx/asmt.x [new file with mode: 0644]
man/manx/basic.6 [new file with mode: 0644]
man/manx/cal.6 [new file with mode: 0644]
man/manx/chash.1 [new file with mode: 0644]
man/manx/das.6 [new file with mode: 0644]
man/manx/dds.1 [new file with mode: 0644]
man/manx/dpt.6 [new file with mode: 0644]
man/manx/fptrap.3 [new file with mode: 0644]
man/manx/fstrip.1 [new file with mode: 0644]
man/manx/ident.5 [new file with mode: 0644]
man/manx/kbd.7 [new file with mode: 0644]
man/manx/login.7 [new file with mode: 0644]
man/manx/lpr.4 [new file with mode: 0644]
man/manx/moo.6 [new file with mode: 0644]
man/manx/obproc.7 [new file with mode: 0644]
man/manx/rp.4 [new file with mode: 0644]
man/manx/speakm.5 [new file with mode: 0644]
man/manx/ttt.6 [new file with mode: 0644]
man/manx/uids.5 [new file with mode: 0644]

diff --git a/c/c00.c b/c/c00.c
new file mode 100644 (file)
index 0000000..dde755e
--- /dev/null
+++ b/c/c00.c
@@ -0,0 +1,777 @@
+/* C compiler
+
+Copyright 1972 Bell Telephone Laboratories, Inc. 
+
+*/
+
+init(s, t)
+char s[]; {
+       extern symbuf, namsiz;
+       char symbuf[], sp[];
+       int np[], i;
+
+       i = namsiz;
+       sp = symbuf;
+       while(i--)
+               if ((*sp++ = *s++)=='\0') --s;
+       np = lookup();
+       *np++ = 1;
+       *np = t;
+}
+
+main(argc, argv)
+int argv[]; {
+       extern extdef, eof;
+       extern fout, fin, nerror, tmpfil, xdflg;
+
+       if(argc<4) {
+               error("Arg count");
+               exit(1);
+       }
+       if((fin=open(argv[1],0))<0) {
+               error("Can't find %s", argv[1]);
+               exit(1);
+       }
+       if((fout=creat(argv[2], 017))<0) {
+               error("Can't create %s", argv[2]);
+               exit(1);
+       }
+       tmpfil = argv[3];
+       xdflg++;
+       init("int", 0);
+       init("char", 1);
+       init("float", 2);
+       init("double", 3);
+       init("struct", 4);
+       init("auto", 5);
+       init("extern", 6);
+       init("static", 7);
+       init("goto", 10);
+       init("return", 11);
+       init("if", 12);
+       init("while", 13);
+       init("else", 14);
+       init("switch", 15);
+       init("case", 16);
+       init("break", 17);
+       init("continue", 18);
+       init("do", 19);
+       init("default", 20);
+       xdflg = 0;
+       while(!eof) {
+               extdef();
+               blkend();
+       }
+       flush();
+       flshw();
+       exit(nerror!=0);
+}
+
+lookup() {
+       extern hshtab, hshsiz, pssiz, symbuf, xdflg;
+       int hshtab[], symbuf[];
+       extern hshlen, hshused, nwps;
+       auto i, j, np[], sp[], rp[];
+
+       i = 0;
+       sp = symbuf;
+       j = nwps;
+       while(j--)
+               i =+ *sp++ & 077577;
+       if (i<0) i = -i;
+       i =% hshsiz;
+       i =* pssiz;
+       while(*(np = &hshtab[i+4])) {
+               sp = symbuf;
+               j = nwps;
+               while(j--)
+                       if ((*np++&077577) != *sp++) goto no;
+               return(&hshtab[i]);
+no:            if ((i =+ pssiz) >= hshlen) i = 0;
+       }
+       if(++hshused > hshsiz) {
+               error("Symbol table overflow");
+               exit(1);
+       }
+       rp = np = &hshtab[i];
+       sp = symbuf;
+       j = 4;
+       while(j--)
+               *np++ = 0;
+       j = nwps;
+       while(j--)
+               *np++ = *sp++;
+       *np = 0;
+       if (xdflg)
+               rp[4] =| 0200;          /* mark non-deletable */
+       return(rp);
+}
+
+symbol() {
+       extern peeksym, peekc, eof, line;
+       extern csym, symbuf, namsiz, lookup, ctab, cval;
+       int csym[];
+       extern isn, mosflg, xdflg;
+       auto b, c;
+       char symbuf[], sp[], ctab[];
+
+       if (peeksym>=0) {
+               c = peeksym;
+               peeksym = -1;
+               if (c==20)
+                       mosflg = 0;
+               return(c);
+       }
+       if (peekc) {
+               c = peekc;
+               peekc = 0;
+       } else
+               if (eof)
+                       return(0); else
+                       c = getchar();
+loop:
+       switch(ctab[c]) {
+
+       case 125:       /* newline */
+               line++;
+
+       case 126:       /* white space */
+               c = getchar();
+               goto loop;
+
+       case 0:         /* EOF */
+               eof++;
+               return(0);
+
+       case 40:        /* + */
+               return(subseq(c,40,30));
+
+       case 41:        /* - */
+               return(subseq(c,subseq('>',41,50),31));
+
+       case 80:        /* = */
+               if (subseq(' ',0,1)) return(80);
+               c = symbol();
+               if (c>=40 & c<=49)
+                       return(c+30);
+               if (c==80)
+                       return(60);
+               peeksym = c;
+               return(80);
+
+       case 63:        /* < */
+               if (subseq(c,0,1)) return(46);
+               return(subseq('=',63,62));
+
+       case 65:        /* > */
+               if (subseq(c,0,1)) return(45);
+               return(subseq('=',65,64));
+
+       case 34:        /* ! */
+               return(subseq('=',34,61));
+
+       case 43:        /* / */
+               if (subseq('*',1,0))
+                       return(43);
+com:
+               c = getchar();
+com1:
+               if (c=='\0') {
+                       eof++;
+                       error("Nonterminated comment");
+                       return(0);
+               }
+               if (c=='\n')
+                       line++;
+               if (c!='*')
+                       goto com;
+               c = getchar();
+               if (c!='/')
+                       goto com1;
+               c = getchar();
+               goto loop;
+
+       case 120:       /* . */
+       case 124:       /* number */
+               peekc = c;
+               switch(c=getnum(c=='0'? 8:10)) {
+                       case 25:                /* float 0 */
+                               c = 23;
+                               break;
+
+                       case 23:                /* float non 0 */
+                               cval = isn++;
+               }
+               return(c);
+
+       case 122:       /* " */
+               return(getstr());
+
+       case 121:       /* ' */
+               return(getcc());
+
+       case 123:       /* letter */
+               sp = symbuf;
+               if (mosflg) {
+                       *sp++ = '.';
+                       mosflg = 0;
+               }
+               while(ctab[c]==123 | ctab[c]==124) {
+                       if (sp<symbuf+namsiz) *sp++ = c;
+                       c = getchar();
+               }
+               while(sp<symbuf+namsiz)
+                       *sp++ = '\0';
+               peekc = c;
+               csym = lookup();
+               if (csym[0]==1) {       /* keyword */
+                       cval = csym[1];
+                       return(19);
+               }
+               return(20);
+
+       case 127:       /* unknown */
+               error("Unknown character");
+               c = getchar();
+               goto loop;
+
+       }
+       return(ctab[c]);
+}
+
+subseq(c,a,b) {
+       extern peekc;
+
+       if (!peekc)
+               peekc = getchar();
+       if (peekc != c)
+               return(a);
+       peekc = 0;
+       return(b);
+}
+getstr() {
+       extern isn, cval, strflg;
+       auto c;
+       char t[], d[];
+
+       t = ".text";
+       d = ".data";
+       printf("%s;L%d:.byte ", (strflg?t:d), cval=isn++);
+       while((c=mapch('"')) >= 0)
+               printf("%o,", c);
+       printf("0;.even;%s\n", (strflg?d:t));
+       return(22);
+}
+
+getcc()
+{
+       extern cval, ncpw;
+       auto c, cc;
+       char cp[];
+
+       cval = 0;
+       cp = &cval;
+       cc = 0;
+       while((c=mapch('\'')) >= 0)
+               if(cc++ < ncpw)
+                       *cp++ = c;
+       if(cc>ncpw)
+               error("Long character constant");
+       return(21);
+}
+
+mapch(c)
+{
+       extern peekc, line;
+       auto a;
+
+       if((a=getchar())==c)
+               return(-1);
+       switch(a) {
+
+       case '\n':
+       case 0:
+               error("Nonterminated string");
+               peekc = a;
+               return(-1);
+
+       case '\\':
+               switch (a=getchar()) {
+
+               case 't':
+                       return('\t');
+
+               case 'n':
+                       return('\n');
+
+               case '0':
+                       return('\0');
+
+               case 'r':
+                       return('\r');
+
+               case '\n':
+                       line++;
+                       return('\n');
+               }
+
+       }
+       return(a);
+}
+
+tree() {
+       extern csym, ctyp, isn, fcval, peeksym, opdope, cp, cmst;
+       int csym[], opdope[], cp[], cmst[];
+       extern space, cval, ossiz, cmsiz, mosflg, osleft;
+       double fcval;
+       int space[];
+
+       int op[], opst[20], pp[], prst[20], andflg, o,
+               p, ps, os;
+
+       osleft = ossiz;
+       space = 0;
+       *space++ = 0;
+       op = opst;
+       pp = prst;
+       cp = cmst;
+       *op = 200;              /* stack EOF */
+       *pp = 06;
+       andflg = 0;
+
+advanc:
+       switch (o=symbol()) {
+
+       /* name */
+       case 20:
+               if (*csym==0)
+                       if((peeksym=symbol())==6) {     /* ( */
+                               *csym = 6;              /* extern */
+                               csym[1] = 020;          /* int() */
+                       } else {
+                               csym[1] = 030;          /* array */
+                               if (csym[2]==0)
+                                       csym[2] = isn++;
+                       }
+               *cp++ = block(2,20,csym[1],csym[3],*csym,0);
+               if (*csym==6) {                 /* external */
+                       o = 3;
+                       while(++o<8) {
+                               pblock(csym[o]);
+                               if ((csym[o]&077400) == 0)
+                                       break;
+                       }
+               } else
+                       pblock(csym[2]);
+               goto tand;
+
+       /* short constant */
+       case 21:
+       case21:
+               *cp++ = block(1,21,ctyp,0,cval);
+               goto tand;
+
+       /* floating constant */
+       case 23:
+               *cp++ = block(1,23,3,0,cval);
+               if (cval)               /* non-0 */
+                       printf(".data;L%d:%o;%o;%o;%o;.text\n",cval,fcval);
+               goto tand;
+
+       /* string constant: fake a static char array */
+       case 22:
+               *cp++ = block(3, 20, 031, 1, 7, 0, cval);
+
+tand:
+               if(cp>=cmst+cmsiz) {
+                       error("Expression overflow");
+                       exit(1);
+               }
+               if (andflg)
+                       goto syntax;
+               andflg = 1;
+               goto advanc;
+
+       /* ++, -- */
+       case 30:
+       case 31:
+               if (andflg)
+                       o =+ 2;
+               goto oponst;
+
+       /* ! */
+       case 34:
+       /* ~ */
+       case 38:
+               if (andflg)
+                       goto syntax;
+               goto oponst;
+
+       /* - */
+       case 41:
+               if (!andflg) {
+                       peeksym = symbol();
+                       if (peeksym==21) {
+                               peeksym = -1;
+                               cval = -cval;
+                               goto case21;
+                       }
+                       o = 37;
+               }
+               andflg = 0;
+               goto oponst;
+
+       /* & */
+       /* * */
+       case 47:
+       case 42:
+               if (andflg)
+                       andflg = 0; else
+                       if(o==47)
+                               o = 35;
+                       else
+                               o = 36;
+               goto oponst;
+
+       /* ( */
+       case 6:
+               if (andflg) {
+                       o = symbol();
+                       if (o==7)
+                               o = 101; else {
+                               peeksym = o;
+                               o = 100;
+                               andflg = 0;
+                       }
+               }
+       goto oponst;
+
+       /* ) */
+       /* ] */
+       case 5:
+       case 7:
+               if (!andflg)
+                       goto syntax;
+               goto oponst;
+
+       case 39:        /* . */
+               mosflg++;
+               break;
+
+       }
+       /* binaries */
+       if (!andflg)
+               goto syntax;
+       andflg = 0;
+
+oponst:
+       p = (opdope[o]>>9) & 077;
+opon1:
+       ps = *pp;
+       if (p>ps | p==ps & (opdope[o]&0200)!=0) { /* right-assoc */
+putin:
+               switch (o) {
+
+               case 6: /* ( */
+               case 4: /* [ */
+               case 100: /* call */
+                       p = 04;
+               }
+               if(op>=opst+20) {               /* opstack size */
+                       error("expression overflow");
+                       exit(1);
+               }
+               *++op = o;
+               *++pp = p;
+               goto advanc;
+       }
+       --pp;
+       switch (os = *op--) {
+
+       /* EOF */
+       case 200:
+               peeksym = o;
+               return(*--cp);
+
+       /* call */
+       case 100:
+               if (o!=7)
+                       goto syntax;
+               build(os);
+               goto advanc;
+
+       /* mcall */
+       case 101:
+               *cp++ = block(0,0,0,0); /* 0 arg call */
+               os = 100;
+               goto fbuild;
+
+       /* ( */
+       case 6:
+               if (o!=7)
+                       goto syntax;
+               goto advanc;
+
+       /* [ */
+       case 4:
+               if (o!=5)
+                       goto syntax;
+               build(4);
+               goto advanc;
+       }
+fbuild:
+       build(os);
+       goto opon1;
+
+syntax:
+       error("Expression syntax");
+       errflush(o);
+       return(0);
+}
+
+scdeclare(kw)
+{
+       extern csym, paraml, parame, peeksym;
+       int csym[], paraml[], parame[];
+       int o;
+
+       while((o=symbol())==20) {               /* name */
+               if(*csym>0 & *csym!=kw)
+                       redec();
+               *csym = kw;
+               if(kw==8)  {            /* parameter */
+                       *csym = -1;
+                       if (paraml==0)
+                               paraml = csym;
+                       else
+                               *parame = csym;
+                       parame = csym;
+               }
+               if ((o=symbol())!=9)    /* , */
+                       break;
+       }
+       if(o==1 & kw!=8 | o==7 & kw==8)
+               return;
+syntax:
+       decsyn(o);
+}
+
+tdeclare(kw, offset, mos)
+{
+       int o, elsize, ds[];
+       extern xdflg, peeksym, mosflg, defsym, csym;
+       int csym[], ssym[];
+
+       if (kw == 4) {                          /* struct */
+               ssym = 0;
+               ds = defsym;
+               mosflg = mos;
+               if ((o=symbol())==20) {         /* name */
+                       ssym = csym;
+                       o = symbol();
+               }
+               mosflg = mos;
+               if (o != 6) {                   /* ( */
+                       if (ssym==0)
+                               goto syntax;
+                       if (*ssym!=8)           /* class structname */
+                               error("Bad structure name");
+                       if (ssym[3]==0) {       /* no size yet */
+                               kw = 5;         /* deferred MOS */
+                               elsize = ssym;
+                       } else
+                               elsize = ssym[3];
+                       peeksym = o;
+               } else {
+                       if (ssym) {
+                               if (*ssym)
+                                       redec();
+                               *ssym = 8;
+                               ssym[3] = 0;
+                       }
+                       elsize = declist(4);
+                       if ((elsize&01) != 0)
+                               elsize++;
+                       defsym = ds;
+                       if ((o = symbol()) != 7)        /* ) */
+                               goto syntax;
+                       if (ssym)
+                               ssym[3] = elsize;
+               }
+       }
+       mosflg = mos;
+       if ((peeksym=symbol()) == 1) {          /* ; */
+               peeksym = -1;
+               mosflg = 0;
+               return(offset);
+       }
+       do {
+               offset =+ t1dec(kw, offset, mos, elsize);
+               if (xdflg & !mos)
+                       return;
+       } while ((o=symbol()) == 9);            /* , */
+       if (o==1)
+               return(offset);
+syntax:
+       decsyn(o);
+}
+
+t1dec(kw, offset, mos, elsize)
+{
+       int type, nel, defsym[], t1;
+       extern defsym, mosflg;
+
+       nel = 0;
+       mosflg = mos;
+       if ((t1=getype(&nel)) < 0)
+               goto syntax;
+       type = 0;
+       do
+               type = type<<2 | (t1 & 03);
+       while(t1 =>> 2);
+       t1 = type<<3 | kw;
+       if (defsym[1] & defsym[1]!=t1)
+               redec();
+       defsym[1] = t1;
+       defsym[3] = elsize;
+       elsize = length(defsym);
+       if (mos) {
+               if (*defsym)
+                       redec();
+               else
+                       *defsym = 4;
+               if ((offset&1)!=0 & elsize!=1)
+                       offset++;
+               defsym[2] = offset;
+       } else
+               if (*defsym == 0)
+                       *defsym = -2;           /* default auto */
+       if (nel==0)
+               nel = 1;
+       defsym[8] = nel;
+syntax:
+       return(nel*elsize);
+}
+
+getype(pnel)
+int pnel[];
+{
+       int o, type;
+       extern cval, peeksym, xdflg, defsym, csym, pssiz;
+       int defsym[], csym[];
+
+       switch(o=symbol()) {
+
+       case 42:                                        /* * */
+               return(getype(pnel)<<2 | 01);
+
+       case 6:                                         /* ( */
+               type = getype(pnel);
+               if ((o=symbol()) != 7)                  /* ) */
+                       goto syntax;
+               goto getf;
+
+       case 20:                                        /* name */
+               defsym = csym;
+               type = 0;
+       getf:
+               switch(o=symbol()) {
+
+               case 6:                                 /* ( */
+                       if (xdflg) {
+                               xdflg = 0;
+                               o = defsym;
+                               scdeclare(8);
+                               defsym = o;
+                               xdflg++;
+                       } else
+                               if ((o=symbol()) != 7)  /* ) */
+                                       goto syntax;
+                       type = type<<2 | 02;
+                       goto getf;
+
+               case 4:                                 /* [ */
+                       if ((o=symbol()) != 5) {        /* ] */
+                               if (o!=21)              /* const */
+                                       goto syntax;
+                               *pnel = cval;
+                               if ((o=symbol())!=5)
+                                       goto syntax;
+                       }
+                       type = type<<2 | 03;
+                       goto getf;
+               }
+               peeksym = o;
+               return(type);
+       }
+syntax:
+       decsyn(o);
+       return(-1);
+}
+
+decsyn(o)
+{
+       error("Declaration syntax");
+       errflush(o);
+}
+
+redec()
+{
+       extern csym;
+       int csym[];
+
+       error("%p redeclared", &csym[4]);
+}
+
+/* storage */
+
+regtab 0;
+efftab 1;
+cctab 2;
+sptab 3;
+symbuf[4];
+pssiz 9;
+namsiz 8;
+nwps 4;
+hshused;
+hshsiz 100;
+hshlen 900;    /* 9*hshsiz */
+hshtab[900];
+space;
+cp;
+cmsiz 40;
+cmst[40];
+ctyp;
+isn 1;
+swsiz 120;
+swtab[120];
+swp;
+contlab;
+brklab;
+deflab;
+nreg 4;
+nauto;
+stack;
+peeksym 0177777;
+peekc;
+eof;
+line 1;
+defsym;
+xdflg;
+csym;
+cval;
+fcval 0;       /* a double number */
+fc1 0;
+fc2 0;
+fc3 0;
+ncpw 2;
+nerror;
+paraml;
+parame;
+tmpfil;
+strflg;
+ossiz 250;
+osleft;
+mosflg;
+debug 0;
+
diff --git a/c/c01.c b/c/c01.c
new file mode 100644 (file)
index 0000000..3e7b6d6
--- /dev/null
+++ b/c/c01.c
@@ -0,0 +1,369 @@
+build(op) {
+       extern cp[], cvtab, opdope[], maprel[];
+       auto p1[], t1, d1, p2[], t2, d2, p3[], t3, d3, t;
+       auto d, dope, leftc, cvn, pcvn;
+       char cvtab[];
+
+       if (op==4)  {           /* [] */
+               build(40);      /* + */
+               op = 36;        /* * */
+       }
+       dope = opdope[op];
+       if ((dope&01)!=0) {     /* binary */
+               p2 = disarray(*--cp);
+               t2 = p2[1];
+               chkfun(p2);
+               d2 = p2[2];
+               if (*p2==20)
+                       d2 = 0;
+       }
+       p1 = disarray(*--cp);
+       if (op!=100 & op!=35)           /* call, * */
+               chkfun(p1);
+       t1 = p1[1];
+       d1 = p1[2];
+       if (*p1==20)
+               d1 = 0;
+       pcvn = 0;
+       switch (op) {
+
+       /* : */
+       case 8:
+               if (t1!=t2)
+                       error("Type clash in conditional");
+               t = t1;
+               goto nocv;
+
+       /* , */
+       case 9:
+               *cp++ = block(2, 9, 0, 0, p1, p2);
+               return;
+
+       /* ? */
+       case 90:
+               if (*p2!=8)
+                       error("Illegal conditional");
+               t = t2;
+               goto nocv;
+
+       /* call */
+       case 100:
+               if ((t1&030) != 020)
+                       error("Call of non-function");
+               *cp++ = block(2,100,decref(t1),24,p1,p2);
+               return;
+
+       /* * */
+       case 36:
+               if (*p1==35 | *p1==29) {        /* & unary */
+                       *cp++ = p1[3];
+                       return;
+               }
+               if (*p1!=20 & d1==0)
+                       d1 = 1;
+               if ((t1&030) == 020)            /* function */
+                       error("Illegal indirection");
+               *cp++ = block(1,36,decref(t1),d1,p1);
+               return;
+
+       /* & unary */
+       case 35:
+               if (*p1==36) {                  /* * */
+                       *cp++ = p1[3];
+                       return;
+               }
+               if (*p1==20) {
+                       *cp++ = block(1,p1[3]==5?29:35,incref(t1),1,p1);
+                       return;
+               }
+               error("Illegal lvalue");
+               break;
+
+       case 43:        /* / */
+       case 44:        /* % */
+       case 73:        /* =/ */
+       case 74:        /* =% */
+               d1++;
+               d2++;
+
+       case 42:        /* * */
+       case 72:        /* =* */
+               d1++;
+               d2++;
+               break;
+
+       case 30:        /* ++ -- pre and post */
+       case 31:
+       case 32:
+       case 33:
+               chklval(p1);
+               *cp++ = block(2,op,t1,max(d1,1),p1,plength(p1));
+               return;
+
+       case 39:        /* . (structure ref) */
+       case 50:        /* -> (indirect structure ref) */
+               if (p2[0]!=20 | p2[3]!=4)               /* not mos */
+                       error("Illegal structure ref");
+               *cp++ = p1;
+               t = t2;
+               if ((t&030) == 030)     /* array */
+                       t = decref(t);
+               setype(p1, t);
+               if (op==39)             /* is "." */
+                       build(35);      /* unary & */
+               *cp++ = block(1,21,7,0,p2[5]);
+               build(40);              /* + */
+               if ((t2&030) != 030)    /* not array */
+                       build(36);      /* unary * */
+               return;
+       }
+       if ((dope&02)!=0)               /* lvalue needed on left? */
+               chklval(p1);
+       if ((dope&020)!=0)              /* word operand on left? */
+               chkw(p1);
+       if ((dope&040)!=0)              /* word operand on right? */
+               chkw(p2);
+       if ((dope&01)==0) {             /* unary op? */
+               *cp++ = block(1,op,t1,max(d1,1),p1);
+               return;
+       }
+       if (t2==7) {
+               t = t1;
+               p2[1] = 0;      /* no int cv for struct */
+               t2 = 0;
+               goto nocv;
+       }
+       cvn = cvtab[11*lintyp(t1)+lintyp(t2)];
+       leftc = cvn&0100;
+       t = leftc? t2:t1;
+       if (op==80 & t1!=4 & t2!=4) {   /* = */
+               t = t1;
+               if (leftc | cvn!=1)
+                       goto nocv;
+       }
+       if (cvn =& 077) {
+               if (cvn==077) {
+       illcv:
+                       error("Illegal conversion");
+                       goto nocv;
+               }
+               if (cvn>4 & cvn<10) {           /* ptr conv */
+                       t = 0;                  /* integer result */
+                       cvn = 0;
+                       if ((dope&04)!=0)       /* relational? */
+                               goto nocv;
+                       if (op!=41)     /* - */
+                               goto illcv;
+                       pcvn = cvn;
+                       goto nocv;
+               }
+               if (leftc) {
+                       if ((dope&010) != 0) {  /* =op */
+                               if (cvn == 1) {
+                                       leftc = 0;
+                                       cvn = 8;
+                                       t = t1;
+                                       goto rcvt;
+                               } else
+                                       goto illcv;
+                       }
+                       d1 = (p1=convert(p1, t, d1, cvn, plength(p2)))[2];
+               } else {
+               rcvt:
+                       d2 = (p2=convert(p2, t, d2, cvn, plength(p1)))[2];
+               }
+nocv:;         }
+       if (d1==d2)
+               d = d1+1; else
+               d = max(d1,d2);
+       if ((dope&04)!=0) {             /* relational? */
+               if (op>61 & t>=010)
+                       op =+ 4;          /* ptr relation */
+               t = 0;          /* relational is integer */
+       }
+       *cp++ = optim(block(2,op,t,d,p1,p2));
+       if (pcvn) {
+               p1 = *--cp;
+               *cp++ = block(1,50+pcvn,0,d,p1);
+       }
+       return;
+       *cp++ = block(1,op,t1,d1==0?1:d1,p1);
+}
+
+setype(p, t)
+int p[];
+{
+       int p1[];
+
+       if ((p[1]&07) != 4)             /* not structure */
+               return;
+       p[1] = t;
+       switch(*p) {
+
+       case 29:                /* & */
+       case 35:
+               setype(p[3], decref(t));
+               return;
+
+       case 36:                /* * */
+               setype(p[3], incref(t));
+               return;
+
+       case 40:                /* + */
+               setype(p[4], t);
+       }
+}
+
+chkfun(p)
+int p[];
+{
+       if ((p[1]&030)==020)    /* func */
+               error("Illegal use of function");
+}
+
+optim(p)
+int p[];
+{
+       int p1[], p2[], t;
+
+       if (*p != 40)                           /* + */
+               return(p);
+       p1 = p[3];
+       p2 = p[4];
+       if (*p1==21) {                          /* const */
+               t = p1;
+               p1 = p2;
+               p2 = t;
+       }
+       if (*p2 != 21)                          /* const */
+               return(p);
+       if ((t=p2[3]) == 0)                     /* const 0 */
+               return(p1);
+       if (*p1!=35 & *p1!=29)                  /* not & */
+               return(p);
+       p2 = p1[3];
+       if (*p2!=20) {                          /* name? */
+               error("C error (optim)");
+               return(p);
+       }
+       p2[4] =+ t;
+       return(p1);
+}
+
+disarray(p)
+int p[];
+{
+       extern cp;
+       int t, cp[];
+
+       if (((t = p[1]) & 030)!=030 | p[0]==20&p[3]==4) /* array & not MOS */
+               return(p);
+       p[1] = decref(t);
+       *cp++ = p;
+       build(35);                              /* add & */
+       return(*--cp);
+}
+
+convert(p, t, d, cvn, len)
+int p[];
+{
+       int c, p1[];
+
+       if (*p==21) {           /* constant */
+               c = p[3];
+               switch(cvn) {
+
+               case 4:         /* int -> double[] */
+                       c =<< 1;
+
+               case 3:         /* int -> float[] */
+                       c =<< 1;
+
+               case 2:         /* int -> int[] */
+                       c =<< 1;
+                       p[3] = c;
+                       return(p);
+
+               case 10:        /* i -> s[] */
+                       p[3] = c*len;
+                       return(p);
+               }
+       }
+       if (cvn==10)                    /* i -> s[]; retrun i*len */
+               return(block(2,42,t,d+2,p,block(1,21,0,0,len)));
+       return(block(1, 50+cvn, t, max(1,d), p));
+}
+
+chkw(p)
+int p[]; {
+       extern error;
+       auto t;
+
+       if ((t=p[1])>1 & t<=07)
+               error("Integer operand required");
+       return;
+}
+
+lintyp(t)
+{
+       if (t<=07)
+               return(t);
+       if ((t&037)==t)
+               return((t&07)+5);
+       return(10);
+}
+
+error(s, p1, p2, p3, p4, p5, p6) {
+       extern line, fout, nerror;
+       int f;
+
+       nerror++;
+       flush();
+       f = fout;
+       fout = 1;
+       printf("%d: ", line);
+       printf(s, p1, p2, p3, p4, p5, p6);
+       putchar('\n');
+       fout = f;
+}
+
+block(n, op, t, d, p1,p2,p3)
+int p1[],p2[],p3[]; {
+       int p[], ap[], space[];
+       extern space;
+
+       ap = &op;
+       n =+ 3;
+       p = space;
+       while(n--)
+               pblock(*ap++);
+       return(p);
+}
+
+pblock(p)
+{
+       extern space, osleft;
+       int space[];
+
+       *space++ = p;
+       if (--osleft<=0) {
+               error("Expression overflow");
+               exit(1);
+       }
+}
+
+chklval(p)
+int p[]; {
+       extern error;
+
+       if (*p!=20 & *p !=36)
+               error("Lvalue required");
+}
+
+max(a, b)
+{
+       if (a>b)
+               return(a);
+       return(b);
+}
+
diff --git a/c/c02.c b/c/c02.c
new file mode 100644 (file)
index 0000000..93bd354
--- /dev/null
+++ b/c/c02.c
@@ -0,0 +1,505 @@
+extdef() {
+       extern eof, cval, defsym;
+       extern csym, strflg, xdflg, peeksym, fcval;
+       int o, c, cs[], type, csym[], width, nel, ninit, defsym[];
+       char s[];
+       float sf;
+       double fcval;
+
+       if(((o=symbol())==0) | o==1)    /* EOF */
+               return;
+       type = 0;
+       if (o==19) {                    /* keyword */
+               if ((type=cval)>4)
+                       goto syntax;    /* not type */
+       } else {
+               if (o==20)
+                       csym[4] =| 0200;        /* remember name */
+               peeksym = o;
+       }
+       defsym = 0;
+       xdflg++;
+       tdeclare(type, 0, 0);
+       if (defsym==0)
+               return;
+       *defsym = 6;
+       cs = &defsym[4];
+       printf(".globl  %p\n", cs);
+       strflg = 1;
+       xdflg = 0;
+       type = defsym[1];
+       if ((type&030)==020) {          /* a function */
+               printf(".text\n%p:\nmov r5,-(sp); mov sp,r5\n", cs);
+               declist(0);
+               strflg = 0;
+               c = 0;
+               if ((peeksym=symbol())!=2) {    /* { */
+                       blkhed();
+                       c++;
+               }
+               statement(1);
+               retseq();
+               if (c)
+                       blkend();
+               return;
+       }
+       width = length(defsym);
+       if ((type&030)==030)    /* array */
+               width = plength(defsym);
+       nel = defsym[8];
+       ninit = 0;
+       if ((peeksym=symbol()) == 1) {  /* ; */
+               printf(".comm   %p,%o\n", &defsym[4], nel*width);
+               peeksym = -1;
+               return;
+       }
+       printf(".data\n%p:", &defsym[4]);
+loop:  {
+               ninit++;
+               switch(o=symbol()) {
+       
+               case 22:                        /* string */
+                       if (width!=2)
+                               bxdec();
+                       printf("L%d\n", cval);
+                       break;
+       
+               case 41:                        /* - const */
+                       if ((o=symbol())==23) { /* float */
+                               fcval = -fcval;
+                               goto case23;
+                       }
+                       if (o!=21)
+                               goto syntax;
+                       cval = -cval;
+       
+               case 21:                        /* const */
+                       if (width==1)
+                               printf(".byte ");
+                       if (width>2) {
+                               fcval = cval;
+                               goto case23;
+                       }
+                       printf("%o\n", cval);
+                       break;
+       
+               case 20:                        /* name */
+                       if (width!=2)
+                               bxdec();
+                       printf("%p\n", &csym[4]);
+                       break;
+       
+               case 23:
+               case23:
+                       if (width==4) {
+                               sf = fcval;
+                               printf("%o;%o\n", sf);
+                               break;
+                       }
+                       if (width==8) {
+                               printf("%o;%o;%o;%o\n", fcval);
+                               break;
+                       }
+                       bxdec();
+                       break;
+       
+               default:
+                       goto syntax;
+       
+               }
+       } if ((o=symbol())==9) goto loop;       /* , */
+       if (o==1) {                     /* ; */
+       done:
+               if (ninit<nel)
+                       printf(".=.+%d.\n", (nel-ninit)*width);
+               return;
+       }
+syntax:
+       error("External definition syntax");
+       errflush(o);
+       statement(0);
+}
+
+bxdec()
+{
+       error("Inconsistent external initialization");
+}
+
+statement(d) {
+       extern symbol, error, blkhed, eof, peeksym;
+       extern blkend, csym[], rcexpr, block[], tree[], regtab[];
+       extern retseq, jumpc, jump, label, contlab, brklab, cval;
+       extern swp[], isn, pswitch, peekc;
+       extern efftab[], deflab, errflush, swtab[], swsiz, branch;
+
+       int o, o1, o2, o3, np[];
+
+stmt:
+       switch(o=symbol()) {
+
+       /* EOF */
+       case 0:
+               error("Unexpected EOF");
+       /* ; */
+       case 1:
+       /* } */
+       case 3:
+               return;
+
+       /* { */
+       case 2: {
+               if(d)
+                       blkhed();
+               while (!eof) {
+                       if ((o=symbol())==3)    /* } */
+                               goto bend;
+                       peeksym = o;
+                       statement(0);
+               }
+               error("Missing '}'");
+       bend:
+               return;
+       }
+
+       /* keyword */
+       case 19:
+               switch(cval) {
+
+               /* goto */
+               case 10:
+                       np = tree();
+                       if ((np[1]&030)!=030)   /* not array */
+                               np = block(1, 36, 1, np[2]+1, np);
+                       rcexpr(block(1,102,0,0,np), regtab);
+                       goto semi;
+
+               /* return */
+               case 11:
+                       if((peeksym=symbol())==6)       /* ( */
+                               rcexpr(block(1,110,0,0,pexpr()), regtab);
+                       retseq();
+                       goto semi;
+
+               /* if */
+               case 12:
+                       jumpc(pexpr(), o1=isn++, 0);
+                       statement(0);
+                       if ((o=symbol())==19 & cval==14) {  /* else */
+                               o2 = isn++;
+                               (easystmt()?branch:jump)(o2);
+                               label(o1);
+                               statement(0);
+                               label(o2);
+                               return;
+                       }
+                       peeksym = o;
+                       label(o1);
+                       return;
+
+               /* while */
+               case 13:
+                       o1 = contlab;
+                       o2 = brklab;
+                       label(contlab = isn++);
+                       jumpc(pexpr(), brklab=isn++, 0);
+                       o3 = easystmt();
+                       statement(0);
+                       (o3?branch:jump)(contlab);
+                       label(brklab);
+                       contlab = o1;
+                       brklab = o2;
+                       return;
+
+               /* break */
+               case 17:
+                       if(brklab==0)
+                               error("Nothing to break from");
+                       jump(brklab);
+                       goto semi;
+
+               /* continue */
+               case 18:
+                       if(contlab==0)
+                               error("Nothing to continue");
+                       jump(contlab);
+                       goto semi;
+
+               /* do */
+               case 19:
+                       o1 = contlab;
+                       o2 = brklab;
+                       contlab = isn++;
+                       brklab = isn++;
+                       label(o3 = isn++);
+                       statement(0);
+                       label(contlab);
+                       contlab = o1;
+                       if ((o=symbol())==19 & cval==13) { /* while */
+                               jumpc(tree(), o3, 1);
+                               label(brklab);
+                               brklab = o2;
+                               goto semi;
+                       }
+                       goto syntax;
+
+               /* case */
+               case 16:
+                       if ((o=symbol())!=21) { /* constant */
+                               if (o!=41)      /* - */
+                                       goto syntax;
+                               if ((o=symbol())!=21)
+                                       goto syntax;
+                               cval = - cval;
+                       }
+                       if ((o=symbol())!=8)    /* : */
+                               goto syntax;
+                       if (swp==0) {
+                               error("Case not in switch");
+                               goto stmt;
+                       }
+                       if(swp>=swtab+swsiz) {
+                               error("Switch table overflow");
+                       } else {
+                               *swp++ = isn;
+                               *swp++ = cval;
+                               label(isn++);
+                       }
+                       goto stmt;
+
+               /* switch */
+               case 15:
+                       o1 = brklab;
+                       brklab = isn++;
+                       np = pexpr();
+                       if (np[1]>1 & np[1]<07)
+                               error("Integer required");
+                       rcexpr(block(1,110,0,0,np), regtab);
+                       pswitch();
+                       brklab = o1;
+                       return;
+
+               /* default */
+               case 20:
+                       if (swp==0)
+                               error("Default not in switch");
+                       if ((o=symbol())!=8)    /* : */
+                               goto syntax;
+                       deflab = isn++;
+                       label(deflab);
+                       goto stmt;
+               }
+
+               error("Unknown keyword");
+               goto syntax;
+
+       /* name */
+       case 20:
+               if (peekc==':') {
+                       peekc = 0;
+                       if (csym[0]>0) {
+                               error("Redefinition");
+                               goto stmt;
+                       }
+                       csym[0] = 7;
+                       csym[1] = 030;  /* int[] */
+                       if (csym[2]==0)
+                               csym[2] = isn++;
+                       label(csym[2]);
+                       goto stmt;
+               }
+       }
+
+       peeksym = o;
+       rcexpr(tree(), efftab);
+       goto semi;
+
+semi:
+       if ((o=symbol())!=1)            /* ; */
+               goto syntax;
+       return;
+
+syntax:
+       error("Statement syntax");
+       errflush(o);
+       goto stmt;
+}
+
+pexpr()
+{
+       auto o, t;
+
+       if ((o=symbol())!=6)    /* ( */
+               goto syntax;
+       t = tree();
+       if ((o=symbol())!=7)    /* ) */
+               goto syntax;
+       return(t);
+syntax:
+       error("Statement syntax");
+       errflush(o);
+       return(0);
+}
+
+pswitch() {
+       extern swp[], isn, swtab[], printf, deflab, statement, brklab;
+       extern label;
+       int sswp[], dl, cv, swlab;
+
+       sswp = swp;
+       if (swp==0)
+               swp = swtab;
+       swlab = isn++;
+       printf("jsr     pc,bswitch; l%d\n", swlab);
+       dl = deflab;
+       deflab = 0;
+       statement(0);
+       if (!deflab) {
+               deflab = isn++;
+               label(deflab);
+       }
+       printf("L%d:.data;L%d:", brklab, swlab);
+       while(swp>sswp & swp>swtab) {
+               cv = *--swp;
+               printf("%o; l%d\n", cv, *--swp);
+       }
+       printf("L%d; 0\n.text\n", deflab);
+       deflab = dl;
+       swp = sswp;
+}
+
+blkhed()
+{
+       extern symbol, cval, peeksym, paraml[], parame[];
+       extern error, rlength, setstk, defvec, isn, defstat;
+       extern stack, hshtab[], hshsiz, pssiz;
+       int al, pl, cs[], hl, t[];
+
+       declist(0);
+       stack = al = 0;
+       pl = 4;
+       while(paraml) {
+               *parame = 0;
+               paraml = *(cs = paraml);
+               if (cs[1]==2)           /* float args -> double */
+                       cs[1] = 3;
+               cs[2] = pl;
+               *cs = 10;
+               if ((cs[1]&030) == 030)         /* array */
+                       cs[1] =- 020;           /* set ref */
+               pl =+ rlength(cs);
+       }
+       cs = hshtab;
+       hl = hshsiz;
+       while(hl--) {
+           if (cs[4]) {
+               if (cs[0]>1 & (cs[1]&07)==05) {  /* referred structure */
+                       t = cs[3];
+                       cs[3] = t[3];
+                       cs[1] = cs[1]&077770 | 04;
+               }
+               switch(cs[0]) {
+
+               /* sort unmentioned */
+               case -2:
+                       cs[0] = 5;              /* auto */
+
+               /* auto */
+               case 5:
+                       al =- trlength(cs);
+                       cs[2] = al;
+                       break;
+
+               /* parameter */
+               case 10:
+                       cs[0] = 5;
+                       break;
+
+               /* static */
+               case 7:
+                       cs[2] = isn;
+                       printf(".bss; L%d: .=.+%o; .text\n",
+                               isn++, trlength(cs));
+                       break;
+
+               }
+           }
+           cs = cs+pssiz;
+       }
+       setstk(al);
+}
+
+blkend() {
+       extern hshtab[], hshsiz, pssiz, hshused, debug;
+       auto i, hl;
+
+       i = 0;
+       hl = hshsiz;
+       while(hl--) {
+               if(hshtab[i+4]) {
+if (debug)
+if (hshtab[i]!=1)
+error("%p      %o      %o      %o      %o      %o",
+       &hshtab[i+4],
+       hshtab[i],
+       hshtab[i+1],
+       hshtab[i+2],
+       hshtab[i+3],
+       hshtab[i+8]);
+                       if (hshtab[i]==0)
+                               error("%p undefined", &hshtab[i+4]);
+                       if((hshtab[i+4]&0200)==0) {     /* not top-level */
+                               hshtab[i+4] = 0;
+                               hshused--;
+                       }
+               }
+               i =+ pssiz;
+       }
+}
+
+errflush(o) {
+       extern symbol, peeksym, eof;
+
+       while(o>3)      /* ; { } */
+               o = symbol();
+       peeksym  = o;
+}
+
+declist(mosflg)
+{
+       extern peeksym, csym[], cval;
+       auto o, offset;
+
+       offset = 0;
+       while((o=symbol())==19 & cval<10)
+               if (cval<=4)
+                       offset = tdeclare(cval, offset, mosflg);
+               else
+                       scdeclare(cval);
+       peeksym = o;
+       return(offset);
+}
+
+easystmt()
+{
+       extern peeksym, peekc, cval;
+
+       if((peeksym=symbol())==20)      /* name */
+               return(peekc!=':');      /* not label */
+       if (peeksym==19) {              /* keyword */
+               switch(cval)
+
+               case 10:        /* goto */
+               case 11:        /* return */
+               case 17:        /* break */
+               case 18:        /* continue */
+                       return(1);
+               return(0);
+       }
+       return(peeksym!=2);             /* { */
+}
+
+branch(lab)
+{
+       printf("br      L%d\n", lab);
+}
+
diff --git a/c/c03.c b/c/c03.c
new file mode 100644 (file)
index 0000000..4ca078c
--- /dev/null
+++ b/c/c03.c
@@ -0,0 +1,251 @@
+retseq()
+{
+       printf("jmp     retrn\n");
+}
+
+decref(t)
+{
+
+       if ((t & 077770) == 0) {
+               error("Illegal indirection");
+               return(t);
+       }
+       return((t>>2) & 077770 | t&07);
+}
+
+incref(t)
+{
+       return((t<<2)&077740 | (t&07) | 010);
+}
+
+jumpc(tree, lbl, cond)
+int tree[];
+{
+       extern cctab, block, rcexpr;
+
+       rcexpr(block(1,easystmt()+103,tree,lbl,cond),cctab);
+}
+
+rcexpr(tree, table)
+int tree[], table;
+{
+       extern space, putwrd, putchar, line;
+       int c, sp[];
+
+       if (tree == 0)
+               return;
+       putchar('#');
+       c = space;
+       c =/ 2;         /* # addresses per word */
+       sp = 0;
+       putwrd(c);
+       putwrd(tree);
+       putwrd(table);
+       putwrd(line);
+       while(c--)
+               putwrd(*sp++);
+}
+
+jump(lab) {
+       extern printf;
+
+       printf("jmp\tl%d\n", lab);
+}
+
+label(l) {
+       extern printf;
+
+       printf("L%d:", l);
+}
+
+setstk(a) {
+       extern printf, stack;
+       auto ts;
+
+       ts = a-stack;
+       stack = a;
+       switch(ts) {
+
+       case 0:
+               return;
+
+       case 0177776:   /* -2 */
+               printf("tst     -(sp)\n");
+               return;
+
+       case 0177774:   /* -4 */
+               printf("cmp     -(sp),-(sp)\n");
+               return;
+       }
+       printf("add     $%o,sp\n", ts);
+}
+
+plength(p)
+int p[];
+{
+       int t, l;
+
+       if (((t=p[1])&077770) == 0)             /* not a reference */
+               return(1);
+       p[1] = decref(t);
+       l = length(p);
+       p[1] = t;
+       return(l);
+}
+
+length(cs)
+int cs[];
+{
+       extern hshtab[];
+       int t;
+
+       t = cs[1];
+       if ((t&030) == 030)             /* array */
+               t = decref(t);
+       if (t>=010)
+               return(2);
+       switch(t&07) {
+
+       case 0:         /* int */
+               return(2);
+
+       case 1:         /* char */
+               return(1);
+
+       case 2:         /* float */
+               return(4);
+
+       case 3:         /* double */
+               return(8);
+
+       case 4:         /* structure */
+               if (cs>=hshtab)                 /* in namelist */
+                       return(cs[3]);
+               return(getlen(cs));
+
+       case 5:
+               error("Bad structure");
+               return(0);
+       }
+       error("Compiler error (length)");
+}
+
+getlen(p)
+int p[];
+{
+       int p1[];
+
+       switch(*p) {
+
+       case 20:                /* name */
+               return(p[2]);
+
+       case 35:
+       case 29:                /* & */
+       case 36:                /* * */
+       case 100:               /* call */
+       case 41:                /* - */
+               return(getlen(p[3]));
+
+       case 40:                /* + */
+               p1 = p[4];
+               if ((p1[1]&07) == 04)
+                       return(getlen(p1));
+               return(getlen(p[3]));
+       }
+       error("Unimplemented pointer conversion");
+       return(0);
+}
+
+rlength(cs)
+int cs[];
+{
+       auto l;
+
+       if (((l=length(cs))&01) != 0)
+               l++;
+       return(l);
+}
+
+tlength(cs)
+int cs[];
+{
+       int nel;
+
+       if ((nel = cs[8]) == 0)
+               nel = 1;
+       return(length(cs)*nel);
+}
+
+trlength(cs)
+int cs[];
+{
+       int l;
+
+       if (((l=tlength(cs))&01) != 0)
+               l++;
+       return(l);
+}
+
+printn(n,b) {
+       extern putchar;
+       auto a;
+
+       if(a=n/b) /* assignment, not test for equality */
+               printn(a, b); /* recursive */
+       putchar(n%b + '0');
+}
+
+printf(fmt,x1,x2,x3,x4,x5,x6,x7,x8,x9)
+char fmt[]; {
+       extern printn, putchar, namsiz, ncpw;
+       char s[];
+       auto adx[], x, c, i[];
+
+       adx = &x1; /* argument pointer */
+loop:
+       while((c = *fmt++) != '%') {
+               if(c == '\0')
+                       return;
+               putchar(c);
+       }
+       x = *adx++;
+       switch (c = *fmt++) {
+
+       case 'd': /* decimal */
+       case 'o': /* octal */
+               if(x < 0) {
+                       x = -x;
+                       if(x<0)  {      /* - infinity */
+                               if(c=='o')
+                                       printf("100000");
+                               else
+                                       printf("-32767");
+                               goto loop;
+                       }
+                       putchar('-');
+               }
+               printn(x, c=='o'?8:10);
+               goto loop;
+
+       case 's': /* string */
+               s = x;
+               while(c = *s++)
+                       putchar(c);
+               goto loop;
+
+       case 'p':
+               s = x;
+               putchar('_');
+               c = namsiz;
+               while(c--)
+                       if (*s)
+                               putchar((*s++)&0177);
+               goto loop;
+       }
+       putchar('%');
+       fmt--;
+       adx--;
+       goto loop;
+}
+
diff --git a/c/c10.c b/c/c10.c
new file mode 100644 (file)
index 0000000..e8a451d
--- /dev/null
+++ b/c/c10.c
@@ -0,0 +1,588 @@
+/*
+
+               C compiler, part 2
+
+       Copyright 1972 Bell Telephone Laboratories, Inc.
+
+*/
+
+waste()                /* waste space */
+{
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+       waste(waste(waste),waste(waste),waste(waste));
+}
+main(argc, argv)
+char argv[][];
+{
+       extern fout, fin, nerror, line;
+       extern getwrd, rcexpr, tmpfil;
+       extern cctab[], regtab[], efftab[], sptab[];
+       int sp[], c, table[], tabtab[3][], tree;
+
+       if (argc<4) {
+               error("Arg count");
+               exit(1);
+       }
+       if((fin=open(argv[1],0))<0) {
+               error("Cant't find %s", argv[1]);
+               exit(1);
+       }
+       if((fout=creat(argv[3],017))<0) {
+               error("Can't create %s", argv[3]);
+               exit(1);
+       }
+       tmpfil = argv[2];
+
+       tabtab[0] = regtab;
+       tabtab[1] = efftab;
+       tabtab[2] = cctab;
+       tabtab[3] = sptab;
+       while(c=getchar()) {
+               if(c=='#') {
+                       sp = 0;
+                       c = getwrd();
+                       tree = getwrd();
+                       table = tabtab[getwrd()];
+                       line = getwrd();
+                       while(c--)
+                               *sp++ = getwrd();
+                       rcexpr(tree, table, 0);
+               } else
+                       putchar(c);
+       }
+       flush();
+       exit(nerror!=0);
+}
+
+match(tree, table, nreg)
+int tree[], table[]; {
+       extern opdope[], cctab, maprel;
+       int op, d1, d2, t1, t2, p1[], p2[], dope, cctab[];
+       int maprel[];
+       char mp[];
+
+       if (tree==0)
+               return(0);
+       op = *tree;
+       if (op>=29)                     /* if not leaf */
+               p1 = tree[3];
+       else
+               p1 = tree;
+       t1 = p1[1];
+       d1 = dcalc(p1, nreg);
+       if (((dope=opdope[op])&01)!=0) {        /* binary? */
+               p2 = tree[4];
+               t2 = p2[1];
+               d2 = dcalc(p2, nreg);
+               if (d2>d1 & (dope&0100)!=0)     /* commute? */
+                   if (table!=cctab | (op!=47&op!=48)) { /* commute? */
+                       if ((dope&04)!=0)       /* relation? */
+                               *tree = op = maprel[op-60];
+                       dope = t1;
+                       t1 = t2;
+                       t2 = dope;
+                       dope = p1;
+                       tree[3] = p1 = p2;
+                       tree[4] = p2 = dope;
+                       dope = d1;
+                       d1 = d2;
+                       d2 = dope;
+                       dope = t1;
+                       t1 = t2;
+                       t2 = dope;
+               }
+       }
+       while(*table) {
+               if (*table++ == op) goto foundop;
+               table++;
+       }
+       return(0);
+foundop:
+       table = *table;
+nxtry:
+       mp = table;
+       if (*mp == 0)
+               return(0);
+       if (d1 > (*mp&077) | (*mp>=0100)&(*p1!=36))
+               goto notyet;
+       if (notcompat(t1, mp[1]))
+               goto notyet;
+       if ((opdope[op]&01)!=0 & p2!=0) {
+               if (d2 > (mp[2]&077) | (mp[2]>=0100)&(*p2!=36))
+                       goto notyet;
+               if (notcompat(t2,mp[3]))
+                       goto notyet;
+       }
+now:
+       return(table[2]);
+notyet:
+       table = table+3;
+       goto nxtry;
+}
+
+rcexpr(tree, table, reg)
+int tree[]; {
+       extern cexpr, regtab, cctab, sptab, printf, error;
+       extern jumpc, cbranch;
+       int r, modf;
+
+       if(tree==0)
+               return(0);
+       if(*tree == 103 | *tree==104) {
+               (*tree==103?jumpc:cbranch)(tree[1],tree[2],tree[3],0);
+               return(0);
+       }
+       modf = isfloat(tree)? 'f':0;
+       if (*tree == 110) {                     /* force r0 */
+               if((r=rcexpr(tree[3], table, reg)) != 0)
+                       printf("mov%c   r%d,r0\n", modf, r);
+               return(0);
+       }
+       if ((r=cexpr(tree, table, reg))>=0)
+               return(r);
+       if (table!=regtab) 
+               if((r=cexpr(tree, regtab, reg))>=0) {
+                       if (table==sptab)
+                               printf("mov%c   r%d,-(sp)\n", modf, r);
+                       if (table==cctab) {
+                               if (modf=='f')
+                                       printf("cfcc\n");
+                               printf("tst%c   r%d\n", modf, r);
+                       }
+                       return(0);
+               }
+       error("No match for op %d", *tree);
+}
+
+cexpr(tree, table, reg)
+int tree[][], table[]; {
+       extern match, nreg, printf, pname, putchar, regtab;
+       extern sptab, cctab, rcexpr, prins, rlength, popstk;
+       extern collcon, isn, label, branch, cbranch;
+       extern maprel[];
+       int p1[], p2[], c, r, p[], otable[], ctable[], regtab[], cctab[];
+       int sptab[];
+       char string[], match[];
+       int reg1, rreg;
+
+       if ((c = *tree)==100) {         /* call */
+               p1 = tree[3];
+               p2 = tree[4];
+               r = 0;
+               if(*p2) {
+                       while (*p2==9) { /* comma */
+                               rcexpr(p2[4], sptab, 0);
+                               r =+ arlength((p=p2[4])[1]);
+                               p2 = p2[3];
+                       }
+                       rcexpr(p2, sptab, 0);
+                       r =+ arlength(p2[1]);
+               }
+               *tree = 101;
+               tree[2] = r;            /* save arg length */
+       }
+       if(c==90) {             /* ? */
+               cbranch(tree[3], c=isn++, 0, reg);
+               rcexpr(tree[4][3], table, reg);
+               branch(r=isn++, 0);
+               label(c);
+               reg = rcexpr(tree[4][4], table, reg);
+               label(r);
+               goto retrn;
+       }
+       reg = oddreg(tree, reg);
+       reg1 = reg+1;
+       if ((string=match(tree, table, nreg-reg))==0) 
+               return(-1);
+       p1 = tree[3];
+       p2 = tree[4];
+loop:
+       switch(c = *string++) {
+
+       case '\0':
+               p = tree;
+               if (*p==101) {
+                       if (p[2]>0)
+                               popstk(p[2]);
+                       reg = 0;
+               }
+retrn:
+               c = isfloat(tree);
+               if (table==cctab & c)
+                       printf("cfcc\n");
+               if (!c)
+                       if ((c = *tree)==43 | c==73)
+                               reg--;
+               return(reg);
+
+       /* A1 */
+       case 'A':
+               p = tree[3];
+               goto adr;
+
+       /* A2 */
+       case 'B':
+               p = tree[4];
+               goto adr;
+
+       /* A */
+       case 'O':
+               p = tree;
+       adr:
+               pname(p);
+               goto loop;
+
+       /* I */
+       case 'M':
+               if ((c = *string)=='\'')
+                       string++; else
+                       c = 0;
+               prins(*tree, c);
+               goto loop;
+
+       /* B1 */
+       case 'C':
+               if ((c = *tree)<28)
+                       p = tree;
+               else
+                       p = tree[3];
+               goto pbyte;
+
+       /* BF */
+       case 'P':
+               p = tree;
+               goto pb1;
+
+       /* B2 */
+       case 'D':
+               p = tree[4];
+       pbyte:
+               if (p[1]==1)    /* char type? */
+                       putchar('b');
+       pb1:
+               if (isfloat(p))
+                       putchar('f');
+               goto loop;
+
+       /* BE */
+       case 'L':
+               if (tree[3][1]==1 | tree[4][1]==1)
+                       putchar('b');
+               p = tree;
+               goto pb1;
+
+       /* C1 */
+       case 'E':
+               p = p1[3];
+               goto const;
+
+       /* C2 */
+       case 'F':
+               p = p2[3];
+       const:
+               printf("%o", p);
+               goto loop;
+
+       /* F */
+       case 'G':
+               p = p1;
+               goto subtre;
+
+       /* S */
+       case 'K':
+               p = p2;
+               goto subtre;
+
+       /* H */
+       case 'H':
+               p = tree;
+
+       subtre:
+               ctable = regtab;
+               r = reg;
+               c = *string++ - 'A';
+               if ((c&02)!=0)
+                       ctable = sptab;
+               if ((c&04)!=0)
+                       ctable = cctab;
+               if((c&010)!=0)
+                       r = reg1;
+               if((c&01)!=0)
+                       if(*p==36) {
+                               p = p[3];
+                               if(collcon(p) & ctable!=sptab)
+                                       p = p[3];
+                       }
+               rreg = rcexpr(p, ctable, r);
+               if (rreg==r | ctable!=regtab)
+                       goto loop;
+               if (string[-2]=='G')    /* left operand */
+                       if (oddreg(tree, 0)==1) {
+                               printf("mov     r%d,r%d\n", rreg, r);
+                               goto loop;
+                       }
+               if (r==reg) {
+                       reg = rreg;
+                       reg1 = rreg+1;
+               } else
+                       reg1 = rreg;
+               goto loop;
+
+       /* R */
+       case 'I':
+               r = reg;
+               if (*string=='-') {
+                       string++;
+                       r--;
+               }
+               goto preg;
+
+       /* R1 */
+       case 'J':
+               r = reg1;
+       preg:
+               if (r>=5)
+                       error("Register overflow: simplify expression");
+               printf("r%d", r);
+               goto loop;
+
+       case '#':
+               p = p1[3];
+               goto nmbr;
+
+       case '"':
+               p = p2[3];
+               goto nmbr;
+
+       case '~':
+               p = tree[3];
+
+       nmbr:
+               if(collcon(p)) {
+                       if (*p==41)                     /* - */
+                               putchar('-');
+                       switch (*(p = p[4])) {
+
+                       case 21:                /* number */
+                               if (p[3])
+                                       printf("%d.", p[3]);
+                               break;
+
+                       case 35:                /* & name */
+                               pname(p[3]);
+                               break;
+
+                       }
+       }
+               goto loop;
+
+       /* V */
+       case 'V':
+               tree[0] = maprel[(c=tree[0])-60];
+               goto loop;
+
+       /* Z */
+       case 'Z':
+               printf("$%o", p1[5]+p1[4]);
+               goto loop;
+
+       case '^':               /* for ++ -- */
+               printf("%o", tree[4]);
+               goto loop;
+       }
+       putchar(c);
+       goto loop;
+}
+
+pname(p)
+int p[][]; {
+       char np[];
+       int i;
+
+loop:
+       switch(*p) {
+
+       case 21:                /* const */
+               printf("$%o", p[3]);
+               return;
+
+       case 23:                /* float const */
+               printf("L%d", p[3]);
+               return;
+
+       casename:
+       case 20:                /* name */
+               if (i=p[4])
+                       printf("%d.+", i);
+               switch(p[3]) {
+
+               case 5:         /* auto, param */
+                       printf("%d.(r5)", p[5]);
+                       return;
+
+               /* extern */
+               case 6:
+                       printf("%p", &p[5]);
+                       return;
+
+               case 4:
+                       error("Illegal structure reference");
+                       printf("$0");
+                       return;
+
+               }
+               printf("L%d", p[5]);
+               return;
+
+       case 35:                /* & */
+               putchar('$');
+               p = p[3];
+               goto loop;
+
+       case 36:                /* * */
+               putchar('*');
+               p = p[3];
+               goto loop;
+
+       }
+       error("pname called illegally");
+}
+
+dcalc(p, nreg)
+int p[]; {
+       int op, t, p1[], p2[];
+
+       if (p==0)
+               return(0);
+       op = *p;
+       switch (op) {
+
+       case 20:                /* name */
+       case 35:                /* & (non-automatic) */
+               return(12);
+
+       case 21:                /* short constant */
+               return(p[3]==0? 4:8);
+
+       case 23:                /* float const */
+               return(p[3]==0? 4:12);
+
+       case 36:                /* * */
+               p1 = p[3];
+               if (*p1==20)            /* name or offset name */
+                       return(12);
+       }
+
+def:
+       return(p[2]<=nreg? 20: 24);
+}
+
+notcompat(at, st) {
+
+       if (st==0)              /* word, byte */
+               return(at>1 & at<=07);
+       if (st==1)              /* word */
+               return(at>0 & at<=07);
+       st =- 2;
+       if ((at&077740) != 0)
+               at = 020;               /* *int for **stuff */
+       if ((at&077770) != 0)
+               at = at&07 | 020;
+       if (st==2 & at==3)
+               at = 2;
+       return(st != at);
+}
+
+prins(op, c) {
+       extern instab[], printf;
+       int insp[];
+
+       insp = instab;
+       while(*insp) {
+               if (*insp++ == op) {
+                       if ((c = insp[c!=0])==0)
+                               goto err;
+                       printf("%s", c);
+                       return;
+               } else
+                       insp = insp + 2;
+       }
+err:
+       error("No match' for op %d", op);
+}
+
+collcon(p)
+int p[]; {
+       int p1[], t[];
+
+       if(*p==40 | *p==41) {
+               if(*(p1=p[4])==21) {    /* number */
+                       return(1);
+               }
+               if (*p1==35)
+                       return(1);
+               if (*(p1=p[3])==35) {
+                       p1 = p[3];
+                       p[3] = p[4];
+                       p[4] = p1;
+                       return(1);
+               }
+       }
+       return(0);
+}
+
+isfloat(t)
+int t[];
+{
+       extern opdope[];
+       int rt;
+
+       if ((opdope[t[0]]&04)!=0)       /* relational */
+               t = t[3];
+       if ((rt=t[1])>=2 & rt<=3)
+               return(rt);
+       return(0);
+}
+
+nreg 3;
+isn 10000;
+namsiz 8;
+line;
+tmpfil;
+nerror;
+
+oddreg(t, reg)
+int t[];
+{
+       if (!isfloat(t))
+               switch(*t) {
+               case 43:        /* / */
+               case 44:        /* % */
+               case 73:        /* =/ */
+               case 74:        /* =% */
+                       reg++;
+
+               case 42:        /* * */
+               case 72:        /* =* */
+                       return(reg|1);
+               }
+       return(reg);
+}
+
+arlength(t)
+{
+       int arl;
+
+       if ((arl=rlength(t)) == 4)
+               return(8);
+       return(arl);
+}
+
+maprel[] 60, 61, 64, 65, 62, 63, 68, 69, 66, 67;
+
diff --git a/c/c11.c b/c/c11.c
new file mode 100644 (file)
index 0000000..948b3c7
--- /dev/null
+++ b/c/c11.c
@@ -0,0 +1,261 @@
+jumpc(tree, lbl, cond)
+int tree[]; {
+       extern jump, cctab[], rcexpr, isn, label, branch, cbranch;
+       int l1, l2;
+
+       if (tree==0)
+               return;
+       switch(*tree) {
+
+       /* & */
+       case 47:
+               if (cond) {
+                       cbranch(tree[3], l1=isn++, 0, 0);
+                       cbranch(tree[4], l1, 0, 0);
+                       jump(lbl);
+                       label(l1);
+               } else {
+                       cbranch(tree[3], l1=isn++, 0, 0);
+                       cbranch(tree[4], l2=isn++, 1, 0);
+                       label(l1);
+                       jump(lbl);
+                       label(l2);
+               }
+               return;
+
+       /* | */
+       case 48:
+               if (cond) {
+                       cbranch(tree[3], l1=isn++, 1, 0);
+                       cbranch(tree[4], l2=isn++, 0, 0);
+                       label(l1);
+                       jump(lbl);
+                       label(l2);
+               } else {
+                       cbranch(tree[3], l1=isn++, 1, 0);
+                       cbranch(tree[4], l1, 1, 0);
+                       jump(lbl);
+                       label(l1);
+               }
+               return;
+
+       /* ! */
+       case 34:
+               jumpc(tree[3], lbl, !cond);
+               return;
+       }
+       rcexpr(tree, cctab, 0);
+       branch(l1=isn++, *tree, cond);
+       jump(lbl);
+       label(l1);
+       return;
+}
+
+cbranch(tree, lbl, cond, reg)
+int tree[]; {
+       extern branch, cctab[], rcexpr, isn, label;
+       int l1;
+
+       if (tree==0)
+               return;
+       switch(*tree) {
+
+       /* & */
+       case 47:
+               if (cond) {
+                       cbranch(tree[3], l1=isn++, 0, reg);
+                       cbranch(tree[4], lbl, 1, reg);
+                       label(l1);
+               } else {
+                       cbranch(tree[3], lbl, 0, reg);
+                       cbranch(tree[4], lbl, 0, reg);
+               }
+               return;
+
+       /* | */
+       case 48:
+               if (cond) {
+                       cbranch(tree[3], lbl, 1, reg);
+                       cbranch(tree[4], lbl, 1, reg);
+               } else {
+                       cbranch(tree[3], l1=isn++, 1, reg);
+                       cbranch(tree[4], lbl, 0, reg);
+                       label(l1);
+               }
+               return;
+
+       /* ! */
+       case 34:
+               cbranch(tree[3], lbl, !cond, reg);
+               return;
+       }
+       rcexpr(tree, cctab, reg);
+       branch(lbl, *tree, !cond);
+       return;
+}
+
+
+branch(lbl, op, c) {
+       extern printf, prins, opdope[];
+
+       if(op) {
+               if((opdope[op]&04)==0)
+                       op = 61;
+               prins(op,c);
+       } else
+               printf("br");
+       printf("\tl%d\n", lbl);
+}
+
+jump(lab) {
+       extern printf;
+
+       printf("jmp\tl%d\n", lab);
+}
+
+label(l) {
+       extern printf;
+
+       printf("l%d:", l);
+}
+
+
+popstk(a) {
+       extern printf;
+
+       switch(a) {
+
+       case 0:
+               return;
+
+       case 2:
+               printf("tst     (sp)+\n");
+               return;
+
+       case 4:
+               printf("cmp     (sp)+,(sp)+\n");
+               return;
+       }
+       printf("add     $%o,sp\n", a);
+}
+
+length(t) {
+
+       if (t>=010)
+               return(2);
+       switch(t) {
+
+       case 0:
+               return(2);
+
+       case 1:
+               return(1);
+
+       case 2:
+               return(4);
+
+       case 3:
+               return(8);
+
+       case 4:
+               return(4);
+
+       }
+       return(1024);
+}
+
+rlength(c) {
+       extern length;
+       auto l;
+
+       return((l=length(c))==1? 2: l);
+}
+
+printd(n) {
+       int a;
+
+       if(a=n/10)
+               printd(a);
+       putchar(n%10 + '0');
+}
+
+printo(n)
+{
+       int a;
+       if (a = (n>>3) & 017777)
+               printo(a);
+       putchar((n&07) + '0');
+}
+
+printf(fmt,x1,x2,x3,x4,x5,x6,x7,x8,x9)
+char fmt[]; {
+       extern namsiz, ncpw;
+       char s[];
+       auto adx[], x, c, i[];
+
+       adx = &x1; /* argument pointer */
+loop:
+       while((c = *fmt++) != '%') {
+               if(c == '\0')
+                       return;
+               putchar(c);
+       }
+       x = *adx++;
+       switch (c = *fmt++) {
+
+       case 'o':
+               printo(x);
+               goto loop;
+
+       case 'd': /* decimal */
+               if(x < 0) {
+                       x = -x;
+                       if(x<0)  {      /* - infinity */
+                               printf("-32768");
+                               goto loop;
+                       }
+                       putchar('-');
+               }
+               printd(x);
+               goto loop;
+
+       case 'c':
+               if (x)
+                       putchar(x);
+               goto loop;
+
+       case 's': /* string */
+               s = x;
+               while(c = *s++)
+                       putchar(c);
+               goto loop;
+
+       case 'p':
+               s = x;
+               putchar('_');
+               c = namsiz;
+               while(c--)
+                       if(*s)
+                               putchar((*s++)&0177);
+               goto loop;
+       }
+       putchar('%');
+       fmt--;
+       adx--;
+       goto loop;
+}
+
+error(s, p1, p2) {
+       extern printf, line, fout, flush, putchar, nerror;
+       int f;
+
+       nerror++;
+       flush();
+       f = fout;
+       fout = 1;
+       printf("%d: ", line);
+       printf(s, p1, p2);
+       putchar('\n');
+       fout = f;
+}
+
diff --git a/c/cctab.s b/c/cctab.s
deleted file mode 100644 (file)
index 9788639..0000000
--- a/c/cctab.s
+++ /dev/null
@@ -1,118 +0,0 @@
-/ c code tables-- set condition codes
-
-.globl _cctab
-
-_cctab=.;.+2
-       20.;    rest
-       21.;    rest
-       22.;    rest
-       30.;    rest
-       31.;    rest
-       34.;    rest
-       35.;    rest
-       36.;    rest
-       37.;    rest
-       40.;    rest
-       41.;    rest
-       42.;    rest
-       43.;    rest
-       44.;    rest
-       45.;    rest
-       46.;    rest
-       47.;    rest
-       48.;    rest
-       60.;    cc60
-       61.;    cc60
-       62.;    cc60
-       63.;    cc60
-       64.;    cc60
-       65.;    cc60
-       66.;    cc60
-       67.;    cc60
-       68.;    cc60
-       69.;    cc60
-       70.;    rest
-       71.;    rest
-       72.;    rest
-       73.;    rest
-       74.;    rest
-       75.;    rest
-       76.;    rest
-       77.;    rest
-       78.;    rest
-       79.;    rest
-       80.;    rest
-
-/ relationals
-cc60:
-%a,z
-       tstB1   A1
-
-%n*,z
-       F*
-       tstB1   #1(R)
-
-%n,z
-       F
-       tst     R
-
-%a,a
-       cmpBE   A1,A2
-
-%n*,a
-       F*
-       cmpBE   #1(R),A2
-
-%n,a
-       F
-       cmpB2   R,A2
-
-%n*,e*
-       F*
-       S1*
-       cmpBE   #1(R),#2(R1)
-
-%n*,e
-       F*
-       S1
-       cmpB1   #1(R),R1
-
-%n,e*
-       F
-       S1*
-       cmpB2   R,#2(R1)
-
-%n,e
-       F
-       S1
-       cmp     R,R1
-
-%n*,n*
-       FS*
-       S*
-       cmpBE   (sp)+,#2(R)
-
-%n*,n
-       FS*
-       S
-       cmpB1   *(sp)+,R
-
-%n,n*
-       FS
-       S*
-       cmpB2   (sp)+,#2(R)
-
-%n,n
-       FS
-       S
-       cmp     (sp)+,R
-
-/ set codes right
-rest:
-%n,n
-       H
-
-.data
-.even
-.text
-
diff --git a/c/cvopt.c b/c/cvopt.c
deleted file mode 100644 (file)
index 63224ce..0000000
--- a/c/cvopt.c
+++ /dev/null
@@ -1,357 +0,0 @@
-main() {
-/*
-       A1 -> A
-       A2    B
-       A     O
-       B1    C
-       B2    D
-       BE    L
-       BF    P
-       C1    E
-       C2    F
-       F     G
-       H     H
-       R     I
-       R1    J
-       S     K
-       I     M
-       M     N
-
-               *       +1
-               S       +2
-               C       +4
-               1       +8
-
-       z  -> 4
-       c     10
-       a     14
-       e     20
-       n     63
-       *       +0100
-*/
-
-       extern putchar,getc,peekc,printf,flag,flush;
-
-       auto c,snlflg,nlflg,t,smode,m,ssmode;
-
-       smode = nlflg = snlflg = ssmode = 0;
-loop:
-       c = getc();
-       if (c!='\n' & c!='\t') nlflg = 0;
-       if (ssmode!=0 & c!='%') {
-               ssmode = 0;
-               printf(".data\n1:<");
-       }
-       switch(c) {
-
-       case '\0':
-               printf(".text; 0\n");
-               flush();
-               return;
-
-       case ':':
-               if (!smode)
-                       printf("=.+2; 0"); else
-                       putchar(':');
-               goto loop;
-
-       case 'A':
-               if ((c=getc())=='1' | c=='2') {
-                       putchar(c+'A'-'1');
-                       goto loop;
-               }
-               putchar('O');
-               peekc = c;
-               goto loop;
-
-       case 'B':
-               switch (getc()) {
-
-               case '1':
-                       putchar('C');
-                       goto loop;
-
-               case '2':
-                       putchar('D');
-                       goto loop;
-
-               case 'E':
-                       putchar('L');
-                       goto loop;
-
-               case 'F':
-                       putchar('P');
-                       goto loop;
-               }
-               putchar('?');
-               goto loop;
-
-       case 'C':
-               putchar(getc()+'E'-'1');
-               goto loop;
-
-       case 'F':
-               putchar('G');
-               goto subtre;
-
-       case 'R':
-               if ((c=getc()) == '1')
-               putchar('J'); else {
-                       putchar('I');
-                       peekc = c;
-               }
-               goto loop;
-
-       case 'H':
-               putchar('H');
-               goto subtre;
-
-       case 'I':
-               putchar('M');
-               goto loop;
-
-       case 'M':
-               putchar('N');
-               snlflg++;
-               goto loop;
-
-       case 'S':
-               putchar('K');
-subtre:
-               snlflg = 1;
-               t = 'A';
-l1:
-               switch (c=getc()) {
-
-               case '*':
-                       t++;
-                       goto l1;
-
-               case 'S':
-                       t =+ 2;
-                       goto l1;
-
-               case 'C':
-                       t =+ 4;
-                       goto l1;
-
-               case '1':
-                       t =+ 8;
-                       goto l1;
-               }
-               peekc = c;
-               putchar(t);
-               goto loop;
-
-       case '#':
-               if(getc()=='1')
-                       putchar('#'); else
-                       putchar('"');
-               goto loop;
-
-       case '%':
-               if (smode)
-                       printf(".text;");
-loop1:
-               switch (c=getc()) {
-
-               case 'a':
-                       m = 16;
-                       t = flag();
-                       goto pf;
-
-               case ',':
-                       putchar(';');
-                       goto loop1;
-
-               case 'i':
-                       m = 12;
-                       t = flag();
-                       goto pf;
-               case 'z':
-                       m = 4;
-                       t = 0;
-                       goto pf;
-
-               case 'c':
-                       t = 0;
-                       m = 8;
-                       goto pf;
-
-               case 'e':
-                       t = flag();
-                       m = 20;
-                       goto pf;
-
-               case 'n':
-                       t = flag();
-                       m = 63;
-pf:
-                       if ((c=getc())=='*')
-                               m =+ 0100; else
-                               peekc = c;
-                       printf(".byte %o,%o", m, t);
-                       goto loop1;
-
-               case '\n':
-                       printf(";1f\n");
-                       ssmode = 1;
-                       nlflg = 1;
-                       smode = 1;
-                       goto loop;
-               }
-               putchar(c);
-               goto loop1;
-
-       case '\t':
-               if (nlflg) {
-                       nlflg = 0;
-                       goto loop;
-               }
-               putchar('\t');
-               goto loop;
-
-       case '\n':
-               if (!smode)  {
-                       putchar('\n');
-                       goto loop;
-               }
-               if (nlflg) {
-                       nlflg = 0;
-                       printf("\\0>\n.text\n");
-                       smode = 0;
-                       goto loop;
-               }
-               if (!snlflg)
-                       printf("\\n");
-               snlflg = 0;
-               printf(">\n<");
-               nlflg = 1;
-               goto loop;
-       }
-       putchar(c);
-       goto loop;
-}
-
-getc() {
-       extern getchar, peekc, nofloat;
-       auto t, ifcnt;
-
-       ifcnt = 0;
-gc:
-       if (peekc) {
-               t = peekc;
-               peekc = 0;
-       } else
-               t = getchar();
-       if (t==0)
-               return(0);
-       if (t=='{') {
-               ifcnt++;
-               t = getchar();
-       }
-       if (t=='}') {
-               t = getc();
-               if (--ifcnt==0)
-                       if (t=='\n')
-                               t = getc();
-       }
-       if (ifcnt & nofloat)
-               goto gc;
-       return(t);
-}
-
-flag() {
-       extern getc, peekc;
-       auto c, f;
-
-       f = 0;
-l1:
-       switch(c=getc()) {
-
-       case 'w':
-               f = 1;
-               goto l1;
-
-       case 'i':
-               f = 2;
-               goto l1;
-
-       case 'b':
-               f = 3;
-               goto l1;
-
-       case 'f':
-               f = 4;
-               goto l1;
-
-       case 'd':
-               f = 5;
-               goto l1;
-
-       case 'p':
-               f =+ 16;
-               goto l1;
-       }
-       peekc = c;
-       return(f);
-}
-
-peekc 0;
-
-putchar(c) {
-       extern flush, oubuf, ouptr;
-       char ouptr[], oubuf[];
-       auto c1;
-
-       goto init;
-init:
-       ouptr = oubuf;
-       init = init1;
-init1:
-       if(c1 = c>>8) {
-               *ouptr++ = c1;
-               if(ouptr >= oubuf+512)
-                       flush();
-       }
-       if(c =& 0377) {
-                       *ouptr++ = c;
-               if(ouptr >= oubuf+512)
-                       flush();
-       }
-}
-
-flush() {
-       extern ouptr, oubuf, fout, write;
-       char ouptr[], oubuf[];
-
-       write(fout, oubuf, ouptr-oubuf);
-       ouptr = oubuf;
-}
-
-getcha() {
-       extern read, incnt, fin, inbuf, inptr;
-       char inbuf[], inptr[];
-
-       goto init;
-init:
-       inptr = inbuf;
-       init = init1;
-init1:
-       if(inptr >= inbuf+incnt) {
-               inptr = inbuf;
-               incnt = read(fin, inbuf, 512);
-               if(!incnt)
-                       return('\0');
-       }
-       return(*inptr++);
-}
-
-inbuf[256];
-oubuf[256];
-inptr 0;
-incnt 0;
-ouptr 0;
-fin 0;
-fout 1;
-nofloat 0;
diff --git a/c/efftab.s b/c/efftab.s
deleted file mode 100644 (file)
index ada71c3..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/ c code tables
-
-.globl _efftab
-
-_efftab=.;.+2
-       30.;    ci30
-       31.;    ci30
-       32.;    ci30    / same as 30
-       33.;    ci30    / same as 31
-       80.;    ci80
-       70.;    ci70
-       71.;    ci70    / - like +
-       77.;    ci77
-       78.;    ci78
-       0
-
-/ ++ prefix
-ci30:
-%ai,n
-%abp,n
-%ab,n
-       IB1     A1
-
-%aip,n
-       I'      $2,A1
-
-%nbp*,n
-%ni*,n
-%nb*,n
-       F*
-       IB1     #1(R)
-
-%nip*,n
-       F*
-       I'      $2,#1(R)
-
-/ =
-ci80:
-%a,z
-       clrB1   A1
-
-%n*,z
-       F*
-       clrB1   #1(R)
-
-%a,aw
-       movB1   A2,A1
-
-%a,nw*
-       S*
-       movB1   #2(R),A1
-
-%a,n
-       S
-       movB1   R,A1
-
-%n*,aw
-       F*
-       movB1   A2,#1(R)
-
-%n*,ew*
-       F*
-       S1*
-       movB1   #2(R1),#1(R)
-
-%n*,e
-       F*
-       S1
-       movB1   R1,#1(R)
-
-%e*,nw*
-       S*
-       F1*
-       movB1   #2(R),#1(R1)
-
-%e*,n
-       S
-       F1*
-       movB1   R,#1(R1)
-
-%n*,nw*
-       FS*
-       S*
-       movB1   #2(R),*(sp)+
-
-%n*,n
-       FS*
-       S
-       movB1   R,*(sp)+
-
-/ =| i
-ci78:
-%a,a
-       bisBE   A2,A1
-
-%a,n
-       S
-       bisB1   R,A1
-
-%n*,a
-       F*
-       bisBE   A2,#1(R)
-
-%e*,n*
-       S*
-       F1*
-       bisBE   #2(R),#1(R1)
-
-%e*,n
-       S
-       F1*
-       bisBE   R,#1(R1)
-
-%n*,e*
-       F*
-       S1*
-       bisBE   #2(R1),#1(R)
-
-%n*,e
-       F*
-       S1
-       bisBE   R1,#1(R)
-
-%n*,n*
-       FS*
-       S*
-       bisBE   #2(R),*(sp)+
-
-%n*,n
-       FS*
-       S
-       bisBE   R,*(sp)+
-
-/ =& i
-ci77:
-%a,c
-       bicB1   $!C2,A1
-
-%a,n
-       S
-       com     R
-       bicB1   R,A1
-
-%e*,n
-       S
-       F1*
-       com     R
-       bicB1   R,#1(R1)
-
-%n*,c
-       F*
-       bicB1   $!C2,#1(R)
-
-%n*,e
-       F*
-       S1
-       com     R1
-       bicB1   R1,#1(R)
-
-%n*,n
-       FS*
-       S
-       com     R
-       bicB1   R,*(sp)+
-
-/ =+
-ci70:
-%aw,aw
-       I       A2,A1
-
-%aw,nw*
-       S*
-       I       #2(R),A1
-
-%aw,n
-       S
-       I       R,A1
-
-%ew*,nw*
-       S*
-       F1*
-       I       #2(R),#1(R1)
-
-%a,nw*
-       S*
-       movB1   A1,R1
-       I       #2(R),R1
-       movB1   R1,#2(R)
-
-%a,n
-       S
-       movB1   A1,R1
-       I       R1,R
-       movB1   R,A1
-
-%ew*,n
-       S
-       F1*
-       I       R,#1(R1)
-
-%nw*,n
-       SS
-       F*
-       I       (sp)+,#1(R)
-
-%n*,n
-       SS
-       F*
-       movB1   #1(R),R1
-       I       (sp)+,R1
-       movB1   R1,#1(R)
-
-.data
-.even
-
diff --git a/c/fptab.s b/c/fptab.s
deleted file mode 100644 (file)
index f7ddc9f..0000000
--- a/c/fptab.s
+++ /dev/null
@@ -1,846 +0,0 @@
-
-/ c code tables-- compile to register
-
-.globl _regtab
-
-_regtab=.; .+2
-       20.;    cr20
-       21.;    cr20
-       22.;    cr20
-       30.;    cr30
-       31.;    cr30
-       32.;    cr32
-       33.;    cr32
-       34.;    cr34
-       35.;    cr35
-       29.;    cr29
-       36.;    cr36
-       37.;    cr37
-       38.;    cr38
-       101.;   cr100
-       80.;    cr80
-       40.;    cr40
-       41.;    cr40    / - like +
-       42.;    cr42
-       43.;    cr43
-       44.;    cr43
-       45.;    cr45
-       46.;    cr45
-       47.;    cr47
-       48.;    cr48
-       60.;    cr60
-       61.;    cr60
-       62.;    cr60
-       63.;    cr60
-       64.;    cr60
-       65.;    cr60
-       66.;    cr60
-       67.;    cr60
-       68.;    cr60
-       69.;    cr60
-       70.;    cr70
-       71.;    cr70
-       72.;    cr72
-       73.;    cr73
-       74.;    cr73
-       75.;    cr75
-       76.;    cr75
-       77.;    cr77
-       78.;    cr78
-       102.;   cr102
-       97.;    cr97
-{      84.;    cr84
-       85.;    cr84
-       86.;    cr86
-       87.;    cr87
-       88.;    cr88
-       89.;    cr87
-       94.;    cr84
-       95.;    cr84
-       96.;    cr87}
-       0
-
-/ goto
-cr102:
-%i,n
-       jmp     *A1
-
-%n*,n
-       F*
-       jmp     *#1(R)
-
-%n,n
-       F
-       jmp     (R)
-
-/ call
-cr100:
-%n*,n
-       F*
-       jsr     pc,*#1(R)
-
-%a,n
-       jsr     pc,*A1
-
-%n,n
-       F
-       jsr     pc,(R)
-
-/ name, constant
-cr20:
-%z,n
-{      M}
-       clrB1   R
-
-%aw,n
-       mov     A,R
-
-%ab,n
-       movb    A,R
-
-{%af,n
-       M
-       movf    A,R}
-
-/++,-- prefix
-cr30:
-%ai,n
-%abp,n
-%ab,n
-       IB1     A1
-       movB1   A1,R
-
-%a,n
-       I'      $2,A1
-       mov     A1,R
-
-%nbp*,n
-%ni*,n
-%nb*,n
-       F*
-       IB1     #1(R)
-       movB1   #1(R),R
-
-%n*,n
-       F*
-       I'      $2,#1(R)
-       mov     #1(R),R
-
-{%af,n
-       M
-       movfi   $1,R
-       I'f     R,A1
-       movf    A1,R
-
-%nf*,n
-       F*
-       M
-       movfi   $1,R
-       I'f     R,#1(R)
-       movf    #1(R),R}
-
-/ ++,-- postfix
-cr32:
-%ai,n
-%abp,n
-%ab,n
-       movB1   A1,R
-       IB1     A1
-
-%a,n
-       mov     A1,R
-       I'      $2,A1
-
-%nbp*,n
-%nb*,n
-%ni*,n
-       F*
-       movB1   #1(R),-(sp)
-       IB1     #1(R)
-       movB1   (sp)+,R
-
-%n*,n
-       F*
-       mov     #1(R),-(sp)
-       I'      $2,#1(R)
-       mov     (sp)+,R
-
-{%af,n
-       M
-       movf    A1,R
-       movf    R,-(sp)
-       movif   $1,R
-       I'f     R,A1
-       movf    (sp)+,R
-
-%nf*,n
-       F*
-       M
-       movf    #1(R),R
-       movf    R,-(sp)
-       movif   $1,R
-       I'f     R,#1(R)
-       movf    (sp)+,R}
-
-/ !
-cr34:
-%n,n
-       FC
-       beq     1f
-       clr     R
-       br      2f
-1:     mov     $1,R
-2:
-
-/ &unary
-cr35:
-%a,n
-%af,n
-       mov     $A1,R
-
-/ & unary of auto
-cr29:
-%e,n
-%ef,n
-       mov     r5,R
-       add     Z,R
-
-/ *unary
-cr36:
-%abp*,n
-       F
-       movb    (R),R
-
-%a*,n
-       F
-       mov     (R),R
-
-%abp,n
-       movb    *A1,R
-
-%a,n
-       mov     *A1,R
-
-%nbp*,n
-       F*
-       movb    *#1(R),R
-
-%n*,n
-       F*
-       mov     *#1(R),R
-
-%nbp,n
-       H*
-       movb    ~(R),R
-
-%n,n
-       H*
-       mov     ~(R),R
-
-/ - unary
-cr37:
-%n,n
-       F
-       neg     R
-
-{%nf,n
-       F
-       negf    R}
-
-/ ~
-cr38:
-%n,n
-       F
-       com     R
-
-/ =
-cr80:
-%a,n
-{%af,nf}
-       S
-       movB1   R,A1
-
-%n*,a
-{%nf*,af}
-       F*
-{      M}
-       movB1   A2,#1(R)
-       movB1   #1(R),R
-
-%n*,e
-{%nf*,ef}
-       F*
-       S1
-       movB1   R1,#1(R)
-       movB1   R1,R
-
-%n*,n
-{%nf*,nf}
-       FS*
-       S
-       movB1   R,*(sp)+
-
-/ |
-cr48:
-%n,a
-       F
-       bisB2   A2,R
-
-%n,e*
-       F
-       S1*
-       bisB2   #2(R1),R
-
-%n,e
-       F
-       S1
-       bis     R1,R
-
-%n,n
-       FS
-       S
-       bis     (sp)+,R
-
-/ &
-cr47:
-%n,c
-       F
-       bic     $!C2,R
-
-%n,e
-       F
-       S1
-       com     R1
-       bic     R1,R
-
-%n,n
-       FS
-       S
-       com     (sp)
-       bic     (sp)+,R
-
-/ relationals
-cr60:
-%n,n
-       HC
-       I       2f
-       clr     R
-       br      1f
-2:     mov     $1,R
-1:
-
-/ >>, <<
-cr45:
-%a,aw
-       movB1   A1,I'
-       I       A2,lsh
-       movB1   I',R
-
-%n*,aw
-       F*
-       movB1   #1(R),I'
-       I       A2,lsh
-       movB1   I',R
-
-%n,aw
-       F
-       mov     R,I'
-       I       A2,lsh
-       mov     I',R
-
-%a,nw*
-       S*
-       movB1   A1,(r4)
-       I       #2(R),lsh
-       mov     (r4),R
-
-%a,n
-       S
-       movB1   A1,I'
-       I       R,lsh
-       mov     I',R
-
-%n,n
-       FS
-       S
-       mov     (sp)+,I'
-       I       R,lsh
-       mov     I',R
-
-/ +, -
-cr40:
-%n,aw
-{%nf,af}
-       F
-       IB1     A2,R
-
-%n,ew*
-{%nf,ef*}
-       F
-       S1*
-       IB2     #2(R1),R
-
-%n,e
-{%nf,ef}
-       F
-       S1
-       IBF     R1,R
-
-%n,nw*
-{%nf,nf*}
-       SS*
-       F
-       IBF     *(sp)+,R
-
-%n,n
-{%nf,nf}
-       SS
-       F
-       IBF     (sp)+,R
-
-/ *
-cr42:
-%aw,a
-       mov     A1,(r4)+
-       movB2   A2,(r4)
-       mov     -(r4),R
-
-%n,a
-       F
-       mov     R,(r4)+
-       movB2   A2,(r4)
-       mov     -(r4),R
-
-%n,e
-       F
-       S1
-       mov     R,(r4)+
-       mov     R1,(r4)
-       mov     -(r4),R
-
-%n,n
-       FS
-       S
-       mov     (sp)+,(r4)+
-       mov     R,(r4)
-       mov     -(r4),R
-
-{%nf,af
-       F
-       mulf    A2,R
-
-%nf,ef*
-       F
-       S1*
-       mulf    #2(R1),R
-
-%nf,ef
-       F
-       S1
-       mulf    R1,R
-
-%nf,nf
-       FS
-       S
-       mulf    (sp)+,R}
-
-/ /; mod
-cr43:
-%a,a
-       movB1   A1,(r4)
-       movB2   A2,div
-       mov     I,R
-
-%a,n
-       S
-       movB1   A1,(r4)
-       mov     R,div
-       mov     I,R
-
-%n,a
-       F
-       mov     R,(r4)
-       movB2   A2,div
-       mov     I,R
-
-%n,e
-       F
-       S1
-       mov     R,(r4)
-       mov     R1,div
-       mov     I,R
-
-%e,n
-       S
-       F1
-       mov     R1,(r4)
-       mov     R,div
-       mov     I,R
-
-%n,n
-       FS
-       S
-       mov     (sp)+,(r4)
-       mov     R,div
-       mov     I,R
-
-{%nf,af
-       F
-       I'      A1,R
-
-%nf,ef*
-       F
-       S1*
-       I'      #2(R1),R
-
-%nf,ef
-       F
-       S1
-       I'      R1,R
-
-%nf,nf
-       SS
-       F
-       I'      (sp)+,R}
-
-/ =*
-cr72:
-%a,a
-       movB1   A1,(r4)
-       movB2   A2,mul
-       movB1   (r4),A1
-       mov     (r4),R
-
-%a,n
-       S
-       mov     R,(r4)+
-       movB1   A1,(r4)
-       mov     -(r4),R
-       movB1   R,A1
-
-%n*,a
-       F*
-       movB1   #1(R),(r4)
-       movB2   A2,mul
-       movB1   (r4),#1(R)
-       mov     (r4),R
-
-%n*,e
-       F*
-       S1
-       movB1   #1(R),(r4)
-       mov     R1,mul
-       movB1   (r4),#1(R)
-       mov     (r4),R
-
-%e*,n
-       S
-       F1*
-       movB1   #1(R1),(r4)
-       mov     R,mul
-       movB1   (r4),#1(R1)
-       mov     (r4),R
-
-%n*,n
-       FS*
-       S
-       movB1   *(sp),(r4)
-       mov     R,mul
-       movB1   (r4),*(sp)+
-       mov     (r4),R
-
-/ =mod, =/
-cr73:
-%a,a
-       movB1   A1,(r4)
-       movB2   A2,div
-       movB1   I,A1
-       mov     I,R
-
-%a,n
-       S
-       movB1   A1,(r4)
-       mov     R,div
-       mov     I,R
-       movB1   R,A1
-
-%n*,a
-       F*
-       movB1   #1(R),(r4)
-       movB2   A2,div
-       movB1   I,#1(R)
-       mov     I,R
-
-%n*,e
-       F*
-       S1
-       movB1   #1(R),(r4)
-       mov     R1,div
-       movB1   I,#1(R)
-       mov     I,R
-
-%e*,n
-       S
-       F1*
-       movB1   #1(R1),(r4)
-       mov     R,div
-       movB1   I,#1(R1)
-       mov     I,R
-
-%n*,n
-       FS*
-       S
-       movB1   *(sp),(r4)
-       mov     R,div
-       movB1   I,*(sp)+
-       mov     I,R
-
-/ =|
-cr78:
-%a,a
-       bisBE   A2,A1
-       movB1   A1,R
-
-%a,n
-       S
-       bisB1   R,A1
-       movB1   A1,R
-
-%n*,a
-       F*
-       bisBE   A2,#1(R)
-       movB1   #1(R),R
-
-%e*,n*
-       S*
-       F1*
-       bisBE   #1(R1),#2(R)
-       movB1   #2(R),R
-
-%e*,n
-       S
-       F1*
-       bisBE   R,#1(R1)
-       movB1   #1(R1),R
-
-%n*,e*
-       F*
-       S1*
-       bisBE   #2(R1),#1(R)
-       movB1   #1(R),R
-
-%n*,e
-       F*
-       S1
-       bisBE   R1,#1(R)
-       movB2   #1(R),R
-
-%n*,n*
-       FS*
-       S*
-       bisBE   #2(R),*(sp)
-       movB2   *(sp)+,R
-
-%n*,n
-       FS*
-       S
-       bisBE   R,*(sp)
-       mov     *(sp)+,R
-
-/ =&
-cr77:
-%a,c
-       bicB1   $!C2,A1
-       movB2   A1,R
-
-%a,n
-       S
-       com     R
-       bicB1   R,A1
-       movB1   A1,R
-
-%e*,n
-       S
-       F1*
-       com     R
-       bicB1   R,#1(R1)
-       movB1   #1(R1),R
-
-%n*,e
-       F*
-       S1
-       com     R1
-       bicB1   R1,#1(R)
-       movB1   #1(R),R
-
-%n*,n
-       FS*
-       S
-       com     R
-       bicB1   R,*(sp)
-       movB1   *(sp)+,R
-
-/ =>>, =<<
-cr75:
-%a,aw
-       movB1   A1,I'
-       I       A2,lsh
-       movB1   I',A1
-       movB1   I',R
-
-%a,n
-       S
-       movB1   A1,I'
-       I       R,lsh
-       movB1   I',A1
-       movB1   I',R
-
-%n*,e
-       F*
-       S1
-       movB1   #1(R),I'
-       I       R1,lsh
-       movB1   I',#1(R)
-       movB1   I',R
-
-%e*,n
-       S
-       F1*
-       movB1   #1(R1),I'
-       I       R,lsh
-       movB    I',#1(R1)
-       movB1   I',R
-
-%n*,n
-       FS*
-       S
-       movB1   *(sp),I'
-       I       R,lsh
-       movB1   I',*(sp)+
-       movB1   I',R
-
-/ =+
-cr70:
-%aw,aw
-       I       A2,A1
-       mov     A1,R
-
-%aw,nw*
-       S*
-       I       #2(R),A1
-       mov     A1,R
-
-%aw,n
-       S
-       I       R,A1
-       mov     A1,R
-
-%ew*,nw*
-       S*
-       F1*
-       I       #2(R),#1(R1)
-       mov     #1(R1),R
-
-%a,nw*
-       S*
-       movB1   A1,R1
-       I       #2(R),R1
-       movB1   R1,#2(R)
-       mov     R1,R
-
-%a,n
-       S
-       movB1   A1,R1
-       I       R1,R
-       movB1   R,A1
-
-%ew*,n
-       S
-       F1*
-       I       R,#1(R1)
-       mov     #1(R1),R
-
-%nw*,n
-       SS
-       F*
-       I       (sp)+,#1(R)
-       mov     #1(R),R
-
-%n*,n
-       SS
-       F*
-       movB1   #1(R),R1
-       I       (sp)+,R1
-       movB1   R1,#1(R)
-       mov     R1,R
-
-/ int -> int[]
-cr97:
-%n,n
-       F
-       asl     R
-
-{/ int -> float
-cr84:
-%a,n
-       M
-       movif   A1,R
-
-%n*,n
-       F*
-       M
-       movif   #1(R),R
-
-%n,n
-       F
-       movif   R,R
-
-/ float -> double
-cr87:
-%af,n
-       M
-       movof   A1,R
-
-%nf*,n
-       F*
-       M
-       movof   #1(R),R
-
-%nf,n
-       F
-       movof   R,R
-
-/ float -> int
-cr86:
-%af,n
-       M2
-       movfi   A1,R
-
-%nf*,n
-       F*
-       M2
-       movfi   \$1(R),R
-
-%nf,n
-       F
-       movfi   R,R
-
-/ double -> int
-cr88:
-%ad,n
-       M4
-       movfi   A1,R
-
-%nd*,n
-       F*
-       M4
-       movfi   #1(R),R
-
-%nd,n
-       F
-       movfi   R,R
-
-.data
-.even
-.text
-
diff --git a/c/nc0/c00.c b/c/nc0/c00.c
deleted file mode 100644 (file)
index 6622668..0000000
+++ /dev/null
@@ -1,581 +0,0 @@
-/* C compiler
-
-Copyright 1972 Bell Telephone Laboratories, Inc. 
-
-*/
-
-ossiz 250;
-ospace() {}    /* fake */
-
-init(s, t)
-char s[]; {
-       extern lookup, symbuf, namsiz;
-       char symbuf[], sp[];
-       int np[], i;
-
-       i = namsiz;
-       sp = symbuf;
-       while(i--)
-               if ((*sp++ = *s++)=='\0') --s;
-       np = lookup();
-       *np++ = 1;
-       *np = t;
-}
-
-main(argc, argv)
-int argv[]; {
-       extern init, flush;
-       extern extdef, eof, open, creat;
-       extern fout, fin, error, exit, nerror, tmpfil;
-
-       if(argc<4) {
-               error("Arg count");
-               exit(1);
-       }
-       if((fin=open(argv[1],0))<0) {
-               error("Can't find %s", argv[1]);
-               exit(1);
-       }
-       if((fout=creat(argv[2], 017))<0) {
-               error("Can't create %s", argv[2]);
-               exit(1);
-       }
-       tmpfil = argv[3];
-       init("int", 0);
-       init("char", 1);
-       init("float", 2);
-       init("double", 3);
-/*     init("long", 4);  */
-       init("auto", 5);
-       init("extern", 6);
-       init("static", 7);
-       init("goto", 10);
-       init("return", 11);
-       init("if", 12);
-       init("while", 13);
-       init("else", 14);
-       init("switch", 15);
-       init("case", 16);
-       init("break", 17);
-       init("continue", 18);
-       init("do", 19);
-       init("default", 20);
-       while(!eof) {
-               extdef();
-               blkend();
-       }
-       flush();
-       flshw();
-       exit(nerror!=0);
-}
-
-lookup() {
-       extern hshtab[], hshsiz, pssiz, symbuf[];
-       extern hshlen, hshused, exit, error, nwps;
-       auto i, j, np[], sp[], rp[];
-
-       i = 0;
-       sp = symbuf;
-       j = nwps;
-       while(j--)
-               i =+ *sp++;
-       if (i<0) i = -i;
-       i =% hshsiz;
-       i =* pssiz;
-       while(*(np = &hshtab[i+4])) {
-               sp = symbuf;
-               j = nwps;
-               while(j--)
-                       if (*np++ != *sp++) goto no;
-               return(&hshtab[i]);
-no:            if ((i =+ pssiz) >= hshlen) i = 0;
-       }
-       if(hshused++ > hshsiz) {
-               error("Symbol table overflow");
-               exit(1);
-       }
-       rp = np = &hshtab[i];
-       sp = symbuf;
-       j = 4;
-       while(j--)
-               *np++ = 0;
-       j = nwps;
-       while(j--)
-               *np++ = *sp++;
-       return(rp);
-}
-
-symbol() {
-       extern peeksym, peekc, eof, getchar, subseq, error, line;
-       extern csym[], getstr, symbuf, namsiz, lookup[], ctab, cval;
-       auto b, c;
-       char symbuf[], sp[], ctab[];
-
-       if (peeksym>=0) {
-               c = peeksym;
-               peeksym = -1;
-               return(c);
-       }
-       if (peekc) {
-               c = peekc;
-               peekc = 0;
-       } else
-               if (eof)
-                       return(0); else
-                       c = getchar();
-loop:
-       switch(ctab[c]) {
-
-       case 125:       /* newline */
-               line++;
-
-       case 126:       /* white space */
-               c = getchar();
-               goto loop;
-
-       case 0:         /* EOF */
-               eof++;
-               return(0);
-
-       case 40:        /* + */
-               return(subseq(c,40,30));
-
-       case 41:        /* - */
-               return(subseq(c,41,31));
-
-       case 80:        /* = */
-               if (subseq(' ',0,1)) return(80);
-               c = symbol();
-               if (c>=40 & c<=49)
-                       return(c+30);
-               if (c==80)
-                       return(60);
-               peeksym = c;
-               return(80);
-
-       case 63:        /* < */
-               if (subseq(c,0,1)) return(46);
-               return(subseq('=',63,62));
-
-       case 65:        /* > */
-               if (subseq(c,0,1)) return(45);
-               return(subseq('=',65,64));
-
-       case 34:        /* ! */
-               return(subseq('=',34,61));
-
-       case 43:        /* / */
-               if (subseq('*',1,0))
-                       return(43);
-com:
-               c = getchar();
-com1:
-               if (c=='\0') {
-                       eof++;
-                       error("Nonterminated comment");
-                       return(0);
-               }
-               if (c=='\n')
-                       line++;
-               if (c!='*')
-                       goto com;
-               c = getchar();
-               if (c!='/')
-                       goto com1;
-               c = getchar();
-               goto loop;
-
-       case 124:       /* number */
-               cval = 0;
-               if (c=='0')
-                       b = 8; else
-                       b = 10;
-               while(ctab[c]==124) {
-                       cval = cval*b + c -'0';
-                       c = getchar();
-               }
-               peekc = c;
-               return(21);
-
-       case 122:       /* " */
-               return(getstr());
-
-       case 121:       /* ' */
-               return(getcc());
-
-       case 123:       /* letter */
-               sp = symbuf;
-               while(ctab[c]==123 | ctab[c]==124) {
-                       if (sp<symbuf+namsiz) *sp++ = c;
-                       c = getchar();
-               }
-               while(sp<symbuf+namsiz)
-                       *sp++ = '\0';
-               peekc = c;
-               csym = lookup();
-               if (csym[0]==1) {       /* keyword */
-                       cval = csym[1];
-                       return(19);
-               }
-               return(20);
-
-       case 127:       /* unknown */
-               error("Unknown character");
-               c = getchar();
-               goto loop;
-
-       }
-       return(ctab[c]);
-}
-
-subseq(c,a,b) {
-       extern getchar, peekc;
-
-       if (!peekc)
-               peekc = getchar();
-       if (peekc != c)
-               return(a);
-       peekc = 0;
-       return(b);
-}
-getstr() {
-       extern isn, cval;
-       auto c;
-
-       printf(".data;L%d:.byte ", cval=isn++);
-       while((c=mapch('"')) >= 0)
-               printf("%o,", c);
-       printf("0;.even;.text\n");
-       return(22);
-}
-
-getcc()
-{
-       extern cval, ncpw;
-       auto c, cc;
-       char cp[];
-
-       cval = 0;
-       cp = &cval;
-       cc = 0;
-       while((c=mapch('\'')) >= 0)
-               if(cc++ < ncpw)
-                       *cp++ = c;
-       if(cc>ncpw)
-               error("Long character constant");
-       return(21);
-}
-
-mapch(c)
-{
-       extern peekc, line;
-       auto a;
-
-       if((a=getchar())==c)
-               return(-1);
-       switch(a) {
-
-       case '\n':
-       case 0:
-               error("Nonterminated string");
-               peekc = a;
-               return(-1);
-
-       case '\\':
-               switch (a=getchar()) {
-
-               case 't':
-                       return('\t');
-
-               case 'n':
-                       return('\n');
-
-               case '0':
-                       return('\0');
-
-               case 'r':
-                       return('\r');
-
-               case '\n':
-                       line++;
-                       return('\n');
-               }
-
-       }
-       return(a);
-}
-
-tree() {
-       extern symbol, block, csym[], ctyp, isn,
-               peeksym, opdope[], build, error, cp[], cmst[],
-               space, ospace, cval, ossiz, exit, errflush, cmsiz;
-
-       auto op[], opst[20], pp[], prst[20], andflg, o,
-               p, ps, os;
-
-       space = ospace;
-       op = opst;
-       pp = prst;
-       cp = cmst;
-       *op = 200;              /* stack EOF */
-       *pp = 06;
-       andflg = 0;
-
-advanc:
-       switch (o=symbol()) {
-
-       /* name */
-       case 20:
-               if (*csym==0)
-                       if((peeksym=symbol())==6)
-                               *csym = 6;      /* extern */
-                       else {
-                               if(csym[2]==0)  /* unseen so far */
-                                       csym[2] = isn++;
-                       }
-                       if(*csym==6)    /* extern */
-                           *cp++ = block(5,20,csym[1],0,*csym,
-                                       csym[4],csym[5],csym[6],csym[7]);
-                       else
-                           *cp++ = block(2,20,csym[1],0,*csym,csym[2]);
-               goto tand;
-
-       /* short constant */
-       case 21:
-       case21:
-               *cp++ = block(1,21,ctyp,0,cval);
-               goto tand;
-
-       /* string constant */
-       case 22:
-               *cp++ = block(1,22,17,0,cval);
-
-tand:
-               if(cp>=cmst+cmsiz) {
-                       error("Expression overflow");
-                       exit(1);
-               }
-               if (andflg)
-                       goto syntax;
-               andflg = 1;
-               goto advanc;
-
-       /* ++, -- */
-       case 30:
-       case 31:
-               if (andflg)
-                       o =+ 2;
-               goto oponst;
-
-       /* ! */
-       case 34:
-               if (andflg)
-                       goto syntax;
-               goto oponst;
-
-       /* - */
-       case 41:
-               if (!andflg) {
-                       peeksym = symbol();
-                       if (peeksym==21) {
-                               peeksym = -1;
-                               cval = -cval;
-                               goto case21;
-                       }
-                       o = 37;
-               }
-               andflg = 0;
-               goto oponst;
-
-       /* & */
-       /* * */
-       case 47:
-       case 42:
-               if (andflg)
-                       andflg = 0; else
-                       if(o==47)
-                               o = 35;
-                       else
-                               o = 36;
-               goto oponst;
-
-       /* ( */
-       case 6:
-               if (andflg) {
-                       o = symbol();
-                       if (o==7)
-                               o = 101; else {
-                               peeksym = o;
-                               o = 100;
-                               andflg = 0;
-                       }
-               }
-       goto oponst;
-
-       /* ) */
-       /* ] */
-       case 5:
-       case 7:
-               if (!andflg)
-                       goto syntax;
-               goto oponst;
-       }
-
-       /* binaries */
-       if (!andflg)
-               goto syntax;
-       andflg = 0;
-
-oponst:
-       p = (opdope[o]>>9) & 077;
-opon1:
-       ps = *pp;
-       if (p>ps | p==ps & (opdope[o]&0200)!=0) { /* right-assoc */
-putin:
-               switch (o) {
-
-               case 6: /* ( */
-               case 4: /* [ */
-               case 100: /* call */
-                       p = 04;
-               }
-               if(op>=opst+20) {               /* opstack size */
-                       error("expression overflow");
-                       exit(1);
-               }
-               *++op = o;
-               *++pp = p;
-               goto advanc;
-       }
-       --pp;
-       switch (os = *op--) {
-
-       /* EOF */
-       case 200:
-               peeksym = o;
-               return(*--cp);
-
-       /* call */
-       case 100:
-               if (o!=7)
-                       goto syntax;
-               build(os);
-               goto advanc;
-
-       /* mcall */
-       case 101:
-               *cp++ = 0;              /* 0 arg call */
-               os = 100;
-               goto fbuild;
-
-       /* ( */
-       case 6:
-               if (o!=7)
-                       goto syntax;
-               goto advanc;
-
-       /* [ */
-       case 4:
-               if (o!=5)
-                       goto syntax;
-               build(4);
-               goto advanc;
-       }
-fbuild:
-       build(os);
-       goto opon1;
-
-syntax:
-       error("Expression syntax");
-       errflush(o);
-       return(0);
-}
-
-declare(kw) {
-       extern csym[], symbol, paraml[], parame[];
-       extern error, cval, errflush, peeksym, exit;
-       int t[], n, o;
-
-       while((o=symbol())==20) {               /* name */
-               if(kw>=5) {                     /* type or sort? */
-                       if(*csym>0)
-                               error("%p redeclared", csym[4]);
-                       *csym = kw;
-               } else {
-                       if ((csym[1]&017)!=0)
-                               error("%p redeclared", &csym[4]);
-                       csym[1] =| csym[1]&0760 | kw;
-                       if (*csym==0)
-                               *csym = -2;
-               }
-               while((o=symbol())==4) {        /* [ */
-                       if((o=symbol())==21) {  /* const */
-                               if(csym[1]>=020)
-                                       error("Bad vector");
-                               csym[3] = cval;
-                               o = symbol();
-                       }
-                       if (o!=5)               /* ] */
-                               goto syntax;
-                       csym[1] =+ 020;
-               }
-               if(kw==8)  {            /* parameter */
-                       *csym = -1;
-                       if (paraml==0)
-                               paraml = csym;
-                       else
-                               *parame = csym;
-                       parame = csym;
-               }
-               if (o!=9)       /* , */
-                       break;
-       }
-       if(o==1 & kw!=8 | o==7 & kw==8)
-               return;
-syntax:
-       error("Declaration syntax");
-       errflush(o);
-}
-
-/* storage */
-
-regtab 0;
-efftab 1;
-cctab 2;
-sptab 3;
-symbuf[4];
-pssiz 8;
-namsiz 8;
-nwps 4;
-hshused 0;
-hshsiz 100;
-hshlen 800;    /* 8*hshsiz */
-hshtab[800];
-space 0;
-cp 0;
-cmsiz 40;
-cmst[40];
-ctyp 0;
-isn 1;
-swsiz 120;
-swtab[120];
-swp 0;
-contlab 0;
-brklab 0;
-deflab 0;
-nreg 4;
-maprel[] 60,61,64,65,62,63,68,69,66,67;
-nauto 0;
-stack 0;
-peeksym 0177777;
-peekc 0;
-eof 0;
-line 1;
-csym 0;
-cval 0;
-ncpw 2;
-nerror 0;
-paraml;
-parame;
-tmpfil;
-
diff --git a/c/nc0/c01.c b/c/nc0/c01.c
deleted file mode 100644 (file)
index 35f3f36..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-build(op) {
-       extern cp[], error, block, opdope[], maprel[], chklval;
-       extern chkw, cvtab, lintyp, dcalc;
-       auto p1[], t1, d1, p2[], t2, d2, p3[], t3, d3, t;
-       auto d, dope, lr, cvn;
-       char cvtab[];
-
-       if (op==4)  {           /* [] */
-               build(40);  /* + */
-               op = 36;
-       }
-       dope = opdope[op];
-       if ((dope&01)!=0) {
-               p2 = *--cp;
-               t2 = p2[1];
-               d2 = p2[2];
-       }
-       p1 = *--cp;
-       t1 = p1[1];
-       d1 = p1[2];
-       switch (op) {
-
-       /* , */
-       case 9:
-               *cp++ = block(2, 9, 0, 0, p1, p2);
-               return;
-
-       /* ? */
-       case 90:
-               if (*p2!=8)
-                       error("Illegal conditional");
-               goto goon;
-
-       /* call */
-       case 100:
-               *cp++ = block(2,100,t1,24,p1,p2);
-               return;
-
-       /* * */
-       case 36:
-               if ((t1 =- 16)<0)  {
-                       error("Illegal indirection");
-                       t1 =+ 16;
-               }
-               if (*p1!=20 & d1==0)
-                       d1 = 1;
-               *cp++ = block(1,36,t1,d1,p1);
-               return;
-
-       /* & unary */
-       case 35:
-               if (*p1 == 36) {        /* * */
-                       *cp++ = p1[3];
-                       return;
-               }
-               if (*p1 == 20) {
-                       *cp++ = block(1,p1[3]==5?29:35,t1+16,1,p1);
-                       return;
-               }
-               error("Illegal lvalue");
-       }
-goon:
-       if ((dope&02)!=0)               /* lvalue needed on left? */
-               chklval(p1);
-       if ((dope&020)!=0)              /* word operand on left? */
-               chkw(p1);
-       if ((dope&040)!=0)              /* word operand on right? */
-               chkw(p2);
-       if ((dope&01)!=0) {             /* binary op? */
-               cvn = cvtab[9*lintyp(t1)+lintyp(t2)];
-               if ((dope&010)!=0)  {   /* assignment? */
-                       t = t1;
-                       lr = 1;
-                       cvn =& 07;
-               } else {
-                       t = (cvn&0100)!=0? t2:t1;
-                       lr = cvn&0200;
-                       cvn = (cvn>>3)&07;
-               }
-               if (cvn) {
-                       if (cvn==07) {
-                               error("Illegal conversion");
-                               goto nocv;
-                       }
-                       cvn =+ (dope&010)!=0? 83:93;
-                       if (lr) {
-                               t2 = t;
-                                d2 = (p2=convert(p2, t, d2, cvn))[2];
-                       } else {
-                               t1 = t;
-                               d1 = (p1=convert(p1, t, d1, cvn))[2];
-                       }
-nocv:;         }
-               if (d2>d1 & (dope&0100)!=0) {   /* flip commutative? */
-                       if ((dope&04)!=0)       /* relational? */
-                               op = maprel[op-60];
-                       d = d1;
-                       d1 = d2;
-                       d2 = d;
-                       d = p1;
-                       p1 = p2;
-                       p2 = d;
-                       d = t1;
-                       t1 = t2;
-                       t2 = d;
-               }
-               if (d1==d2)
-                       d = d1+1; else
-                       d = max(d1,d2);
-               if ((dope&04)!=0)
-                       t = 0;          /* relational is integer */
-               *cp++ = block(2,op,t,d,p1,p2);
-               return;
-       }
-       *cp++ = block(1,op,t1,d1==0?1:d1,p1);
-}
-
-convert(p, t, d, cvn)
-int p[];
-{
-       auto c;
-       if (*p==21) {           /* constant */
-               c = p[3];
-               switch(cvn) {
-
-               case 99:                /* c18 */
-                       c =<< 1;
-
-               case 98:                /* c14 */
-                       c =<< 1;
-
-               case 97:                /* c12 */
-                       c =<< 1;
-
-                       p[3] = c;
-               return(p);
-               }
-       }
-       return(block(1, cvn, t, max(1,d), p));
-}
-
-chkw(p)
-int p[]; {
-       extern error;
-       auto t;
-
-       if ((t=p[1])>1 & t<16)
-               error("Integer operand required");
-       return;
-}
-
-lintyp(t) {
-       return(t<16? t:(t<32? t-12: 8));
-}
-
-error(s, p1, p2) {
-       extern printf, line, fout, flush, putchar, nerror;
-       int f;
-
-       nerror++;
-       flush();
-       f = fout;
-       fout = 1;
-       printf("%d: ", line);
-       printf(s, p1, p2);
-       putchar('\n');
-       fout = f;
-}
-
-block(n, op, t, d, p1,p2,p3)
-int p1[],p2[],p3[]; {
-       extern space[], error, exit, ossiz, ospace[];
-       auto p[], ap[];
-
-       p = space;
-       ap = &op;
-       n =+ 3;
-       if(space+n >= ospace+ossiz) {
-               error("Expression overflow");
-               exit(1);
-       }
-       while(n--)
-               *space++ = *ap++;
-       return(p);
-}
-
-chklval(p)
-int p[]; {
-       extern error;
-       if (*p!=20)
-               if (*p!=36)
-                       error("Lvalue required");
-}
-
-notcompat(at, st) {
-
-       if (st==0)              /* word, byte */
-               return(at>1 & at<16);
-       if (st==1)              /* word */
-               return(at>0 & at<16);
-       return((st-2) != at);
-}
-
-max(a, b)
-{
-       if (a>b)
-               return(a);
-       return(b);
-}
-
diff --git a/c/nc0/c02.c b/c/nc0/c02.c
deleted file mode 100644 (file)
index 58ddced..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-function() {
-       extern declare, blkhed, blkend;
-       extern printf, statement, peeksym, cval, symbol, retseq;
-       extern paraml;
-       auto o;
-
-       printf(".text; 1:mov r5,-(sp); mov sp,r5\n");
-       declare(8);
-       declist();
-       statement(1);
-       retseq();
-}
-
-extdef() {
-       extern eof, function, cval;
-       extern symbol, block, printf, pname, errflush, csym[];
-       extern error;
-       auto o, c, cs[];
-       char s[];
-
-       if(((o=symbol())==0) | o==1)    /* EOF */
-               return;
-       if(o!=20)
-               goto syntax;
-       csym[0] = 6;
-       cs = &csym[4];
-       printf(".globl  %p\n", cs);
-       s = ".data; %p:1f\n";
-       switch(o=symbol()) {
-
-       case 6:                         /* ( */
-               printf(s, cs);
-               function();
-               return;
-
-       case 21:                        /* const */
-               printf(".data; %p: %o\n", cs, cval);
-               if((o=symbol())!=1)     /* ; */
-                       goto syntax;
-               return;
-
-       case 1:                         /* ; */
-               printf(".bss; %p: .=.+2\n", cs);
-               return;
-
-       case 4:                         /* [ */
-               c = 0;
-               if((o=symbol())==21) {  /* const */
-                       c = cval<<1;
-                       o = symbol();
-               }
-               if(o!=5)                /* ] */
-                       goto syntax;
-               printf(s, cs);
-               if((o=symbol())==1) {   /* ; */
-                       printf(".bss; 1:.=.+%o\n", c);
-                       return;
-               }
-               printf("1:");
-               while(o==21) {          /* const */
-                       printf("%o\n", cval);
-                       c =- 2;
-                       if((o=symbol())==1)     /* ; */
-                               goto done;
-                       if(o!=9)                /* , */
-                               goto syntax;
-                       else
-                               o = symbol();
-               }
-               goto syntax;
-       done:
-               if(c>0)
-                       printf(".=.+%o\n", c);
-               return;
-
-       case 0:                         /* EOF */
-               return;
-       }
-
-syntax:
-       error("External definition syntax");
-       errflush(o);
-       statement(0);
-}
-
-statement(d) {
-       extern symbol, error, blkhed, eof, peeksym;
-       extern blkend, csym[], rcexpr, block[], tree[], regtab[];
-       extern retseq, jumpc, jump, label, contlab, brklab, cval;
-       extern swp[], isn, pswitch, peekc, slabel;
-       extern efftab[], declare, deflab, errflush, swtab[], swsiz, branch;
-
-       int o, o1, o2, o3, np[];
-
-stmt:
-       switch(o=symbol()) {
-
-       /* EOF */
-       case 0:
-               error("Unexpected EOF");
-       /* ; */
-       case 1:
-       /* } */
-       case 3:
-               return;
-
-       /* { */
-       case 2: {
-               if(d)
-                       blkhed();
-               while (!eof) {
-                       if ((o=symbol())==3)    /* } */
-                               goto bend;
-                       peeksym = o;
-                       statement(0);
-               }
-               error("Missing '}'");
-       bend:
-               return;
-       }
-
-       /* keyword */
-       case 19:
-               switch(cval) {
-
-               /* goto */
-               case 10:
-                       o1 = block(1,102,0,0,tree());
-                       rcexpr(o1, regtab);
-                       goto semi;
-
-               /* return */
-               case 11:
-                       if((peeksym=symbol())==6)       /* ( */
-                               rcexpr(pexpr(), regtab);
-                       retseq();
-                       goto semi;
-
-               /* if */
-               case 12:
-                       jumpc(pexpr(), o1=isn++, 0);
-                       statement(0);
-                       if ((o=symbol())==19 & cval==14) {  /* else */
-                               o2 = isn++;
-                               (easystmt()?branch:jump)(o2);
-                               label(o1);
-                               statement(0);
-                               label(o2);
-                               return;
-                       }
-                       peeksym = o;
-                       label(o1);
-                       return;
-
-               /* while */
-               case 13:
-                       o1 = contlab;
-                       o2 = brklab;
-                       label(contlab = isn++);
-                       jumpc(pexpr(), brklab=isn++, 0);
-                       o3 = easystmt();
-                       statement(0);
-                       (o3?branch:jump)(contlab);
-                       label(brklab);
-                       contlab = o1;
-                       brklab = o2;
-                       return;
-
-               /* break */
-               case 17:
-                       if(brklab==0)
-                               error("Nothing to break from");
-                       jump(brklab);
-                       goto semi;
-
-               /* continue */
-               case 18:
-                       if(contlab==0)
-                               error("Nothing to continue");
-                       jump(contlab);
-                       goto semi;
-
-               /* do */
-               case 19:
-                       o1 = contlab;
-                       o2 = brklab;
-                       contlab = isn++;
-                       brklab = isn++;
-                       label(o3 = isn++);
-                       statement(0);
-                       label(contlab);
-                       contlab = o1;
-                       if ((o=symbol())==19 & cval==13) { /* while */
-                               jumpc(tree(), o3, 1);
-                               label(brklab);
-                               brklab = o2;
-                               goto semi;
-                       }
-                       goto syntax;
-
-               /* case */
-               case 16:
-                       if ((o=symbol())!=21)   /* constant */
-                               goto syntax;
-                       if ((o=symbol())!=8)    /* : */
-                               goto syntax;
-                       if (swp==0) {
-                               error("Case not in switch");
-                               goto stmt;
-                       }
-                       if(swp>=swtab+swsiz) {
-                               error("Switch table overflow");
-                       } else {
-                               *swp++ = isn;
-                               *swp++ = cval;
-                               label(isn++);
-                       }
-                       goto stmt;
-
-               /* switch */
-               case 15:
-                       o1 = brklab;
-                       brklab = isn++;
-                       np = pexpr();
-                       if (np[1]>1 & np[1]<16)
-                               error("Integer required");
-                       rcexpr(np, regtab);
-                       pswitch();
-                       brklab = o1;
-                       return;
-
-               /* default */
-               case 20:
-                       if (swp==0)
-                               error("Default not in switch");
-                       if ((o=symbol())!=8)    /* : */
-                               goto syntax;
-                       deflab = isn++;
-                       label(deflab);
-                       goto stmt;
-               }
-
-               error("Unknown keyword");
-               goto syntax;
-
-       /* name */
-       case 20:
-               if (peekc==':') {
-                       peekc = 0;
-                       if (csym[0]>0) {
-                               error("Redefinition");
-                               goto stmt;
-                       }
-                       csym[0] = 2;
-                       csym[1] = 020;  /* int[] */
-                       if (csym[2]==0)
-                               csym[2] = isn++;
-                       slabel();
-                       goto stmt;
-               }
-       }
-
-       peeksym = o;
-       rcexpr(tree(), efftab);
-       goto semi;
-
-semi:
-       if ((o=symbol())!=1)            /* ; */
-               goto syntax;
-       return;
-
-syntax:
-       error("Statement syntax");
-       errflush(o);
-       goto stmt;
-}
-
-pexpr()
-{
-       auto o, t;
-
-       if ((o=symbol())!=6)    /* ( */
-               goto syntax;
-       t = tree();
-       if ((o=symbol())!=7)    /* ) */
-               goto syntax;
-       return(t);
-syntax:
-       error("Statement syntax");
-       errflush(o);
-       return(0);
-}
-
-pswitch() {
-       extern swp[], isn, swtab[], printf, deflab, statement, brklab;
-       extern label;
-       int sswp[], dl, cv, swlab;
-
-       sswp = swp;
-       if (swp==0)
-               swp = swtab;
-       swlab = isn++;
-       printf("jsr     pc,bswitch; l%d\n", swlab);
-       dl = deflab;
-       deflab = 0;
-       statement(0);
-       if (!deflab) {
-               deflab = isn++;
-               label(deflab);
-       }
-       printf("L%d:.data;L%d:", brklab, swlab);
-       while(swp>sswp & swp>swtab) {
-               cv = *--swp;
-               printf("%o; l%d\n", cv, *--swp);
-       }
-       printf("L%d; 0\n.text\n", deflab);
-       deflab = dl;
-       swp = sswp;
-}
-
-blkhed()
-{
-       extern symbol, cval, declare, peeksym, paraml[], parame[];
-       extern error, length, rlength, setstk, defvec, isn, defstat;
-       extern stack, hshtab[], hshsiz, pssiz;
-       int o, al, pl, cs[], hl;
-
-       declist();
-       stack = al = -2;
-       pl = 4;
-       while(paraml) {
-               *parame = 0;
-               paraml = *(cs = paraml);
-               cs[2] = pl;
-               *cs = 10;
-               pl =+ rlength(cs[1]);
-       }
-       cs = hshtab;
-       hl = hshsiz;
-       while(hl--) {
-           if (cs[4])
-               switch(cs[0]) {
-
-               /* sort unmentioned */
-               case 0177776:   /* -2 */
-                       cs[0] = 5;              /* auto */
-
-               /* auto */
-               case 5:
-                       if (cs[3]) {    /* vector */
-                               al =- (cs[3]*length(cs[1]-020)+1) & 077776;
-                               setstk(al);
-                               defvec(al);
-                       }
-                       cs[2] = al;
-                       al =- rlength(cs[1]);
-                       goto loop;
-
-               /* parameter */
-               case 10:
-                       cs[0] = 5;
-                       goto loop;
-
-               /* static */
-               case 7:
-                       cs[2] = isn++;
-                       defstat(cs);
-                       goto loop;
-
-               loop:;
-               }
-               cs = cs+pssiz;
-       }
-       setstk(al);
-}
-
-blkend() {
-       extern hshtab[], hshsiz, pssiz, hshused;
-       auto i, hl;
-
-       i = 0;
-       hl = hshsiz;
-       while(hl--) {
-               if(hshtab[i+4])
-                       if (hshtab[i]==0)
-                               error("%p undefined", &hshtab[i+4]);
-                       if(hshtab[i]!=1) {      /* not keyword */
-                               hshused--;
-                               hshtab[i+4] = 0;
-                       }
-               i =+ pssiz;
-       }
-}
-
-errflush(o) {
-       extern symbol, peeksym, eof;
-
-       while(o>3)      /* ; { } */
-               o = symbol();
-       peeksym  = o;
-}
-
-declist()
-{
-       extern peeksym, peekc, csym[], cval;
-       auto o;
-
-       while((o=symbol())==19 & cval<10)
-               declare(cval);
-       peeksym = o;
-}
-
-easystmt()
-{
-       extern peeksym, peekc, cval;
-
-       if((peeksym=symbol())==20)      /* name */
-               return(peekc!=':');      /* not label */
-       if (peeksym==19) {              /* keyword */
-               switch(cval)
-
-               case 10:        /* goto */
-               case 11:        /* return */
-               case 17:        /* break */
-               case 18:        /* continue */
-                       return(1);
-               return(0);
-       }
-       return(peeksym!=2);             /* { */
-}
-
-branch(lab)
-{
-       printf("br      L%d\n", lab);
-}
-
diff --git a/c/nc0/c03.c b/c/nc0/c03.c
deleted file mode 100644 (file)
index 2049672..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-jumpc(tree, lbl, cond)
-int tree[];
-{
-       extern cctab, block, rcexpr;
-
-       rcexpr(block(1,easystmt()+103,tree,lbl,cond),cctab);
-}
-
-rcexpr(tree, table)
-int tree[], table;
-{
-       extern space, ospace, putwrd, putchar, line;
-       int c, sp[];
-
-       putchar('#');
-       c = space-ospace;
-       c =/ 2;         /* # addresses per word */
-       sp = ospace;
-
-       putwrd(c);
-       putwrd(tree);
-       putwrd(table);
-       putwrd(line);
-       while(c--)
-               putwrd(*sp++);
-}
-
-jump(lab) {
-       extern printf;
-
-       printf("jmp\tl%d\n", lab);
-}
-
-label(l) {
-       extern printf;
-
-       printf("l%d:", l);
-}
-
-retseq() {
-       extern printf;
-
-       printf("jmp\tretrn\n");
-}
-
-slabel() {
-       extern csym[], printf;
-
-       printf(".data; l%d: 1f; .text; 1:\n", csym[2]);
-}
-
-setstk(a) {
-       extern printf, stack;
-       auto ts;
-
-       ts = a-stack;
-       stack = a;
-       switch(ts) {
-
-       case 0:
-               return;
-
-       case 0177776:   /* -2 */
-               printf("tst     -(sp)\n");
-               return;
-
-       case 0177774:   /* -4 */
-               printf("cmp     -(sp),-(sp)\n");
-               return;
-       }
-       printf("add     $%o,sp\n", ts);
-}
-
-defvec() {
-       extern printf, stack;
-
-       printf("mov\tsp,r0\nmov\tr0,-(sp)\n");
-       stack =- 2;
-}
-
-defstat(s)
-int s[]; {
-       extern printf, length;
-       int len;
-
-       len = length(s[1]);
-       if (s[3])
-               printf(".data; l%d:1f; .bss; 1:.=.+%o; .even; .text\n", s[2],
-                       s[3]*len);
-       else
-               printf(".bss; l%d:.=.+%o; .even; .text\n", s[2], len);
-}
-
-length(t) {
-
-       if (t<0)
-               t =+ 020;
-       if (t>=020)
-               return(2);
-       switch(t) {
-
-       case 0:
-               return(2);
-
-       case 1:
-               return(1);
-
-       case 2:
-               return(4);
-
-       case 3:
-               return(8);
-
-       case 4:
-               return(4);
-
-       }
-       return(1024);
-}
-
-rlength(c) {
-       extern length;
-       auto l;
-
-       return((l=length(c))==1? 2: l);
-}
-
-printn(n,b) {
-       extern putchar;
-       auto a;
-
-       if(a=n/b) /* assignment, not test for equality */
-               printn(a, b); /* recursive */
-       putchar(n%b + '0');
-}
-
-printf(fmt,x1,x2,x3,x4,x5,x6,x7,x8,x9)
-char fmt[]; {
-       extern printn, putchar, namsiz, ncpw;
-       char s[];
-       auto adx[], x, c, i[];
-
-       adx = &x1; /* argument pointer */
-loop:
-       while((c = *fmt++) != '%') {
-               if(c == '\0')
-                       return;
-               putchar(c);
-       }
-       x = *adx++;
-       switch (c = *fmt++) {
-
-       case 'd': /* decimal */
-       case 'o': /* octal */
-               if(x < 0) {
-                       x = -x;
-                       if(x<0)  {      /* - infinity */
-                               if(c=='o')
-                                       printf("100000");
-                               else
-                                       printf("-32767");
-                               goto loop;
-                       }
-                       putchar('-');
-               }
-               printn(x, c=='o'?8:10);
-               goto loop;
-
-       case 's': /* string */
-               s = x;
-               while(c = *s++)
-                       putchar(c);
-               goto loop;
-
-       case 'p':
-               s = x;
-               putchar('_');
-               c = namsiz;
-               while(c--)
-                       if(*s)
-                               putchar(*s++);
-               goto loop;
-       }
-       putchar('%');
-       fmt--;
-       adx--;
-       goto loop;
-}
-
diff --git a/c/nc0/c0t.s b/c/nc0/c0t.s
deleted file mode 100644 (file)
index b3addb4..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/ word I/O
-
-.globl _putwrd
-
-.globl _tmpfil
-.globl putw
-.globl fcreat
-.globl flush
-
-.data
-_putwrd: 1f
-.text
-1:
-       tst     buf
-       bne     1f
-       mov     _tmpfil,r0
-       jsr     r5,fcreat; buf
-       bec     1f
-       mov     $1,r0
-       sys     write; botch; ebotch-botch
-       sys     exit
-1:
-       mov     2(sp),r0
-       jsr     r5,putw; buf
-       rts     pc
-.globl _flshw
-.data
-_flshw:        1f
-.text
-1:
-       jsr     r5,flush; buf
-       rts     pc
-
-botch: <Temp file?\n\0>; ebotch:
-.even
-
-.bss
-buf:   .=.+518.
-.text
-
-/ C operator and conversion tables
-
-.globl _opdope
-.globl _cvtab
-
-_opdope:.+2
-       00000   / EOF
-       00000   / ;
-       00000   / {
-       00000   / }
-       36000   / [
-       02000   / ]
-       36000   / (
-       02000   / )
-       14201   / :
-       07001   / ,
-       00000   / 10
-       00000   / 11
-       00000   / 12
-       00000   / 13
-       00000   / 14
-       00000   / 15
-       00000   / 16
-       00000   / 17
-       00000   / 18
-       00000   / 19
-       00000   / name
-       00000   / short constant
-       00000   / string
-       00000   / float
-       00000   / double
-       00000   / 25
-       00000   / 26
-       00000   / 27
-       00000   / 28
-       00000   / 29
-       34202   / ++pre
-       34202   / --pre
-       34202   / ++post
-       34202   / --post
-       34220   / !un
-       34202   / &un
-       34220   / *un
-       34200   / -un
-       34220   / ~un
-       00000   / 39
-       30101   / +
-       30001   / -
-       32101   / *
-       32001   / /
-       32001   / %
-       26061   / >>
-       26061   / <<
-       20161   / &
-       16161   / |
-       16161   / ^
-       00000   / 50
-       00000   / 51
-       00000   / 52
-       00000   / 53
-       00000   / 54
-       00000   / 55
-       00000   / 56
-       00000   / 57
-       00000   / 58
-       00000   / 59
-       22105   / ==
-       22105   / !=
-       24105   / <=
-       24105   / <
-       24105   / >=
-       24105   / >
-       24105   / <p
-       24105   / <=p
-       24105   / >p
-       24105   / >=p
-       12213   / =+
-       12213   / =-
-       12213   / =*
-       12213   / =/
-       12213   / =%
-       12253   / =>>
-       12253   / =<<
-       12253   / =&
-       12253   / =|
-       12253   / =^
-       12213   / =
-       00000   / 81
-       00000   / 82
-       00000   / 83
-       00000   / int -> float
-       00000   / int -> double
-       00000   / float -> int
-       00000   / float -> double
-       00000   / double -> int
-       00000   / double -> float
-       14201   / ?
-       00000   / 91
-       00000   / 92
-       00000   / 93
-       00000   / int -> float
-       00000   / int -> double
-       00000   / float -> double
-       00000   / int -> int[]
-       00000   / int -> float[]
-       00000   / int -> double[]
-       36001   / call
-       36001   / mcall
-
-_cvtab:        .+2
-       .byte   000     / i:i
-       .byte   000     / i:c
-       .byte   113     / i:f
-       .byte   125     / i:d
-       .byte   140     / i:i[]
-       .byte   100     / i:c[]
-       .byte   150     / i:f[]
-       .byte   160     / i:d[]
-       .byte   140     / i:[][]
-
-       .byte   100     / c:i
-       .byte   100     / c:c
-       .byte   113     / c:f
-       .byte   125     / c:d
-       .byte   140     / c:i[]
-       .byte   100     / c:c[]
-       .byte   150     / c:f[]
-       .byte   160     / c:d[]
-       .byte   140     / c[][]
-
-       .byte   211     / f:i
-       .byte   211     / f:c
-       .byte   000     / f:f
-       .byte   136     / f:d
-       .byte   211     / f:i[]
-       .byte   211     / f:c[]
-       .byte   211     / f:f[]
-       .byte   211     / f:d[]
-       .byte   211     / f:[][]
-
-       .byte   222     / d:i
-       .byte   222     / d:c
-       .byte   234     / d:f
-       .byte   000     / d:d
-       .byte   222     / d:i[]
-       .byte   222     / d:c[]
-       .byte   222     / d:f[]
-       .byte   222     / d:d[]
-       .byte   222     / d:[][]
-
-       .byte   240     / i[]:i
-       .byte   240     / i[]:c
-       .byte   113     / i[]:f
-       .byte   125     / i[]:d
-       .byte   000     / i[]:i[]
-       .byte   000     / i[]:c[]
-       .byte   100     / i[]:f[]
-       .byte   100     / i[]:d[]
-       .byte   100     / i[]:[][]
-
-       .byte   000     / c[]:i
-       .byte   000     / c[]:c
-       .byte   113     / c[]:f
-       .byte   125     / c[]:d
-       .byte   200     / c[]:i[]
-       .byte   000     / c[]:c[]
-       .byte   200     / c[]:f[]
-       .byte   200     / c[]:d[]
-       .byte   200     / c[]:[][]
-
-       .byte   250     / f[]:i
-       .byte   250     / f[]:c
-       .byte   113     / f[]:f
-       .byte   125     / f[]:d
-       .byte   000     / f[]:i[]
-       .byte   000     / f[]:c[]
-       .byte   000     / f[]:f[]
-       .byte   100     / f[]:d[]
-       .byte   000     / f[]:[][]
-
-       .byte   260     / d[]:i
-       .byte   260     / d[]:c
-       .byte   113     / d[]:f
-       .byte   125     / d[]:d
-       .byte   000     / d[]:i[]
-       .byte   000     / d[]:c[]
-       .byte   000     / d[]:f[]
-       .byte   000     / d[]:d[]
-       .byte   000     / d[]:[][]
-
-       .byte   240     / [][]:i
-       .byte   240     / [][]:c
-       .byte   113     / [][]:f
-       .byte   125     / [][]:d
-       .byte   000     / [][]:i[]
-       .byte   000     / [][]:c[]
-       .byte   100     / [][]:f[]
-       .byte   100     / [][]:d[]
-       .byte   000     / [][]:[][]
-
-.even
-
-/ character type table
-
-.globl _ctab
-
-_ctab: .+2
-       .byte 000.,127.,127.,127.,127.,127.,127.,127.
-       .byte 127.,126.,125.,127.,127.,127.,127.,127.
-       .byte 127.,127.,127.,127.,127.,127.,127.,127.
-       .byte 127.,127.,127.,127.,127.,127.,127.,127.
-       .byte 126.,034.,122.,127.,127.,044.,047.,121.
-       .byte 006.,007.,042.,040.,009.,041.,127.,043.
-       .byte 124.,124.,124.,124.,124.,124.,124.,124.
-       .byte 124.,124.,008.,001.,063.,080.,065.,090.
-       .byte 127.,123.,123.,123.,123.,123.,123.,123.
-       .byte 123.,123.,123.,123.,123.,123.,123.,123.
-       .byte 123.,123.,123.,123.,123.,123.,123.,123.
-       .byte 123.,123.,123.,004.,127.,005.,049.,127.
-       .byte 127.,123.,123.,123.,123.,123.,123.,123.
-       .byte 123.,123.,123.,123.,123.,123.,123.,123.
-       .byte 123.,123.,123.,123.,123.,123.,123.,123.
-       .byte 123.,123.,123.,002.,048.,003.,127.,127.
-
diff --git a/c/nc1/c10.c b/c/nc1/c10.c
deleted file mode 100644 (file)
index ad02520..0000000
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
-
-               C compiler, part 2
-
-       Copyright 1972 Bell Telephone Laboratories, Inc.
-
-*/
-
-ospace() {}    /* fake */
-
-waste()                /* waste space */
-{
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-       waste(waste(waste),waste(waste),waste(waste));
-}
-main(argc, argv)
-char argv[][];
-{
-       extern fout, fin, nerror, line;
-       extern getwrd, rcexpr, ospace, tmpfil;
-       extern cctab[], regtab[], efftab[], sptab[];
-       int sp[], c, table[], tabtab[3][], tree;
-
-       if (argc<4) {
-               error("Arg count");
-               exit(1);
-       }
-       if((fin=open(argv[1],0))<0) {
-               error("Cant't find %s", argv[1]);
-               exit(1);
-       }
-       if((fout=creat(argv[3],017))<0) {
-               error("Can't create %s", argv[3]);
-               exit(1);
-       }
-       tmpfil = argv[2];
-
-       tabtab[0] = regtab;
-       tabtab[1] = efftab;
-       tabtab[2] = cctab;
-       tabtab[3] = sptab;
-       while(c=getchar()) {
-               if(c=='#') {
-                       sp = ospace;
-                       c = getwrd();
-                       tree = getwrd();
-                       table = tabtab[getwrd()];
-                       line = getwrd();
-                       while(c--)
-                               *sp++ = getwrd();
-                       rcexpr(tree, table, 0);
-               } else
-                       putchar(c);
-       }
-       flush();
-       exit(nerror!=0);
-}
-
-match(tree, table, nreg)
-int tree[], table[]; {
-       extern opdope[], dcalc, notcompat;
-       int op, d1, d2, t1, t2, p1[], p2[];
-       char mp[];
-
-       if (tree==0)
-               return(0);
-       op = *tree;
-       if (op>=29)                     /* if not leaf */
-               p1 = tree[3];
-       else
-               p1 = tree;
-       t1 = p1[1];
-       d1 = dcalc(p1, nreg);
-       if ((opdope[op]&01)!=0) {       /* binary? */
-               p2 = tree[4];
-               t2 = p2[1];
-               d2 = dcalc(p2, nreg);
-       }
-       while(*table) {
-               if (*table++ == op) goto foundop;
-               table++;
-       }
-       return(0);
-foundop:
-       table = *table;
-nxtry:
-       mp = table;
-       if (*mp == 0)
-               return(0);
-       if (d1 > (*mp&077) | (*mp>=0100)&(*p1!=36))
-               goto notyet;
-       if (notcompat(t1, mp[1]))
-               goto notyet;
-       if ((opdope[op]&01)!=0 & p2!=0) {
-               if (d2 > (mp[2]&077) | (mp[2]>=0100)&(*p2!=36))
-                       goto notyet;
-               if (notcompat(t2,mp[3]))
-                       goto notyet;
-       }
-now:
-       return(table[2]);
-notyet:
-       table = table+3;
-       goto nxtry;
-}
-
-rcexpr(tree, table, reg)
-int tree[]; {
-       extern cexpr, regtab, cctab, sptab, printf, error;
-       extern jumpc, cbranch;
-
-       if(tree==0)
-               return;
-       if(*tree >= 103) {
-               (*tree==103?jumpc:cbranch)(tree[1],tree[2],tree[3],0);
-               return;
-       }
-       if (cexpr(tree, table, reg))
-               return;
-       if (table!=regtab) 
-               if(cexpr(tree, regtab, reg)) {
-                       if (table==sptab)
-                               printf("mov     r%d,-(sp)\n", reg);
-                       if (table==cctab)
-                               printf("tst     r%d\n", reg);
-                       return;
-               }
-       error("No match for op %d", *tree);
-}
-
-cexpr(tree, table, reg)
-int tree[][], table[]; {
-       extern match, nreg, printf, pname, putchar, regtab;
-       extern sptab, cctab, rcexpr, prins, rlength, popstk;
-       extern collcon, isn, label, branch, cbranch, fltmod;
-       int p1[], p2[], c, r, p[], otable[], ctable[], regtab[], cctab[];
-       char string[], match[];
-
-       if ((c = *tree)==100) {         /* call */
-               p1 = tree[3];
-               p2 = tree[4];
-               r = 0;
-               if(p2) {
-                       while (*p2==9) { /* comma */
-                               rcexpr(p2[4], sptab, 0);
-                               r =+ rlength((p=p2[4])[1]);
-                               p2 = p2[3];
-                       }
-                       rcexpr(p2, sptab, 0);
-                       r =+ rlength(p2[1]);
-               }
-               *tree = 101;
-               tree[2] = r;            /* save arg length */
-       }
-       if(c==90) {             /* ? */
-               cbranch(tree[3], c=isn++, 0, reg);
-               rcexpr(tree[4][3], table, reg);
-               branch(r=isn++, 0);
-               label(c);
-               rcexpr(tree[4][4], table, reg);
-               label(r);
-               return(1);
-       }
-       if ((string=match(tree, table, nreg-reg))==0) 
-               return(0);
-       p1 = tree[3];
-       p2 = tree[4];
-loop:
-       switch(c = *string++) {
-
-       case '\0':
-               p = tree;
-               if (*p==101 & p[2]>0) {
-                       popstk(p[2]);
-               }
-               return(1);
-
-       /* A1 */
-       case 'A':
-               p = tree[3];
-               goto adr;
-
-       /* A2 */
-       case 'B':
-               p = tree[4];
-               goto adr;
-
-       /* A */
-       case 'O':
-               p = tree;
-       adr:
-               pname(p);
-               goto loop;
-
-       /* I */
-       case 'M':
-               if ((c = *string)=='\'')
-                       string++; else
-                       c = 0;
-               prins(*tree, c);
-               goto loop;
-
-       /* B1 */
-       case 'C':
-               p = tree[3];
-               goto pbyte;
-
-       /* BF */
-       case 'P':
-               p = tree;
-               goto pb1;
-
-       /* B2 */
-       case 'D':
-               p = tree[4];
-       pbyte:
-               if (p[1]==1)    /* char type? */
-                       putchar('b');
-pb1:
-               if (isfloat(p))
-                       putchar('f');
-               goto loop;
-
-       /* BE */
-       case 'L':
-               if (tree[3][1]==1 | tree[4][1]==1)
-                       putchar('b');
-               goto loop;
-
-       /* C1 */
-       case 'E':
-               p = p1[3];
-               goto const;
-
-       /* C2 */
-       case 'F':
-               p = p2[3];
-       const:
-               printf("%o", p);
-               goto loop;
-
-       /* F */
-       case 'G':
-               p = p1;
-               goto subtre;
-
-       /* S */
-       case 'K':
-               p = p2;
-               goto subtre;
-
-       /* H */
-       case 'H':
-               p = tree;
-
-       subtre:
-               ctable = regtab;
-               r = reg;
-               c = *string++ - 'A';
-               if ((c&02)!=0)
-                       ctable = sptab;
-               if ((c&04)!=0)
-                       ctable = cctab;
-               if((c&010)!=0)
-                       r = reg+1;
-               if((c&01)!=0)
-                       if(*p==36) {
-                               p = p[3];
-                               if(collcon(p) & ctable!=sptab)
-                                       p = p[3];
-                       }
-               rcexpr(p, ctable, r);
-               goto loop;
-
-       /* R */
-       case 'I':
-               r = reg;
-               goto preg;
-
-       /* R1 */
-       case 'J':
-               r = reg+1;
-       preg:
-               printf("r%d", r);
-               goto loop;
-
-       case '#':
-               p = p1[3];
-               goto nmbr;
-
-       case '"':
-               p = p2[3];
-               goto nmbr;
-       case '~':
-               p = tree[3];
-
-       nmbr:
-               if(collcon(p)) {
-                       c = *p;
-                       if(r = (p=p[4])[3])
-                               printf("%o", c==40?r:-r);
-               }
-               goto loop;
-
-       /* M */
-       case 'N':
-               if ((c=isfloat(tree, &string))==fltmod)
-                       goto loop;
-               printf((fltmod=c)==2?"setf\n":"setd\n");
-               goto loop;
-
-       /* Z */
-       case 'Z':
-               printf("$%o", p1[4]);
-               goto loop;
-       }
-       putchar(c);
-       goto loop;
-}
-
-pname(p)
-int p[][][]; {
-       extern putchar, printf, error;
-       char np[];
-       int i;
-
-loop:
-       switch(*p) {
-
-       case 21:                /* const */
-               printf("$%o", p[3]);
-               return;
-
-       case 22:                /* string */
-               printf("$l%d", p[3]);
-               return;
-
-       case 20:                /* name */
-               switch(p[3]) {
-
-               case 5:         /* auto, param */
-                       printf("%o(r5)", p[4]);
-                       return;
-
-               /* extern */
-               case 6:
-                       printf("%p", &p[4]);
-                       return;
-
-               }
-               printf("L%d", p[4]);
-               return;
-
-       case 35:                /* & */
-               putchar('$');
-               p = p[3];
-               goto loop;
-
-       case 36:                /* * */
-               putchar('*');
-               p = p[3];
-               goto loop;
-       }
-       error("pname called illegally");
-}
-
-dcalc(p, nreg)
-int p[]; {
-       int op, t;
-
-       if (p==0)
-               return(0);
-       op = *p;
-       switch (op) {
-
-       case 20:                /* name */
-       case 22:                /* string */
-       case 23:                /* float */
-       case 24:                /* double */
-               return(12);
-
-       case 21:                /* short constant */
-               return(p[3]==0? 4:8);
-
-       case 35:                /* & */
-               return(12);
-
-       case 36:                /* * */
-               if ((op=dcalc(p[3], nreg))<16)
-                       return(16);
-       }
-
-def:
-       return(p[2]<=nreg? 20: 24);
-}
-
-notcompat(at, st) {
-
-       if (st==0)              /* word, byte */
-               return(at>1 & at<16);
-       if (st==1)              /* word */
-               return(at>0 & at<16);
-       st =- 2;
-       if (st==2 & at==3)
-               at = 2;
-       return(st != at);
-}
-
-prins(op, c) {
-       extern instab[], printf;
-       int insp[];
-
-       insp = instab;
-       while(*insp) {
-               if (*insp++ == op) {
-                       if ((c = insp[c!=0])==0)
-                               goto err;
-                       printf("%s", c);
-                       return;
-               } else
-                       insp = insp + 2;
-       }
-err:
-       error("No match' for op %d", op);
-}
-
-collcon(p)
-int p[]; {
-       int p1[];
-
-       if(*p==40 | *p==41)
-               if(*(p1=p[4])==21)
-                       return(1);
-       return(0);
-}
-
-isfloat(t, s)
-int t[];
-char s[][];
-{
-       extern opdope[];
-       int rt;
-
-       rt = **s - '0';
-       if (rt==2 | rt==4) {
-               (*s)++;
-               return(rt>2?3:2);
-       }
-       if ((opdope[t[0]]&010)!=0)      /* relational */
-               t = t[3];
-       if ((rt=t[1])>=2 & rt<=3)
-               return(rt);
-       return(0);
-}
-
-nreg 4;
-isn 10000;
-namsiz 8;
-line;
-tmpfil;
-nerror;
-fltmod;
-
diff --git a/c/nc1/c11.c b/c/nc1/c11.c
deleted file mode 100644 (file)
index 1733ad3..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-jumpc(tree, lbl, cond)
-int tree[]; {
-       extern jump, cctab[], rcexpr, isn, label, branch, cbranch;
-       int l1, l2;
-
-       if (tree==0)
-               return;
-       switch(*tree) {
-
-       /* & */
-       case 47:
-               if (cond) {
-                       cbranch(tree[3], l1=isn++, 0, 0);
-                       cbranch(tree[4], l1, 0, 0);
-                       jump(lbl);
-                       label(l1);
-               } else {
-                       cbranch(tree[3], l1=isn++, 0, 0);
-                       cbranch(tree[4], l2=isn++, 1, 0);
-                       label(l1);
-                       jump(lbl);
-                       label(l2);
-               }
-               return;
-
-       /* | */
-       case 48:
-               if (cond) {
-                       cbranch(tree[3], l1=isn++, 1, 0);
-                       cbranch(tree[4], l2=isn++, 0, 0);
-                       label(l1);
-                       jump(lbl);
-                       label(l2);
-               } else {
-                       cbranch(tree[3], l1=isn++, 1, 0);
-                       cbranch(tree[4], l1, 1, 0);
-                       jump(lbl);
-                       label(l1);
-               }
-               return;
-
-       /* ! */
-       case 34:
-               jumpc(tree[3], lbl, !cond);
-               return;
-       }
-       rcexpr(tree, cctab, 0);
-       branch(l1=isn++, *tree, cond);
-       jump(lbl);
-       label(l1);
-       return;
-}
-
-cbranch(tree, lbl, cond, reg)
-int tree[]; {
-       extern branch, cctab[], rcexpr, isn, label;
-       int l1;
-
-       if (tree==0)
-               return;
-       switch(*tree) {
-
-       /* & */
-       case 47:
-               if (cond) {
-                       cbranch(tree[3], l1=isn++, 0, reg);
-                       cbranch(tree[4], lbl, 1, reg);
-                       label(l1);
-               } else {
-                       cbranch(tree[3], lbl, 0, reg);
-                       cbranch(tree[4], lbl, 0, reg);
-               }
-               return;
-
-       /* | */
-       case 48:
-               if (cond) {
-                       cbranch(tree[3], lbl, 1, reg);
-                       cbranch(tree[4], lbl, 1, reg);
-               } else {
-                       cbranch(tree[3], l1=isn++, 1, reg);
-                       cbranch(tree[4], lbl, 0, reg);
-                       label(l1);
-               }
-               return;
-
-       /* ! */
-       case 34:
-               cbranch(tree[3], lbl, !cond, reg);
-               return;
-       }
-       rcexpr(tree, cctab, reg);
-       branch(lbl, *tree, !cond);
-       return;
-}
-
-
-branch(lbl, op, c) {
-       extern printf, prins, opdope[];
-
-       if(op) {
-               if((opdope[op]&04)==0)
-                       op = 61;
-               prins(op,c);
-       } else
-               printf("br");
-       printf("\tl%d\n", lbl);
-}
-
-jump(lab) {
-       extern printf;
-
-       printf("jmp\tl%d\n", lab);
-}
-
-label(l) {
-       extern printf;
-
-       printf("l%d:", l);
-}
-
-
-popstk(a) {
-       extern printf;
-
-       switch(a) {
-
-       case 0:
-               return;
-
-       case 2:
-               printf("tst     (sp)+\n");
-               return;
-
-       case 4:
-               printf("cmp     (sp)+,(sp)+\n");
-               return;
-       }
-       printf("add     $%o,sp\n", a);
-}
-
-length(t) {
-
-       if (t<0)
-               t =+ 020;
-       if (t>=020)
-               return(2);
-       switch(t) {
-
-       case 0:
-               return(2);
-
-       case 1:
-               return(1);
-
-       case 2:
-               return(4);
-
-       case 3:
-               return(8);
-
-       case 4:
-               return(4);
-
-       }
-       return(1024);
-}
-
-rlength(c) {
-       extern length;
-       auto l;
-
-       return((l=length(c))==1? 2: l);
-}
-
-printn(n,b) {
-       extern putchar;
-       auto a;
-
-       if(a=n/b) /* assignment, not test for equality */
-               printn(a, b); /* recursive */
-       putchar(n%b + '0');
-}
-
-printf(fmt,x1,x2,x3,x4,x5,x6,x7,x8,x9)
-char fmt[]; {
-       extern printn, putchar, namsiz, ncpw;
-       char s[];
-       auto adx[], x, c, i[];
-
-       adx = &x1; /* argument pointer */
-loop:
-       while((c = *fmt++) != '%') {
-               if(c == '\0')
-                       return;
-               putchar(c);
-       }
-       x = *adx++;
-       switch (c = *fmt++) {
-
-       case 'd': /* decimal */
-       case 'o': /* octal */
-               if(x < 0) {
-                       x = -x;
-                       if(x<0)  {      /* - infinity */
-                               if(c=='o')
-                                       printf("100000");
-                               else
-                                       printf("-32767");
-                               goto loop;
-                       }
-                       putchar('-');
-               }
-               printn(x, c=='o'?8:10);
-               goto loop;
-
-       case 's': /* string */
-               s = x;
-               while(c = *s++)
-                       putchar(c);
-               goto loop;
-
-       case 'p':
-               s = x;
-               putchar('_');
-               c = namsiz;
-               while(c--)
-                       if(*s)
-                               putchar(*s++);
-               goto loop;
-       }
-       putchar('%');
-       fmt--;
-       adx--;
-       goto loop;
-}
-
-error(s, p1, p2) {
-       extern printf, line, fout, flush, putchar, nerror;
-       int f;
-
-       nerror++;
-       flush();
-       f = fout;
-       fout = 1;
-       printf("%d: ", line);
-       printf(s, p1, p2);
-       putchar('\n');
-       fout = f;
-}
-
diff --git a/c/nc1/c1t.s b/c/nc1/c1t.s
deleted file mode 100644 (file)
index f0fa30d..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/ C operator tables
-
-.globl _getwrd
-
-.globl getw
-.globl fopen
-.globl _tmpfil
-
-.data
-_getwrd: 1f
-.text
-1:
-       tst     buf
-       bne     1f
-       mov     _tmpfil,r0
-       jsr     r5,fopen; buf
-       bes     botchp
-1:
-       jsr     r5,getw; buf
-       bes     botchp
-       rts     pc
-botchp:
-       mov     $1,r0
-       sys     write; botch; ebotch-botch
-       sys     exit
-botch:
-       <Temp file botch.\n>; ebotch:
-.even
-.bss
-buf:   .=.+518.
-.text
-.globl _opdope
-.globl _instab
-
-_instab:.+2
-       40.; 1f; 1f; .data; 1:<add\0>; .text
-       70.; 1b; 1b
-       41.; 2f; 2f; .data; 2:<sub\0>; .text
-       71.; 2b; 2b
-       30.; 3f; 1b; .data; 3:<inc\0>; .text
-       31.; 4f; 2b; .data; 4:<dec\0>; .text
-       32.; 3b; 1b
-       33.; 4b; 2b
-
-       45.; 2b; 5f; .data; 5:<ac\0>; .text
-       46.; 6f; 7f; .data; 6:<mov\0>; 7:<(r4)\0>; .text
-       75.; 2b; 5b
-       76.; 6b; 7b
-       43.; 7b; 1f; .data; 1:<divf\0>; .text
-       44.; 5b; 0
-       73.; 7b; 1b
-       74.; 5b; 0
-
-       60.; 0f; 1f; .data; 0:<beq\0>; 1:<bne\0>; .text
-       61.; 1b; 0b
-       62.; 2f; 5f; .data; 2:<ble\0>; 5:<bgt\0>; .text
-       63.; 3f; 4f; .data; 3:<blt\0>; 4:<bge\0>; .text
-       64.; 4b; 3b
-       65.; 5b; 2b
-       66.; 6f; 9f; .data; 6:<blos\0>; 9:<bhi\0>; .text
-       67.; 7f; 8f; .data; 7:<blo\0>; 8:<bhis\0>; .text
-       68.; 8b; 7b
-       69.; 9b; 6b
-       0
-       .data
-       .even
-       .text
-
-_opdope:.+2
-       00000   / EOF
-       00000   / ;
-       00000   / {
-       00000   / }
-       36000   / [
-       02000   / ]
-       36000   / (
-       02000   / )
-       02000   / :
-       07001   / ,
-       00000   / 10
-       00000   / 11
-       00000   / 12
-       00000   / 13
-       00000   / 14
-       00000   / 15
-       00000   / 16
-       00000   / 17
-       00000   / 18
-       00000   / 19
-       00000   / name
-       00000   / short constant
-       00000   / string
-       00000   / float
-       00000   / double
-       00000   / 25
-       00000   / 26
-       00000   / 27
-       00000   / 28
-       00000   / 29
-       34002   / ++pre
-       34002   / --pre
-       34002   / ++post
-       34002   / --post
-       34020   / !un
-       34002   / &un
-       34020   / *un
-       34000   / -un
-       34020   / ~un
-       00000   / 39
-       30101   / +
-       30001   / -
-       32101   / *
-       32001   / /
-       32001   / %
-       26061   / >>
-       26061   / <<
-       20161   / &
-       16161   / |
-       16161   / ^
-       00000   / 50
-       00000   / 51
-       00000   / 52
-       00000   / 53
-       00000   / 54
-       00000   / 55
-       00000   / 56
-       00000   / 57
-       00000   / 58
-       00000   / 59
-       22105   / ==
-       22105   / !=
-       24105   / <=
-       24105   / <
-       24105   / >=
-       24105   / >
-       24105   / <p
-       24105   / <=p
-       24105   / >p
-       24105   / >=p
-       12013   / =+
-       12013   / =-
-       12013   / =*
-       12013   / =/
-       12013   / =%
-       12053   / =>>
-       12053   / =<<
-       12053   / =&
-       12053   / =|
-       12053   / =^
-       12013   / =
-       00000   / 81
-       00000   / 82
-       00000   / 83
-       00000   / int -> float
-       00000   / int -> double
-       00000   / float -> int
-       00000   / float -> double
-       00000   / double -> int
-       00000   / double -> float
-       14001   / ?
-       00000   / 91
-       00000   / 92
-       00000   / 93
-       00000   / int -> float
-       00000   / int -> double
-       00000   / float -> double
-       00000   / int -> int[]
-       00000   / int -> float[]
-       00000   / int -> double[]
-       36001   / call
-       36001   / mcall
diff --git a/c/nc1/t.c b/c/nc1/t.c
deleted file mode 100644 (file)
index 85fcac1..0000000
--- a/c/nc1/t.c
+++ /dev/null
@@ -1,19 +0,0 @@
-main() {
-       extern a, b, c, i;
-       float a, b;
-       double c;
-       int i;
-
-       a = b;
-       a = b*c;
-       a = b*c/a;
-       a = c;
-       c = a;
-       a = c*c+a;
-       a = 1;
-       a = a+1;
-       i = a;
-       i = c;
-       a++;
-       c++;
-}
diff --git a/c/ncc.c b/c/ncc.c
deleted file mode 100644 (file)
index 5af1453..0000000
--- a/c/ncc.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/* C command */
-
-main(argc, argv)
-char argv[][]; {
-       extern callsys, printf, unlink, link, nodup;
-       extern getsuf, setsuf, copy;
-       extern tsp;
-       extern tmp0, tmp1, tmp2, tmp3;
-       char tmp0[], tmp1[], tmp2[], tmp3[];
-       char glotch[100][], clist[50][], llist[50][], ts[500];
-       char tsp[], av[50][], t[];
-       auto nc, nl, cflag, i, j, c;
-
-       tmp0 = tmp1 = tmp2 = tmp3 = "//";
-       tsp = ts;
-       i = nc = nl = cflag = 0;
-       while(++i < argc) {
-               if(*argv[i] == '-' & argv[i][1]=='c')
-                       cflag++;
-               else {
-                       t = copy(argv[i]);
-                       if((c=getsuf(t))=='c') {
-                               clist[nc++] = t;
-                               llist[nl++] = setsuf(copy(t));
-                       } else {
-                       if (nodup(llist, t))
-                               llist[nl++] = t;
-                       }
-               }
-       }
-       if(nc==0)
-               goto nocom;
-       tmp0 = copy("/tmp/ctm0a");
-       while((c=open(tmp0, 0))>=0) {
-               close(c);
-               tmp0[9]++;
-       }
-       while((creat(tmp0, 012))<0)
-               tmp0[9]++;
-       intr(delfil);
-       (tmp1 = copy(tmp0))[8] = '1';
-       (tmp2 = copy(tmp0))[8] = '2';
-       (tmp3 = copy(tmp0))[8] = '3';
-       i = 0;
-       while(i<nc) {
-               if (nc>1)
-                       printf("%s:\n", clist[i]);
-               av[0] = "c0";
-               av[1] = clist[i];
-               av[2] = tmp1;
-               av[3] = tmp2;
-               av[4] = 0;
-               if (callsys("/usr/lib/c0", av)) {
-                       cflag++;
-                       goto loop;
-               }
-               av[0] = "c1";
-               av[1] = tmp1;
-               av[2] = tmp2;
-               av[3] = tmp3;
-               av[4] = 0;
-               if(callsys("/usr/lib/c1", av)) {
-                       cflag++;
-                       goto loop;
-               }
-               av[0] = "as";
-               av[1] = "-";
-               av[2] = tmp3;
-               av[3] = 0;
-               callsys("/bin/as", av);
-               t = setsuf(clist[i]);
-               unlink(t);
-               if(link("a.out", t) | unlink("a.out")) {
-                       printf("move failed: %s\n", t);
-                       cflag++;
-               }
-loop:;
-               i++;
-       }
-nocom:
-       if (cflag==0 & nl!=0) {
-               i = 0;
-               av[0] = "ld";
-               av[1] = "/usr/lib/crt0.o";
-               j = 2;
-               while(i<nl)
-                       av[j++] = llist[i++];
-               av[j++] = "-lc";
-               av[j++] = "-l";
-               av[j++] = 0;
-               callsys("/bin/ld", av);
-       }
-delfil:
-       dexit();
-}
-dexit()
-{
-       extern tmp0, tmp1, tmp2, tmp3;
-
-       unlink(tmp1);
-       unlink(tmp2);
-       unlink(tmp3);
-       unlink(tmp0);
-       exit();
-}
-
-getsuf(s)
-char s[];
-{
-       extern exit, printf;
-       auto c;
-       char t, os[];
-
-       c = 0;
-       os = s;
-       while(t = *s++)
-               if (t=='/')
-                       c = 0;
-               else
-                       c++;
-       s =- 3;
-       if (c<=8 & c>2 & *s++=='.' & *s=='c')
-               return('c');
-       return(0);
-}
-
-setsuf(s)
-char s[];
-{
-       char os[];
-
-       os = s;
-       while(*s++);
-       s[-2] = 'o';
-       return(os);
-}
-
-callsys(f, v)
-char f[], v[][]; {
-
-       extern fork, execv, wait, printf;
-       auto t, status;
-
-       if ((t=fork())==0) {
-               execv(f, v);
-               printf("Can't find %s\n", f);
-               exit(1);
-       } else
-               if (t == -1) {
-                       printf("Try again\n");
-                       return(1);
-               }
-       while(t!=wait(&status));
-       if ((t=(status&0377)) != 0) {
-               if (t!=9)               /* interrupt */
-                       printf("Fatal error in %s\n", f);
-               dexit();
-       }
-       return((status>>8) & 0377);
-}
-
-copy(s)
-char s[]; {
-       extern tsp;
-       char tsp[], otsp[];
-
-       otsp = tsp;
-       while(*tsp++ = *s++);
-       return(otsp);
-}
-
-nodup(l, s)
-char l[][], s[]; {
-
-       char t[], os[], c;
-
-       os = s;
-       while(t = *l++) {
-               s = os;
-               while(c = *s++)
-                       if (c != *t++) goto ll;
-               if (*t++ == '\0') return (0);
-ll:;
-       }
-       return(1);
-}
-
-tsp;
-tmp0;
-tmp1;
-tmp2;
-tmp3;
-
diff --git a/c/regtab.s b/c/regtab.s
deleted file mode 100644 (file)
index 9402684..0000000
+++ /dev/null
@@ -1,696 +0,0 @@
-/ c code tables-- compile to register
-
-fp = 1         / enable floating-point
-
-.globl _regtab
-
-_regtab=.; .+2
-       20.;    cr20
-       21.;    cr20
-       22.;    cr20
-       30.;    cr30
-       31.;    cr30
-       32.;    cr32
-       33.;    cr32
-       34.;    cr34
-       35.;    cr35
-       29.;    cr29
-       36.;    cr36
-       37.;    cr37
-       38.;    cr38
-       101.;   cr100
-       80.;    cr80
-       40.;    cr40
-       41.;    cr40    / - like +
-       42.;    cr42
-       43.;    cr43
-       44.;    cr43
-       45.;    cr45
-       46.;    cr45
-       47.;    cr47
-       48.;    cr48
-       60.;    cr60
-       61.;    cr60
-       62.;    cr60
-       63.;    cr60
-       64.;    cr60
-       65.;    cr60
-       66.;    cr60
-       67.;    cr60
-       68.;    cr60
-       69.;    cr60
-       70.;    cr70
-       71.;    cr70
-       72.;    cr72
-       73.;    cr73
-       74.;    cr73
-       75.;    cr75
-       76.;    cr75
-       77.;    cr77
-       78.;    cr78
-       102.;   cr102
-       97.;    cr97
-       0
-
-/ goto
-cr102:
-%i,n
-       jmp     *A1
-
-%n*,n
-       F*
-       jmp     *#1(R)
-
-%n,n
-       F
-       jmp     (R)
-
-/ call
-cr100:
-%n*,n
-       F*
-       jsr     pc,*#1(R)
-
-%a,n
-       jsr     pc,*A1
-
-%n,n
-       F
-       jsr     pc,(R)
-
-/ name, constant
-cr20:
-%z,n
-       clr     R
-
-%aw,n
-       mov     A,R
-
-%ab,n
-       movb    A,R
-
-.if fp
-%af,n
-       M
-       movf    A,R
-
-.endif
-
-/++,-- prefix
-cr30:
-%ai,n
-%abp,n
-%ab,n
-       IB1     A1
-       movB1   A1,R
-
-%a,n
-       I'      $2,A1
-       mov     A1,R
-
-%nbp*,n
-%ni*,n
-%nb*,n
-       F*
-       IB1     #1(R)
-       movB1   #1(R),R
-
-%n*,n
-       F*
-       I'      $2,#1(R)
-       mov     #1(R),R
-
-/ ++,-- postfix
-cr32:
-%ai,n
-%abp,n
-%ab,n
-       movB1   A1,R
-       IB1     A1
-
-%a,n
-       mov     A1,R
-       I'      $2,A1
-
-%nbp*,n
-%nb*,n
-%ni*,n
-       F*
-       movB1   #1(R),-(sp)
-       IB1     #1(R)
-       movB1   (sp)+,R
-
-%n*,n
-       F*
-       mov     #1(R),-(sp)
-       I'      $2,#1(R)
-       mov     (sp)+,R
-
-/ !
-cr34:
-%n,n
-       FC
-       beq     1f
-       clr     R
-       br      2f
-1:     mov     $1,R
-2:
-
-/ &unary
-cr35:
-%a,n
-       mov     $A1,R
-
-/ & unary of auto
-cr29:
-%e,n
-       mov     r5,R
-       add     Z,R
-
-/ *unary
-cr36:
-%abp*,n
-       F
-       movb    (R),R
-
-%a*,n
-       F
-       mov     (R),R
-
-%abp,n
-       movb    *A1,R
-
-%a,n
-       mov     *A1,R
-
-%nbp*,n
-       F*
-       movb    *#1(R),R
-
-%n*,n
-       F*
-       mov     *#1(R),R
-
-%nbp,n
-       H*
-       movb    ~(R),R
-
-%n,n
-       H*
-       mov     ~(R),R
-
-/ - unary
-cr37:
-%n,n
-       F
-       neg     R
-
-/ ~
-cr38:
-%n,n
-       F
-       com     R
-
-/ =
-cr80:
-%a,n
-       S
-       movB1   R,A1
-
-%n*,a
-       F*
-       movB1   A2,#1(R)
-       movB1   #1(R),R
-
-%n*,e
-       F*
-       S1
-       movB1   R1,#1(R)
-       mov     R1,R
-
-%n*,n
-       FS*
-       S
-       movB1   R,*(sp)+
-
-/ |
-cr48:
-%n,a
-       F
-       bisB2   A2,R
-
-%n,e*
-       F
-       S1*
-       bisB2   #2(R1),R
-
-%n,e
-       F
-       S1
-       bis     R1,R
-
-%n,n
-       FS
-       S
-       bis     (sp)+,R
-
-/ &
-cr47:
-%n,c
-       F
-       bic     $!C2,R
-
-%n,e
-       F
-       S1
-       com     R1
-       bic     R1,R
-
-%n,n
-       FS
-       S
-       com     (sp)
-       bic     (sp)+,R
-
-/ relationals
-cr60:
-%n,n
-       HC
-       I       2f
-       clr     R
-       br      1f
-2:     mov     $1,R
-1:
-
-/ >>, <<
-cr45:
-%a,aw
-       movB1   A1,I'
-       I       A2,lsh
-       movB1   I',R
-
-%n*,aw
-       F*
-       movB1   #1(R),I'
-       I       A2,lsh
-       movB1   I',R
-
-%n,aw
-       F
-       mov     R,I'
-       I       A2,lsh
-       mov     I',R
-
-%a,nw*
-       S*
-       movB1   A1,(r4)
-       I       #2(R),lsh
-       mov     (r4),R
-
-%a,n
-       S
-       movB1   A1,I'
-       I       R,lsh
-       mov     I',R
-
-%n,n
-       FS
-       S
-       mov     (sp)+,I'
-       I       R,lsh
-       mov     I',R
-
-/ +, -
-cr40:
-%n,aw
-       F
-       I       A2,R
-
-%n,ew*
-       F
-       S1*
-       I       #2(R1),R
-
-%n,e
-       F
-       S1
-       I       R1,R
-
-%n,nw*
-       SS*
-       F
-       I       *(sp)+,R
-
-%n,n
-       SS
-       F
-       I       (sp)+,R
-
-/ *
-cr42:
-%aw,a
-       mov     A1,(r4)+
-       movB2   A2,(r4)
-       mov     -(r4),R
-
-%n,a
-       F
-       mov     R,(r4)+
-       movB2   A2,(r4)
-       mov     -(r4),R
-
-%n,e
-       F
-       S1
-       mov     R,(r4)+
-       mov     R1,(r4)
-       mov     -(r4),R
-
-%n,n
-       FS
-       S
-       mov     (sp)+,(r4)+
-       mov     R,(r4)
-       mov     -(r4),R
-
-/ /; mod
-cr43:
-%a,a
-       movB1   A1,(r4)
-       movB2   A2,div
-       mov     I,R
-
-%a,n
-       S
-       movB1   A1,(r4)
-       mov     R,div
-       mov     I,R
-
-%n,a
-       F
-       mov     R,(r4)
-       movB2   A2,div
-       mov     I,R
-
-%n,e
-       F
-       S1
-       mov     R,(r4)
-       mov     R1,div
-       mov     I,R
-
-%e,n
-       S
-       F1
-       mov     R1,(r4)
-       mov     R,div
-       mov     I,R
-
-%n,n
-       FS
-       S
-       mov     (sp)+,(r4)
-       mov     R,div
-       mov     I,R
-
-/ =*
-cr72:
-%a,a
-       movB1   A1,(r4)
-       movB2   A2,mul
-       movB1   (r4),A1
-       mov     (r4),R
-
-%a,n
-       S
-       mov     R,(r4)+
-       movB1   A1,(r4)
-       mov     -(r4),R
-       movB1   R,A1
-
-%n*,a
-       F*
-       movB1   #1(R),(r4)
-       movB2   A2,mul
-       movB1   (r4),#1(R)
-       mov     (r4),R
-
-%n*,e
-       F*
-       S1
-       movB1   #1(R),(r4)
-       mov     R1,mul
-       movB1   (r4),#1(R)
-       mov     (r4),R
-
-%e*,n
-       S
-       F1*
-       movB1   #1(R1),(r4)
-       mov     R,mul
-       movB1   (r4),#1(R1)
-       mov     (r4),R
-
-%n*,n
-       FS*
-       S
-       movB1   *(sp),(r4)
-       mov     R,mul
-       movB1   (r4),*(sp)+
-       mov     (r4),R
-
-/ =mod, =/
-cr73:
-%a,a
-       movB1   A1,(r4)
-       movB2   A2,div
-       movB1   I,A1
-       mov     I,R
-
-%a,n
-       S
-       movB1   A1,(r4)
-       mov     R,div
-       mov     I,R
-       movB1   R,A1
-
-%n*,a
-       F*
-       movB1   #1(R),(r4)
-       movB2   A2,div
-       movB1   I,#1(R)
-       mov     I,R
-
-%n*,e
-       F*
-       S1
-       movB1   #1(R),(r4)
-       mov     R1,div
-       movB1   I,#1(R)
-       mov     I,R
-
-%e*,n
-       S
-       F1*
-       movB1   #1(R1),(r4)
-       mov     R,div
-       movB1   I,#1(R1)
-       mov     I,R
-
-%n*,n
-       FS*
-       S
-       movB1   *(sp),(r4)
-       mov     R,div
-       movB1   I,*(sp)+
-       mov     I,R
-
-/ =|
-cr78:
-%a,a
-       bisBE   A2,A1
-       movB1   A1,R
-
-%a,n
-       S
-       bisB1   R,A1
-       movB1   A1,R
-
-%n*,a
-       F*
-       bisBE   A2,#1(R)
-       movB1   #1(R),R
-
-%e*,n*
-       S*
-       F1*
-       bisBE   #1(R1),#2(R)
-       movB1   #2(R),R
-
-%e*,n
-       S
-       F1*
-       bisBE   R,#1(R1)
-       movB1   #1(R1),R
-
-%n*,e*
-       F*
-       S1*
-       bisBE   #2(R1),#1(R)
-       movB1   #1(R),R
-
-%n*,e
-       F*
-       S1
-       bisBE   R1,#1(R)
-       movB2   #1(R),R
-
-%n*,n*
-       FS*
-       S*
-       bisBE   #2(R),*(sp)
-       movB2   *(sp)+,R
-
-%n*,n
-       FS*
-       S
-       bisBE   R,*(sp)
-       mov     *(sp)+,R
-
-/ =&
-cr77:
-%a,c
-       bicB1   $!C2,A1
-       movB2   A1,R
-
-%a,n
-       S
-       com     R
-       bicB1   R,A1
-       movB1   A1,R
-
-%e*,n
-       S
-       F1*
-       com     R
-       bicB1   R,#1(R1)
-       movB1   #1(R1),R
-
-%n*,e
-       F*
-       S1
-       com     R1
-       bicB1   R1,#1(R)
-       movB1   #1(R),R
-
-%n*,n
-       FS*
-       S
-       com     R
-       bicB1   R,*(sp)
-       movB1   *(sp)+,R
-
-/ =>>, =<<
-cr75:
-%a,aw
-       movB1   A1,I'
-       I       A2,lsh
-       movB1   I',A1
-       movB1   I',R
-
-%a,n
-       S
-       movB1   A1,I'
-       I       R,lsh
-       movB1   I',A1
-       movB1   I',R
-
-%n*,e
-       F*
-       S1
-       movB1   #1(R),I'
-       I       R1,lsh
-       movB1   I',#1(R)
-       movB1   I',R
-
-%e*,n
-       S
-       F1*
-       movB1   #1(R1),I'
-       I       R,lsh
-       movB    I',#1(R1)
-       movB1   I',R
-
-%n*,n
-       FS*
-       S
-       movB1   *(sp),I'
-       I       R,lsh
-       movB1   I',*(sp)+
-       movB1   I',R
-
-/ =+
-cr70:
-%aw,aw
-       I       A2,A1
-       mov     A1,R
-
-%aw,nw*
-       S*
-       I       #2(R),A1
-       mov     A1,R
-
-%aw,n
-       S
-       I       R,A1
-       mov     A1,R
-
-%ew*,nw*
-       S*
-       F1*
-       I       #2(R),#1(R1)
-       mov     #1(R1),R
-
-%a,nw*
-       S*
-       movB1   A1,R1
-       I       #2(R),R1
-       movB1   R1,#2(R)
-       mov     R1,R
-
-%a,n
-       S
-       movB1   A1,R1
-       I       R1,R
-       movB1   R,A1
-
-%ew*,n
-       S
-       F1*
-       I       R,#1(R1)
-       mov     #1(R1),R
-
-%nw*,n
-       SS
-       F*
-       I       (sp)+,#1(R)
-       mov     #1(R),R
-
-%n*,n
-       SS
-       F*
-       movB1   #1(R),R1
-       I       (sp)+,R1
-       movB1   R1,#1(R)
-       mov     R1,R
-
-/ int -> int[]
-cr97:
-%n,n
-       F
-       asl     R
-
-.data
-.even
-.text
-
diff --git a/c/sptab.s b/c/sptab.s
deleted file mode 100644 (file)
index f359f70..0000000
--- a/c/sptab.s
+++ /dev/null
@@ -1,167 +0,0 @@
-/ c code tables-- expression to -(sp)
-
-.globl _sptab
-
-_sptab=.;.+2
-       20.;    cs20
-       21.;    cs21
-       22.;    cs21
-       30.;    cs30
-       31.;    cs30
-       32.;    cs32
-       33.;    cs32
-       35.;    cs35
-       36.;    cs36
-       40.;    cs40
-       41.;    cs40
-       42.;    cs42
-       47.;    cs47
-       48.;    cs48
-       0
-
-
-/ name
-cs20:
-%aw,n
-       mov     A,-(sp)
-
-/ constant
-cs21:
-%z,n
-       clr     -(sp)
-
-%a,n
-       mov     A,-(sp)
-
-/ ++,-- prefix
-cs30:
-%ai,n
-%abp,n
-       I       A1
-       mov     A1,-(sp)
-
-%aw,n
-       I'      $2,A1
-       mov     A1,-(sp)
-
-%nbp*,n
-%ni*,n
-       F*
-       I       #1(R)
-       mov     #1(R),-(sp)
-
-%nip*,n
-       F*
-       mov     #1(R),-(sp)
-       I'      $2,#1(R)
-
-/ ++,-- postfix
-cs32:
-%ai,n
-%abp,n
-       mov     A1,-(sp)
-       I       A1
-
-%aip,n
-       mov     A1,-(sp)
-       I'      $2,A1
-
-%nbp*,n
-%ni*,n
-       F*
-       mov     #1(R),-(sp)
-       I       #1(R)
-
-%nip*,n
-       F*
-       mov     #1(R),-(sp)
-       I'      $2,#1(R)
-
-/ & unary
-cs35:
-%i,n
-       mov     $A1,-(sp)
-
-/ * unary
-cs36:
-%aw,n
-       mov     *A1,-(sp)
-
-%nw*,n
-       F*
-       mov     #1(R),-(sp)
-
-/ +
-cs40:
-%n,aw
-       FS
-       I       A2,(sp)
-
-%n,nw*
-       FS
-       S*
-       I       #2(R),(sp)
-
-%n,n
-       FS
-       S
-       I       R,(sp)
-
-/ *
-cs42:
-%aw,a
-       mov     A1,(r4)+
-       movB2   A2,(r4)
-       mov     -(r4),-(sp)
-
-%n,a
-       F
-       mov     R,(r4)+
-       movB2   A2,(r4)
-       mov     -(r4),-(sp)
-
-%n,nw*
-       FS
-       S*
-       mov     (sp)+,(r4)+
-       mov     #2(R),(r4)
-       mov     -(r4),-(sp)
-
-%n,n
-       FS
-       S
-       mov     (sp)+,(r4)+
-       mov     R,(r4)
-       mov     -(r4),-(sp)
-
-/ &
-cs47:
-%n,c
-       FS
-       bic     $!C2,(sp)
-
-%n,n
-       FS
-       S
-       com     R
-       bic     R,(sp)
-
-/ |
-cs48:
-%n,a
-       FS
-       bisB2   A2,(sp)
-
-%n,n*
-       FS
-       S*
-       bisB2   #2(R),(sp)
-
-%n,n
-       FS
-       S
-       bis     R,(sp)
-
-.data
-.even
-.text
diff --git a/c/src b/c/src
deleted file mode 100644 (file)
index 45889d1..0000000
--- a/c/src
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/lib/c0 $1.c c.tmp0 c.tmp1
-/usr/lib/c1 c.tmp0 c.tmp1 $1.s
diff --git a/cmd/a1.s b/cmd/a1.s
deleted file mode 100644 (file)
index ea0f49f..0000000
--- a/cmd/a1.s
+++ /dev/null
@@ -1,143 +0,0 @@
-/ a1 -- pdp-11 assembler pass 1
-
-
-main:
-ecore = main+8192.
-       jmp     start
-go:
-       jsr     pc,assem
-       movb    pof,r0
-       sys     write; outbuf; 512.
-       movb    pof,r0
-       sys     close
-       movb    fbfil,r0
-       sys     close
-       tstb    errflg
-       bne     aexit
-       jsr     r5,fcreat; a.tmp3
-       mov     $txtsiz,r1              / even up
-       inc     (r1)
-       bic     $1,(r1)+
-       inc     (r1)
-       bic     $1,(r1)+
-       inc     (r1)
-       bic     $1,(r1)+
-       mov     r0,r1
-       sys     write; txtsiz; 6
-       mov     symend,0f
-       sub     $usymtab,0f
-       mov     r1,r0
-       sys     write; usymtab; 0:..
-       mov     r1,r0
-       sys     close
-       sys     exec; 2f; 1f
-
-aexit:
-       sys     unlink; a.tmp1
-       sys     unlink; a.tmp2
-       sys     unlink; a.tmp3
-       sys     exit
-1:
-       2f
-       a.tmp1
-       a.tmp2
-       a.tmp3
-unglob:
-       3f
-       0
-2:
-       </etc/as2\0>
-3:
-       <-g\0>
-       .even
-
-filerr:
-       mov     r4,-(sp)
-       mov     (r5)+,r4
-       mov     r4,0f
-       clr     r0
-1:
-       tstb    (r4)+
-       beq     1f
-       inc     r0
-       br      1b
-1:
-       mov     r0,1f
-       mov     $1,r0
-       sys     write; 0:0; 1:0
-       mov     r5,0f
-       mov     $1,r0
-       sys     write; 0:0; 2
-       tst     (r5)+
-       mov     (sp)+,r4
-       rts     r5
-
-fcreat:
-       mov     r4,-(sp)
-       mov     (r5)+,r4
-       mov     r4,0f
-1:
-       sys     creat; 0:..; 12
-       bes     2f
-       mov     (sp)+,r4
-       rts     r5
-2:
-       incb    9.(r4)
-       cmpb    9.(r4),$'z
-       blos    1b
-       mov     0b,0f
-       jsr     r5,filerr; 0:..; "?\n
-       sys     exit
-unlink; a.tmp3
-       sys     exit
-1:
-       2f
-       a.tmp1
-       a.tmp2
-       a.tmp3
-unglob:
-       3f
-       0
-2:
-       </etc/as2\0>
-3:
-       <-g\0>
-       .even
-
-filerr:
-       mov     r4,-(sp)
-       mov     (r5)+,r4
-       mov     r4,0f
-       clr     r0
-1:
-       tstb    (r4)+
-       beq     1f
-       inc     r0
-       br      1b
-1:
-       mov     r0,1f
-       mov     $1,r0
-       sys     write; 0:0; 1:0
-       mov     r5,0f
-       mov     $1,r0
-       sys     write; 0:0; 2
-       tst     (r5)+
-       mov     (sp)+,r4
-       rts     r5
-
-fcreat:
-       mov     r4,-(sp)
-       mov     (r5)+,r4
-       mov     r4,0f
-1:
-       sys     creat; 0:..; 12
-       bes     2f
-       mov     (sp)+,r4
-       rts     r5
-2:
-       incb    9.(r4)
-       cmpb    9.(r4),$'z
-       blos    1b
-       mov     0b,0f
-       jsr     r5,filerr; 0:..; "?\n
-       sys     
\ No newline at end of file
diff --git a/cmd/a2.s b/cmd/a2.s
deleted file mode 100644 (file)
index 98b27ab..0000000
--- a/cmd/a2.s
+++ /dev/null
@@ -1,98 +0,0 @@
-/ a2 -- pdp-11 assembler pass 1
-
-error:
-       incb    errflg
-       mov     r0,-(sp)
-       mov     r1,-(sp)
-       mov     (r5)+,r0
-       mov     *curarg,0f
-       beq     1f
-       clr     *curarg
-       mov     r0,-(sp)
-       jsr     r5,filerr; 0:0; '\n
-       mov     (sp)+,r0
-1:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     line,r3
-       movb    r0,1f
-       mov     $1f+6,r0
-       mov     $4,r1
-2:
-       clr     r2
-       dvd     $10.,r2
-       add     $'0,r3
-       movb    r3,-(r0)
-       mov     r2,r3
-       sob     r1,2b
-       mov     $1,r0
-       sys     write; 1f; 7
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       mov     (sp)+,r0
-       rts     r5
-
-1:     <f xxxx\n>
-       .even
-
-betwen:
-       cmp     r0,(r5)+
-       blt     1f
-       cmp     (r5)+,r0
-       blt     2f
-1:
-       tst     (r5)+
-2:
-       rts     r5
-
-putw:
-       tst     ifflg
-       beq     1f
-       cmp     r4,$'\n
-       bne     2f
-1:
-       jsr     pc,putc1
-       swab    r4
-       jsr     pc,putc1
-       swab    r4
-2:
-       rts     pc
-
-putc:
-       tst     ifflg
-       bne     1f
-putc1:
-       movb    r4,*obufp
-       inc     obufp
-       cmp     obufp,$outbuf+512.
-       blo     1f
-       mov     $outbuf,obufp
-       movb    pof,r0
-       sys     write; outbuf; 512.
-1:
-       rts     pc
-
-2
-       add     $'0,r3
-       movb    r3,-(r0)
-       mov     r2,r3
-       sob     r1,2b
-       mov     $1,r0
-       sys     write; 1f; 7
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       mov     (sp)+,r0
-       rts     r5
-
-1:     <f xxxx\n>
-       .even
-
-betwen:
-       cmp     r0,(r5)+
-       blt     1f
-       cmp     (r5)+,r0
-       blt     2f
-1:
-       t
\ No newline at end of file
diff --git a/cmd/a21.s b/cmd/a21.s
deleted file mode 100644 (file)
index ff2c827..0000000
--- a/cmd/a21.s
+++ /dev/null
@@ -1,205 +0,0 @@
-/ a21 -- pdp-11 assembler pass 2 
-
-main:
-       sys     intr; aexit
-       jmp     start
-
-/ set up sizes and origins
-
-go:
-       jsr     pc,getw
-       mov     r4,txtsiz
-       mov     r4,r1
-       jsr     pc,getw
-       mov     r4,datsiz
-       mov     r4,r2
-       jsr     pc,getw
-       mov     r4,bsssiz
-       mov     r1,r3
-       mov     r3,datbase      / txtsiz
-       mov     r3,savdot+2
-       add     r2,r3
-       mov     r3,bssbase      / txtsiz+datsiz
-       mov     r3,savdot+4
-       asl     r3
-       add     $20,r3
-       mov     r3,symseek      / 2*txtsiz+2*datsiz+20
-       sub     r2,r3
-       mov     r3,drelseek     / 2*txtsiz+datsiz
-       sub     r1,r3
-       mov     r3,trelseek     / txtsiz+datsiz+20
-       sub     r2,r3
-       mov     r3,datseek      / txtsiz+20
-
-/ read in symbol table itself
-
-       mov     $usymtab,r1
-1:
-       jsr     pc,getw
-       bvs     1f
-       add     $14,symsiz              / count symbols
-       jsr     pc,getw
-       jsr     pc,getw
-       bic     $!377,r4
-       bne     2f
-       mov     defund,r4               / (perhaps) globalize undef.
-2:
-       mov     r4,(r1)+
-       jsr     r5,doreloc
-       jsr     pc,getw
-       add     r3,r4
-       mov     r4,(r1)+
-       jsr     pc,setbrk
-       br      1b
-1:
-
-/ read in f-b definitions
-
-       mov     r1,fbbufp
-       movb    fbfil,fin
-       clr     ibufc
-1:
-       jsr     pc,getw
-       bvs     1f
-       mov     r4,(r1)+
-       swab    r4
-       jsr     r5,doreloc
-       jsr     pc,getw
-       add     r3,r4
-       mov     r4,(r1)+
-       jsr     pc,setbrk
-       br      1b
-1:
-       mov     $-1,(r1)+
-
-/ set up input text file; initialize f-b table
-
-       mov     txtfil,fin
-       clr     ibufc
-       clr     r4
-1:
-       jsr     pc,fbadv
-       tstb    (r4)+
-       cmp     r4,$10.
-       blt     1b
-
-/ go
-
-       clr     r0
-       jsr     r5,oset; txtp
-       mov     trelseek,r0
-       jsr     r5,oset; relp
-       mov     $8.,r2
-       mov     $txtmagic,r1
-1:
-       mov     (r1)+,r0
-       jsr     r5,putw; txtp
-       dec     r2
-       bne     1b
-       jsr     pc,assem
-
-/polish off text and relocation
-
-       jsr     r5,flush; txtp
-       jsr     r5,flush; relp
-
-/ append full symbol table
-
-       mov     symf,r0
-       mov     r0,fin
-       clr     ibufc
-       sys     seek; 6; 0
-       mov     symseek,r0
-       jsr     r5,oset; txtp
-       mov     $usymtab,r1
-1:
-       jsr     pc,getw
-       bvs     1f
-       jsr     pc,convs
-       jsr     pc,getw
-       jsr     pc,convs
-       jsr     pc,getw
-       mov     r4,r0
-       als     $-10.,r0
-       bic     $!77,r0
-       movb    chartab(r0),r0
-       jsr     r5,putw; txtp
-       mov     (r1)+,r0
-       jsr     r5,putw; txtp
-       jsr     pc,getw
-       mov     (r1)+,r0
-       jsr     r5,putw; txtp
-       br      1b
-1:
-       jsr     r5,flush; txtp
-
-aexit:
-       mov     a.tmp1,0f
-       sys     unlink; 0:..
-       mov     a.tmp2,0f
-       sys     unlink; 0:..
-       mov     a.tmp3,0f
-       sys     unlink; 0:..
-       sys     chmod; a.out; outmod: 37
-       sys     exit
-
-filerr:
-       mov     *(r5),r5
-1:
-       movb    (r5)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       mov     $1,r0
-       sys     write; qnl; 2
-       br      aexit
-
-doreloc:
-       clr     r3
-       bic     $!37,r4
-       cmp     r4,$5
-       bhis    1f
-       cmp     r4,$3
-       blo     1f
-       beq     2f
-       mov     bssbase,r3
-       br      1f
-2:
-       mov     datbase,r3
-1:
-       rts     r5
-
-setbrk:
-       mov     r1,-(sp)
-       add     $20,r1
-       cmp     r1,0f
-       blo     1f
-       add     $512.,0f
-       sys     break; 0: end
-1:
-       mov     (sp)+,r1
-       rts     pc
-
-
-       mov     a.tmp1,0f
-       sys     unlink; 0:..
-       mov     a.tmp2,0f
-       sys     unlink; 0:..
-       mov     a.tmp3,0f
-       sys     unlink; 0:..
-       sys     chmod; a.out; outmod: 37
-       sys     exit
-
-filerr:
-       mov     *(r5),r5
-1:
-       movb    (r5)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       mov     $1,r0
-       sys     write; 
\ No newline at end of file
diff --git a/cmd/a3.s b/cmd/a3.s
deleted file mode 100644 (file)
index 656277a..0000000
--- a/cmd/a3.s
+++ /dev/null
@@ -1,140 +0,0 @@
-/ a3 -- pdp-11 assembler pass 1
-
-assem:
-       jsr     pc,readop
-       jsr     pc,checkeos
-               br ealoop
-       tst     ifflg
-       beq     3f
-       cmp     r4,$200
-       blos    assem
-       cmpb    (r4),$21        /if
-       bne     2f
-       inc     ifflg
-2:
-       cmpb    (r4),$22   /endif
-       bne     assem
-       dec     ifflg
-       br      assem
-3:
-       mov     r4,-(sp)
-       jsr     pc,readop
-       cmp     r4,$'=
-       beq     4f
-       cmp     r4,$':
-       beq     1f
-       mov     r4,savop
-       mov     (sp)+,r4
-       jsr     pc,opline
-dotmax:
-       movb    dotrel,r0
-       asl     r0
-       cmp     dot,txtsiz-4(r0)
-       blos    ealoop
-       mov     dot,txtsiz-4(r0)
-       br      ealoop
-1:
-       mov     (sp)+,r4
-       cmp     r4,$200
-       bhis    1f
-       cmp     r4,$1
-       beq     3f
-       jsr     r5,error; 'x
-       br      assem
-1:
-       bitb    $37,(r4)
-       beq     1f
-       jsr     r5,error; 'm
-1:
-       bisb    dot-2,(r4)
-       mov     dot,2(r4)
-       br      assem
-3:
-       mov     numval,r0
-       jsr     pc,fbcheck
-       movb    dotrel,curfbr(r0)
-       asl     r0
-       movb    dotrel,nxtfb+1
-       mov     dot,nxtfb+2
-       movb    r0,nxtfb
-       mov     dot,curfb(r0)
-       movb    fbfil,r0
-       sys     write; nxtfb; 4
-       br      assem
-4:
-       jsr     pc,readop
-       jsr     pc,expres
-       mov     (sp)+,r1
-       cmp     r1,$200
-       bhis    1f
-       jsr     r5,error; 'x
-       br      ealoop
-1:
-       cmp     r1,$dotrel
-       bne     2f
-       bic     $40,r3
-       cmp     r3,dotrel
-       bne     1f
-2:
-       bicb    $37,(r1)
-       bic     $!37,r3
-       bne     2f
-       clr     r2
-2:
-       bisb    r3,(r1)
-       mov     r2,2(r1)
-       br      dotmax
-1:
-       jsr     r5,error; '.
-       movb    $2,dotrel
-ealoop:
-       cmp     r4,$';
-       beq     assem1
-       cmp     r4,$'\n
-       bne     1f
-       inc     line
-       br      assem1
-1:
-       cmp     r4,$'\e
-       bne     2f
-       tst     ifflg
-       beq     1f
-       jsr     r5,error; 'x
-1:
-       rts     pc
-2:
-       jsr     r5,error; 'x
-2:
-       jsr     pc,checkeos
-               br assem1
-       jsr     pc,readop
-       br      2b
-assem1:
-       jmp     assem
-
-fbcheck:
-       cmp     r0,$9.
-       bhi     1f
-       rts     pc
-1:
-       jsr     r5,error; 'f
-       clr     r0
-       rts     pc
-
-checkeos:
-       cmp     r4,$'\n
-       beq     1f
-       cmp     r4,$';
-       beq     1f
-       cmp     r4,$'\e
-       beq     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
-,r3
-       bne     2f
-       clr     r2
-2:
-       bisb    r3,(r1)
-       
\ No newline at end of file
diff --git a/cmd/a4.s b/cmd/a4.s
deleted file mode 100644 (file)
index 48a3097..0000000
--- a/cmd/a4.s
+++ /dev/null
@@ -1,234 +0,0 @@
-/ a4 -- pdp-11 assembler pass1
-
-rname:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     $2,r5
-       mov     $symbol,r2
-       clr     -(sp)
-1:
-       jsr     pc,rnch
-       mov     r3,r1
-       mpy     $40.,r1
-       jsr     pc,rnch
-       add     r3,r1
-       mpy     $40.,r1
-       jsr     pc,rnch
-       add     r1,r3
-       add     r3,(sp)
-       mov     r3,(r2)+
-       sob     r5,1b
-       jsr     pc,rnch
-       mov     r3,r1
-       add     r3,(sp)
-       als     $10.,r1
-       mov     r1,(r2)
-1:
-       jsr     pc,rnch
-       tst     r3
-       bne     1b
-       mov     (sp)+,r1
-       clr     r0
-       dvd     $hshsiz,r0
-       mov     r1,r0
-       asl     r0
-       add     $hshtab,r0
-1:
-       cmp     r0,$hshtab
-       bhi     2f
-       mov     $2*hshsiz+hshtab,r0
-2:
-       mov     $symbol,r2
-       mov     -(r0),r4
-       beq     3f
-       cmp     (r2)+,(r4)+
-       bne     1b
-       cmp     (r2)+,(r4)+
-       bne     1b
-       cmpb    1(r4),1(r2)
-       bne     1b
-       br      1f
-3:
-       mov     symend,r4
-       mov     r4,(r0)
-       mov     r4,-(sp)
-       add     $20,r4
-       cmp     r4,0f
-       blos    4f
-       add     $512.,0f
-       sys     break; 0:end
-4:
-       mov     (sp)+,r4
-       mov     (r2)+,(r4)+
-       mov     (r2)+,(r4)+
-       mov     (r2)+,(r4)+
-       clr     (r4)+
-       mov     r4,symend
-       sub     $4,r4
-1:
-       mov     r4,-(sp)
-       sub     $symtab-374,r4
-       asr     r4
-       jsr     pc,putw
-       mov     (sp)+,r4
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       tst     (sp)+
-       mov     (sp)+,r1
-       rts     pc
-
-rnch:
-       jsr     pc,rch
-       movb    chartab(r0),r3
-       ble     1f
-       rts     pc
-1:
-       movb    r0,ch
-       clr     r3
-       rts     pc
-
-number:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     r5,-(sp)
-       clr     r1
-       clr     r5
-1:
-       jsr     pc,rch
-       jsr     r5,betwen; '0; '9
-               br 1f
-       sub     $'0,r0
-       mpy     $10.,r5
-       add     r0,r5
-       als     $3,r1
-       add     r0,r1
-       br      1b
-1:
-       cmp     r0,$'b
-       beq     1f
-       cmp     r0,$'f
-       beq     1f
-       cmp     r0,$'.
-       bne     2f
-       mov     r5,r1
-       clr     r0
-2:
-       movb    r0,ch
-       mov     r1,r0
-       mov     (sp)+,r5
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       rts     pc
-1:
-       mov     r0,r3
-       mov     r5,r0
-       jsr     pc,fbcheck
-       add     $141,r0
-       cmp     r3,$'b
-       beq     1f
-       add     $10.,r0
-1:
-       mov     r0,r4
-       mov     (sp)+,r5
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       add     $2,(sp)
-       rts     pc
-
-rch:
-       movb    ch,r0
-       beq     1f
-       clrb    ch
-       rts     pc
-1:
-       dec     inbfcnt
-       blt     2f
-       movb    *inbfp,r0
-       inc     inbfp
-       bic     $!177,r0
-       beq     1b
-       rts     pc
-2:
-       movb    fin,r0
-       beq     3f
-       sys     read; inbuf;512.
-       bcs     2f
-       tst     r0
-       beq     2f
-       mov     r0,inbfcnt
-       mov     $inbuf,inbfp
-       br      1b
-2:
-       movb    fin,r0
-       clrb    fin
-       sys     close
-3:
-       decb    nargs
-       bgt     2f
-       mov     $'\e,r0
-       rts     pc
-2:
-       tst     ifflg
-       beq     2f
-       jsr     r5,error; 'i
-       jmp     aexit
-2:
-       mov     curarg,r0
-       tst     (r0)+
-       mov     (r0),0f
-       mov     r0,curarg
-       incb    fileflg
-       sys     open; 0:0; 0
-       bec     2f
-       mov     0b,0f
-       jsr     r5,filerr; 0:0; <?\n>
-       jmp      aexit
-2:
-       movb    r0,fin
-       mov     $1,line
-       mov     r4,-(sp)
-       mov     r1,-(sp)
-       mov     $5,r4
-       jsr     pc,putw
-       mov     *curarg,r1
-2:
-       movb    (r1)+,r4
-       beq     2f
-       jsr     pc,putw
-       br      2b
-2:
-       mov     $-1,r4
-       jsr     pc,putw
-       mov     (sp)+,r1
-       mov     (sp)+,r4
-       br      1b
-
-
-       mov     $inbuf,inbfp
-       br      1b
-2:
-       movb    fin,r0
-       clrb    fin
-       sys     close
-3:
-       decb    nargs
-       bgt     2f
-       mov     $'\e,r0
-       rts     pc
-2:
-       tst     ifflg
-       beq     2f
-       jsr     r5,error; 'i
-       jmp     aexit
-2:
-       mov     curarg,r0
-       tst     (r0)+
-       mov     (r0),0f
-       mov     r0,curarg
-       incb    fileflg
-       sys     open; 0:0; 0
-       bec     2f
-       mov     0b,0f
-       jsr     r5,filerr; 0:0; <?\n>
-       jmp      aexi
\ No newline at end of file
diff --git a/cmd/a5.s b/cmd/a5.s
deleted file mode 100644 (file)
index f286c92..0000000
--- a/cmd/a5.s
+++ /dev/null
@@ -1,216 +0,0 @@
-/ a5 -- pdp-11 assembler pass 1
-
-readop:
-       mov     savop,r4
-       beq     1f
-       clr     savop
-       rts     pc
-1:
-       jsr     pc,8f
-       jsr     pc,putw
-       rts     pc
-
-8:
-       jsr     pc,rch
-       mov     r0,r4
-       movb    chartab(r0),r1
-       bgt     rdname
-       jmp     *1f-2(r1)
-
-       fixor
-       escp
-       8b
-       retread
-       dquote
-       garb
-       squote
-       rdname
-       skip
-       rdnum
-       retread
-       string
-1:
-
-escp:
-       jsr     pc,rch
-       mov     $esctab,r1
-1:
-       cmpb    r0,(r1)+
-       beq     1f
-       tstb    (r1)+
-       bne     1b
-       rts     pc
-1:
-       movb    (r1),r4
-       rts     pc
-
-esctab:
-       .byte '/, '/
-       .byte '\<, 035
-       .byte '>, 036
-       .byte '%, 037
-       .byte 0, 0
-
-fixor:
-       mov     $037,r4
-retread:
-       rts     pc
-
-rdname:
-       movb    r0,ch
-       cmp     r1,$26.
-       ble     1f
-       cmp     r1,$37.
-       blt     rdnum
-1:
-       jmp     rname
-
-rdnum:
-       jsr     pc,number
-               br 1f
-       rts     pc
-
-squote:
-       jsr     pc,rsch
-       br      1f
-dquote:
-       jsr     pc,rsch
-       mov     r0,-(sp)
-       jsr     pc,rsch
-       swab    r0
-       bis     (sp)+,r0
-1:
-       mov     r0,numval
-       mov     $1,r4
-       jsr     pc,putw
-       mov     numval,r4
-       jsr     pc,putw
-       mov     $1,r4
-       tst     (sp)+
-       rts     pc
-
-skip:
-       jsr     pc,rch
-       mov     r0,r4
-       cmp     r0,$'\e
-       beq     1f
-       cmp     r0,$'\n
-       bne     skip
-1:
-       rts     pc
-
-garb:
-       jsr     r5,error; 'g
-       br      8b
-
-string:
-       mov     $'<,r4
-       jsr     pc,putw
-       clr     numval
-1:
-       jsr     pc,rsch
-       tst     r1
-       bne     1f
-       mov     r0,r4
-       bis     $400,r4
-       jsr     pc,putw
-       inc      numval
-       br      1b
-1:
-       mov     $-1,r4
-       jsr     pc,putw
-       mov     $'<,r4
-       tst     (sp)+
-       rts     pc
-
-rsch:
-       jsr     pc,rch
-       cmp     r0,$'\e
-       beq     4f
-       cmp     r0,$'\n
-       beq     4f
-       clr     r1
-       cmp     r0,$'\\
-       bne     3f
-       jsr     pc,rch
-       mov     $schar,r2
-1:
-       cmpb    (r2)+,r0
-       beq     2f
-       tstb    (r2)+
-       bpl     1b
-       rts     pc
-2:
-       movb    (r2)+,r0
-       clr     r1
-       rts     pc
-3:
-       cmp     r0,$'>
-       bne     1f
-       inc     r1
-1:
-       rts     pc
-4:
-       jsr     r5,error; '<
-       jmp     aexit
-
-schar:
-       .byte 'n, 012
-       .byte 't, 011
-       .byte 'e, 004
-       .byte '0, 000
-       .byte 'r, 015
-       .byte 'a, 006
-       .byte 'p, 033
-       .byte 0,  -1
-
-       bis     $400,r4
-       jsr     pc,putw
-       inc      numval
-       br      1b
-1:
-       mov     $-1,r4
-       jsr     pc,putw
-       mov     $'<,r4
-       tst     (sp)+
-       rts     pc
-
-rsch:
-       jsr     pc,rch
-       cmp     r0,$'\e
-       beq     4f
-       cmp     r0,$'\n
-       beq     4f
-       clr     r1
-       cmp     r0,$'\\
-       bne     3f
-       jsr     pc,rch
-       mov     $schar,r2
-1:
-       cmpb    (r2)+,r0
-       beq     2f
-       tstb    (r2)+
-       bpl     1b
-       rts     pc
-2:
-       movb    (r2)+,r0
-       clr     r1
-       rts     pc
-3:
-       cmp     r0,$'>
-       bne     1f
-       inc     r1
-1:
-       rts     pc
-4:
-       jsr     r5,error; '<
-       jmp     aexit
-
-schar:
-       .byte 'n, 012
-       .byte 't, 011
-       .byte 'e, 004
-       .byte '0, 000
-       .byte 'r, 015
-       .byte 'a, 006
-       .byte 'p, 033
\ No newline at end of file
diff --git a/cmd/a6.s b/cmd/a6.s
deleted file mode 100644 (file)
index ccffdd6..0000000
--- a/cmd/a6.s
+++ /dev/null
@@ -1,309 +0,0 @@
-/ a6 -- pdp-11 assembler pass 1
-
-opline:
-       mov     r4,r0
-       jsr     r5,betwen; 0; 200
-               br      1f
-       cmp     r0,$'<
-       bne     xpr
-       jmp     opl17
-xpr:
-       jsr     pc,expres
-       add     $2,dot
-       rts     pc
-1:
-       movb    (r4),r0
-       cmp     r0,$24
-       beq     xpr
-       jsr     r5,betwen; 5; 32
-               br xpr
-       mov     r0,-(sp)
-       jsr     pc,readop
-       mov     (sp)+,r0
-       asl     r0
-       jmp     *1f-12(r0)
-
-1:
-       opl13   / map fop freg,fdst to double
-       opl6
-       opl7
-       opl10
-       opl11
-       opl13   / map fld/fst to double
-       opl13
-       opl13   / map fop fsrc,freg to double
-       opl15
-       opl16
-       opl17
-       opl20
-       opl21
-       opl22
-       opl23
-       xpr
-       opl25
-       opl26
-       opl27
-       opl13  / map mul s,r to double
-       opl31
-       opl32
-
-/double
-opl13:
-opl7:
-       jsr     pc,addres
-op2:
-       cmp     r4,$',
-       beq     1f
-       jsr     pc,errora
-       rts     pc
-1:
-       jsr     pc,readop
-opl15:   / single operand
-       jsr     pc,addres
-       add     $2,dot
-       rts     pc
-
-opl31: / sob
-       jsr     pc,expres
-       cmp     r4,$',
-       beq     1f
-       jsr     pc,errora
-1:
-       jsr     pc,readop
-
-/branch
-opl6:
-opl10:
-opl11:
-       jsr     pc,expres
-       add     $2,dot
-       rts     pc
-
-/ .byte
-opl16:
-       jsr     pc,expres
-       inc     dot
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       br      opl16
-1:
-       rts     pc
-
-/ < (.ascii)
-opl17:
-       add     numval,dot
-       jsr     pc,readop
-       rts     pc
-
-/.even
-opl20:
-       inc     dot
-       bic     $1,dot
-       rts     pc
-
-/.if
-opl21:
-       jsr     pc,expres
-       tst     r3
-       bne     1f
-       jsr     r5,error; 'U
-1:
-       tst     r2
-       bne     opl22
-       inc     ifflg
-opl22: /endif
-       rts     pc
-
-/.globl
-opl23:
-       cmp     r4,$200
-       blo     1f
-       bisb    $40,(r4)
-       jsr     pc,readop
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       br      opl23
-1:
-       rts     pc
-
-opl25:
-opl26:
-opl27:
-       mov     dotrel,r1
-       asl     r1
-       mov     dot,savdot-4(r1)
-       mov     savdot-52(r0),dot
-       asr     r0
-       sub     $25-2,r0
-       mov     r0,dotrel
-       rts     pc
-
-/ .common
-opl32:
-       cmp     r4,$200
-       blo     1f
-       bis     $40,(r4)
-       jsr     pc,readop
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       jsr     pc,expres
-       rts     pc
-1:
-       jsr     r5,error; 'x
-       rts     pc
-
-addres:
-       cmp     r4,$'(
-       beq     alp
-       cmp     r4,$'-
-       beq     amin
-       cmp     r4,$'$
-       beq     adoll
-       cmp     r4,$'*
-       beq     astar
-getx:
-       jsr     pc,expres
-       cmp     r4,$'(
-       bne     2f
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkreg
-       jsr     pc,checkrp
-       add     $2,dot
-       clr     r0
-       rts     pc
-2:
-       cmp     r3,$24          / register type
-       bne     1f
-       jsr     pc,checkreg
-       clr     r0
-       rts     pc
-1:
-       add     $2,dot
-       clr     r0
-       rts     pc
-
-alp:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       cmp     r4,$'+
-       bne     1f
-       jsr     pc,readop
-       clr     r0
-       rts     pc
-1:
-       mov     $2,r0
-       rts     pc
-
-amin:
-       jsr     pc,readop
-       cmp     r4,$'(
-       beq     1f
-       mov     r4,savop
-       mov     $'-,r4
-       br      getx
-1:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       clr     r0
-       rts     pc
-
-adoll:
-       jsr     pc,readop
-       jsr     pc,expres
-       add     $2,dot
-       clr     r0
-       rts     pc
-
-astar:
-       jsr     pc,readop
-       cmp     r0,$'*
-       beq     1f
-       jsr     pc,addres
-       add     r0,dot
-       rts     pc
-2:
-       jsr     r5,error; '*
-       rts     pc
-
-errora:
-       jsr     r5,error; 'a
-       rts     pc
-
-checkreg:
-       cmp     r2,$7
-       bhi     1f
-       cmp     r3,$1
-       beq     2f
-       cmp     r3,$4
-       bhi     2f
-1:
-       jsr     pc,errora
-2:
-       rts     pc
-
-errore:
-       jsr     r5,error; 'e
-       rts     pc
-
-checkrp:
-       cmp     r4,$')
-       beq     1f
-       jsr     r5,error; ')
-       rts     pc
-1:
-       jsr     pc,readop
-       rts     pc
-
-r      getx
-1:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       clr     r0
-       rts     pc
-
-adoll:
-       jsr     pc,readop
-       jsr     pc,expres
-       add     $2,dot
-       clr     r0
-       rts     pc
-
-astar:
-       jsr     pc,readop
-       cmp     r0,$'*
-       beq     1f
-       jsr     pc,addres
-       add     r0,dot
-       rts     pc
-2:
-       jsr     r5,error; '*
-       rts     pc
-
-errora:
-       jsr     r5,error; 'a
-       rts     pc
-
-checkreg:
-       cmp     r2,$7
-       bhi     1f
-       cmp     r3,$1
-       beq     2f
-       cmp     r3,$4
-       bhi     2f
-1:
-       jsr     pc,errora
-2:
-       rts     pc
-
-errore:
-       jsr     r5,error; 'e
\ No newline at end of file
diff --git a/cmd/a7.s b/cmd/a7.s
deleted file mode 100644 (file)
index 6a5a02a..0000000
--- a/cmd/a7.s
+++ /dev/null
@@ -1,255 +0,0 @@
-/  a7 -- pdp-11 assembler pass 1
-
-expres:
-       mov     r5,-(sp)
-       mov     $'+,-(sp)
-       clr     opfound
-       clr     r2
-       mov     $1,r3
-       br      1f
-advanc:
-       jsr     pc,readop
-1:
-       mov     r4,r0
-       jsr     r5,betwen; 0; 177
-               br .+4
-       br      7f
-       movb    (r4),r0
-       mov     2(r4),r1
-       br      oprand
-7:
-       cmp     r4,$141
-       blo     1f
-       cmp     r4,$141+10.
-       bhis    2f
-       movb    curfbr-141(r4),r0
-       asl     r4
-       mov     curfb-[2*141](r4),r2
-       bpl     oprand
-       jsr     r5,error; 'f
-       br      oprand
-2:
-       clr     r3
-       clr     r2
-       br      oprand
-1:
-       mov     $esw1,r1
-1:
-       cmp     (r1)+,r4
-       beq     1f
-       tst     (r1)+
-       bne     1b
-       tst     opfound
-       bne     2f
-       jsr     pc,errore
-2:
-       tst     (sp)+
-       mov     (sp)+,r5
-       rts     pc
-1:
-       jmp     *(r1)
-
-esw1:
-       '+;     binop
-       '-;     binop
-       '*;     binop
-       '/;     binop
-       '&;     binop
-       037;    binop
-       035;    binop
-       036;    binop
-       '%;     binop
-       '[;     brack
-       '^;     binop
-       1;      exnum
-       '!;     binop
-       0;      0
-
-binop:
-       cmpb    (sp),$'+
-       beq     1f
-       jsr     pc,errore
-1:
-       movb    r4,(sp)
-       br      advanc
-
-exnum:
-       mov     numval,r1
-       mov     $1,r0
-       br      oprand
-
-brack:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       jsr     pc,readop
-       jsr     pc,expres
-       cmp     r4,$']
-       beq     1f
-       jsr     r5,error; ']
-1:
-       mov     r3,r0
-       mov     r2,r1
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-
-oprand:
-       inc     opfound
-       mov     $exsw2,r5
-1:
-       cmp     (sp),(r5)+
-       beq     1f
-       tst     (r5)+
-       bne     1b
-       br      eoprnd
-1:
-       jmp     *(r5)
-
-exsw2:
-       '+; exadd
-       '-; exsub
-       '*; exmul
-       '/; exdiv
-       037; exor
-       '&; exand
-       035;exlsh
-       036;exrsh
-       '%; exmod
-       '!; exnot
-       '^; excmbin
-       0;  0
-
-excmbin:
-       mov     r0,r3                   / give left flag of right
-       br      eoprnd
-
-exrsh:
-       neg     r1
-       beq     exlsh
-       inc     r1
-       clc
-       ror     r2
-exlsh:
-       jsr     r5,combin; 0
-       als     r1,r2
-       br      eoprnd
-
-exmod:
-       jsr     r5,combin; 0
-       mov     r1,-(sp)
-       mov     r2,r1
-       clr     r0
-       dvd     (sp)+,r0
-       mov     r1,r2
-       br      eoprnd
-
-exadd:
-       jsr     r5,combin; 0
-       add     r1,r2
-       br      eoprnd
-
-exsub:
-       jsr     r5,combin; 1
-       sub     r1,r2
-       br      eoprnd
-
-exand:
-       jsr     r5,combin; 0
-       com     r1
-       bic     r1,r2
-       br      eoprnd
-
-exor:
-       jsr     r5,combin; 0
-       bis     r1,r2
-       br      eoprnd
-
-exmul:
-       jsr     r5,combin; 0
-       mpy     r2,r1
-       mov     r1,r2
-       br      eoprnd
-
-exdiv:
-       jsr     r5,combin; 0
-       mov     r1,-(sp)
-       mov     r2,r1
-       clr     r0
-       dvd     (sp)+,r0
-       mov     r0,r2
-       br      eoprnd
-
-exnot:
-       jsr     r5,combin; 0
-       com     r1
-       add     r1,r2
-       br      eoprnd
-
-eoprnd:
-       mov     $'+,(sp)
-       jmp     advanc
-
-combin:
-       mov     r0,-(sp)
-       bis     r3,(sp)
-       bic     $!40,(sp)
-       bic     $!37,r0
-       bic     $!37,r3
-       cmp     r0,r3
-       ble     1f
-       mov     r0,-(sp)
-       mov     r3,r0
-       mov     (sp)+,r3
-1:
-       tst     r0
-       beq     1f
-       tst     (r5)+
-       beq     2f
-       cmp     r0,r3
-       bne     2f
-       mov     $1,r3
-       br      2f
-1:
-       tst     (r5)+
-       clr     r3
-2:
-       bis     (sp)+,r3
-       rts     r5
-
-r      eoprnd
-
-exmul:
-       jsr     r5,combin; 0
-       mpy     r2,r1
-       mov     r1,r2
-       br      eoprnd
-
-exdiv:
-       jsr     r5,combin; 0
-       mov     r1,-(sp)
-       mov     r2,r1
-       clr     r0
-       dvd     (sp)+,r0
-       mov     r0,r2
-       br      eoprnd
-
-exnot:
-       jsr     r5,combin; 0
-       com     r1
-       add     r1,r2
-       br      eoprnd
-
-eoprnd:
-       mov     $'+,(sp)
-       jmp     advanc
-
-combin:
-       mov     r0,-(sp)
-       bis     r3,(sp)
-       bic     $!40,(sp)
-       bic     $!37,r0
-       bic     $!37,r3
-       cmp     r0,r3
-       ble     1f
-       mov     r0,-(sp)
-       mov     r3,r0
-       m
\ No newline at end of file
diff --git a/cmd/a8.s b/cmd/a8.s
deleted file mode 100644 (file)
index 47f682e..0000000
--- a/cmd/a8.s
+++ /dev/null
@@ -1,81 +0,0 @@
-/ a8 -- pdp-11 assembler pass 1
-
-chartab:
-       .byte -14,-14,-14,-14,-02,-14,-14,-14
-       .byte -14,-22, -2,-14,-14,-22,-14,-14
-       .byte -14,-14,-14,-14,-14,-14,-14,-14
-       .byte -14,-14,-14,-14,-14,-14,-14,-14
-       .byte -22,-20,-16,-14,-20,-20,-20,-12
-       .byte -20,-20,-20,-20,-20,-20,38.,-06
-       .byte 27.,28.,29.,30.,31.,32.,33.,34.
-       .byte 35.,36.,-20,-02,-00,-20,-14,-14
-       .byte -14,01.,02.,03.,04.,05.,06.,07.
-       .byte 08.,09.,10.,11.,12.,13.,14.,15.
-       .byte 16.,17.,18.,19.,20.,21.,22.,23.
-       .byte 24.,25.,26.,-20,-24,-20,-20,37.
-       .byte -14,01.,02.,03.,04.,05.,06.,07.
-       .byte 08.,09.,10.,11.,12.,13.,14.,15.
-       .byte 16.,17.,18.,19.,20.,21.,22.,23.
-       .byte 24.,25.,26.,-14,-26,-14,-14,-14
-
-errflg:        .byte 0
-namedone:      .byte 0
-ch:    .byte 0
-a.tmp1:        </tmp/atm1a\0>
-a.tmp2:        </tmp/atm2a\0>
-a.tmp3:        </tmp/atm3a\0>
-qi:    <I\n>
-.even
-
-curfb:
-       -1;-1;-1;-1;-1;-1;-1;-1;-1;-1
-obufp: outbuf
-symend:        usymtab
-txtsiz:        .=.+2
-datsiz:        .=.+2
-bsssiz:        .=.+2
-curfbr:        .=.+10.
-savdot:        .=.+6
-bufcnt:        .=.+2
-hshsiz = 1000.
-hshtab:        .=2*hshsiz+.
-pof:   .=.+1
-wordf: .=.+1
-fin:   .=.+1
-fbfil: .=.+1
-fileflg:       .=.+1
-.even
-symbol:        .=.+6
-inbuf: .=.+512.
-obufc: .=.+2
-outbuf:        .=.+512.
-line:  .=.+2
-inbfcnt:       .=.+2
-ifflg: .=.+2
-inbfp: .=.+2
-nargs: .=.+2
-curarg:        .=.+2
-opfound:       .=.+2
-savop: .=.+2
-numval:        .=.+2
-nxtfb: .=.+4
-2:     </tmp/atm2a\0>
-a.tmp3:        </tmp/atm3a\0>
-qi:    <I\n>
-.even
-
-curfb:
-       -1;-1;-1;-1;-1;-1;-1;-1;-1;-1
-obufp: outbuf
-symend:        usymtab
-txtsiz:        .=.+2
-datsiz:        .=.+2
-bsssiz:        .=.+2
-curfbr:        .=.+10.
-savdot:        .=.+6
-bufcnt:        .=.+2
-hshsiz = 1000.
-hshtab:        .=2*hshsiz+.
-pof:   .=.+1
-wordf: .=.+1
-fin:   .=.+1
diff --git a/cmd/a9.s b/cmd/a9.s
deleted file mode 100644 (file)
index e79ea4b..0000000
--- a/cmd/a9.s
+++ /dev/null
@@ -1,364 +0,0 @@
-/ a9 -- pdp-11 assembler pass 1
-
-eae = 0
-
-/ key to types
-
-/      0       undefined
-/      1       absolute
-/      2       text
-/      3       data
-/      4       bss
-/      5       flop freg,dst (movfo, = stcfd)
-/      6       branch
-/      7       jsr
-/      10      rts
-/      11      sys
-/      12      movf (=ldf,stf)
-/      13      double operand (mov)
-/      14      flop fsrc,freg (addf)
-/      15      single operand (clr)
-/      16      .byte
-/      17      string (.ascii, "<")
-/      20      .even
-/      21      .if
-/      22      .endif
-/      23      .globl
-/      24      register
-/      25      .text
-/      26      .data
-/      27      .bss
-/      30      mul,div, etc
-/      31      sob
-/      32      .comm
-
-symtab:
-
-/ special variables
-
-166600; 000000; dotrel: 02; dot:000000 /.
-171560; 000000; 01; dotdot:000000 /..
-
-/ register
-
-072270;000000;24;000000 /r0
-072340;000000;24;000001 /r1
-072410;000000;24;000002 /r2
-072460;000000;24;000003 /r3
-072530;000000;24;000004 /r4
-072600;000000;24;000005 /r5
-074500;000000;24;000006 /sp
-062170;000000;24;000007 /pc
-
-.if eae
-
-/eae & switches
-
-012717;000000;01;177570 /csw
-015176;000000;01;177300 /div
-003270;000000;01;177302 /ac
-051750;000000;01;177304 /mq
-052224;000000;01;177306 /mul
-073470;000000;01;177310 /sc
-074620;000000;01;177311 /sr
-054752;000000;01;177312 /nor
-047000;000000;01;177314 /lsh
-004500;000000;01;177316 /ash
-
-.endif
-
-/ system calls
-
-021411;076400;01;0000001 /exit
-023752;042300;01;0000002 /fork
-070511;014400;01;0000003 /read
-111231;076710;01;0000004 /write
-060105;053600;01;0000005 /open
-012257;073610;01;0000006 /close
-107761;076400;01;0000007 /wait
-012625;004540;01;0000010 /creat
-046166;042300;01;0000011 /link
-102574;035173;01;0000012 /unlink
-021405;011300;01;0000013 /exec
-012004;035420;01;0000014 /chdir
-077165;017500;01;0000015 /time
-050563;015172;01;0000016 /makdir
-012015;057140;01;0000017 /chmod
-012017;110760;01;0000020 /chown
-007525;003770;01;0000021 /break
-074741;076400;01;0000022 /stat
-073615;042300;01;0000023 /seek
-076724;045400;01;0000024 /tell
-051655;055240;01;0000025 /mount
-102527;102604;01;0000026 /umount
-073634;102254;01;0000027 /setuid
-026234;102254;01;0000030 /getuid
-074751;051010;01;0000031 /stime
-066621;076400;01;0000032 /quit
-035204;070200;01;0000033 /intr
-024214;004540;01;0000034 /fstat
-011625;076400;01;0000035 /cemt
-050741;076710;01;0000036 /mdate
-074764;116100;01;0000037 /stty
-027364;116100;01;0000040 /gtty
-035047;035203;01;0000041 /ilgins
-054353;017500;01;0000042 /nice
-
-/ double operand
-
-051656;000000;13;0010000 /mov
-051656;006200;13;0110000 /movb
-012330;000000;13;0020000 /cmp
-012330;006200;13;0120000 /cmpb
-006774;000000;13;0030000 /bit
-006774;006200;13;0130000 /bitb
-006753;000000;13;0040000 /bic
-006753;006200;13;0140000 /bicb
-006773;000000;13;0050000 /bis
-006773;006200;13;0150000 /bisb
-003344;000000;13;0060000 /add
-075012;000000;13;0160000 /sub
-
-/ branch
-
-007520;000000;06;0000400 /br
-007265;000000;06;0001000 /bne
-006531;000000;06;0001400 /beq
-006635;000000;06;0002000 /bge
-007164;000000;06;0002400 /blt
-006654;000000;06;0003000 /bgt
-007145;000000;06;0003400 /ble
-007414;000000;06;0100000 /bpl
-007221;000000;06;0100400 /bmi
-006711;000000;06;0101000 /bhi
-007157;073300;06;0101400 /blos
-007763;000000;06;0102000 /bvc
-010003;000000;06;0102400 /bvs
-006711;073300;06;0103000 /bhis
-006513;000000;06;0103000 /bec
-006373;000000;06;0103000 /bcc
-007157;000000;06;0103400 /blo
-006413;000000;06;0103400 /bcs
-006533;000000;06;0103400 /bes
-
-/ single operand
-
-012262;000000;15;0005000 /clr
-012262;006200;15;0105000 /clrb
-012445;000000;15;0005100 /com
-012445;006200;15;0105100 /comb
-035163;000000;15;0005200 /inc
-035163;006200;15;0105200 /incb
-014713;000000;15;0005300 /dec
-014713;006200;15;0105300 /decb
-054117;000000;15;0005400 /neg
-054117;006200;15;0105400 /negb
-003343;000000;15;0005500 /adc
-003343;006200;15;0105500 /adcb
-073423;000000;15;0005600 /sbc
-073423;006200;15;0105600 /sbcb
-100014;000000;15;0005700 /tst
-100014;006200;15;0105700 /tstb
-071352;000000;15;0006000 /ror
-071352;006200;15;0106000 /rorb
-071344;000000;15;0006100 /rol
-071344;006200;15;0106100 /rolb
-004512;000000;15;0006200 /asr
-004512;006200;15;0106200 /asrb
-004504;000000;15;0006300 /asl
-004504;006200;15;0106300 /aslb
-040230;000000;15;0000100 /jmp
-075131;006200;15;0000300 /swab
-
-/ jsr
-
-040612;000000;07;0004000 /jsr
-
-/ rts
-
-071663;000000;010;000200 /rts
-
-/ simple operand
-
-075273;000000;011;104400 /sys
-
-/ flag-setting
-
-012243;000000;01;0000241 /clc
-012266;000000;01;0000242 /clv
-012272;000000;01;0000244 /clz
-012256;000000;01;0000250 /cln
-073613;000000;01;0000261 /sec
-073636;000000;01;0000262 /sev
-073642;000000;01;0000264 /sez
-073626;000000;01;0000270 /sen
-
-/ floating point ops
-
-011663;011300;01;170000 / cfcc
-073634;022600;01;170001 / setf
-073634;014400;01;170011 / setd
-073634;034100;01;170002 / seti
-073634;045400;01;170012 / setl
-012262;022600;15;170400 / clrf
-054117;022600;15;170700 / negf
-003243;022600;15;170600 / absf
-100014;022600;15;170500 / tstf
-051656;022600;12;172400 / movf
-051656;034460;14;177000 / movif
-051656;023350;05;175400 / movfi
-051656;057260;14;177400 / movof
-051656;023730;05;176000 / movfo
-003344;022600;14;172000 / addf
-075012;022600;14;173000 / subf
-052224;022600;14;171000 / mulf
-015176;022600;14;174400 / divf
-012330;022600;14;173400 / cmpf
-051634;022600;14;171400 / modf
-024153;000000;24;000000 / fr0
-024154;000000;24;000001 / fr1
-024155;000000;24;000002 / fr2
-024156;000000;24;000003 / fr3
-024157;000000;24;000004 / fr4
-024160;000000;24;000005 / fr5
-/ 11/45 operations
-
-004063;000000;30;072000 /als (ash)
-004063;011300;30;073000 /alsc (ashc)
-051731;000000;30;070000 /mpy
-.if eae-1
-052224;000000;30;070000 /mul (=mpy)
-015176;000000;30;071000 / div (=dvd)
-004500;000000;30;072000 / ash (=als)
-004500;011300;30;073000 / ashc
-.endif
-016164;000000;30;071000 /dvd
-114152;000000;07;074000 /xor
-075224;000000;15;006700 /sxt
-050572;042300;11;006400 /mark
-074432;000000;31;077000 /sob
-
-/ specials
-
-166751;076710;16;000000 /.byte
-167136;020560;20;000000 /.even
-167356;000000;21;000000 /.if
-167126;015156;22;000000 /.endif
-167244;057034;23;000000 /.globl
-170245;114440;25;000000 /.text
-167041;076450;26;000000 /.data
-166743;073300;27;000000 /.bss
-167007;051510;32;000000 /.comm
-
-usymtab:
-0;0;0;0
-
-start:
-       sys     intr; aexit
-       mov     sp,r5
-       mov     (r5)+,r0
-       cmpb    *2(r5),$'-
-       bne     1f
-       tst     (r5)+
-       dec     r0
-       br      2f
-1:
-       clr     unglob
-2:
-       movb    r0,nargs
-       mov     r5,curarg
-       jsr     r5,fcreat; a.tmp1
-       movb    r0,pof
-       jsr     r5,fcreat; a.tmp2
-       movb    r0,fbfil
-       jsr     pc,setup
-       mov     $1,r0
-       sys     write; qi; 2
-       jmp     go
-
-setup:
-       mov     $symtab,r1
-1:
-       mov     $symbol,r0
-       mov     (r1)+,(r0)+
-       beq     3f
-       mov     (r1)+,(r0)+
-       mov     (r1)+,r2
-       bic     $37,r2
-       mov     r2,(r0)+
-       mov     r1,-(sp)
-       jsr     pc,slot
-       mov     (sp)+,r1
-       mov     r1,(r0)
-       sub     $6,(r0)
-       tst     (r1)+
-       br      1b
-3:
-       rts     pc
-
-slot:
-       mov     symbol,r1
-       add     symbol+2,r1
-       add     symbol+4,r1
-       clr     r0
-       dvd     $hshsiz,r0
-       asl     r1
-       add     $hshtab,r1
-1:
-       cmp     r1,$hshtab
-       bhi     2f
-       mov     $2*hshsiz+hshtab,r1
-2:
-       mov     -(r1),r2
-       beq     3f
-       mov     $symbol,r3
-       cmp     (r2)+,(r3)+
-       bne     1b
-       cmp     (r2)+,(r3)+
-       bne     1b
-       mov     (r2)+,r0
-       bic     $37,r0
-       cmp     r0,(r3)+
-       bne     1b
-3:
-       mov     r1,r0
-       rts     pc
-
-end:
-
-symbol,r0
-       mov     (r1)+,(r0)+
-       beq     3f
-       mov     (r1)+,(r0)+
-       mov     (r1)+,r2
-       bic     $37,r2
-       mov     r2,(r0)+
-       mov     r1,-(sp)
-       jsr     pc,slot
-       mov     (sp)+,r1
-       mov     r1,(r0)
-       sub     $6,(r0)
-       tst     (r1)+
-       br      1b
-3:
-       rts     pc
-
-slot:
-       mov     symbol,r1
-       add     symbol+2,r1
-       add     symbol+4,r1
-       clr     r0
-       dvd     $hshsiz,r0
-       asl     r1
-       add     $hshtab,r1
-1:
-       cmp     r1,$hshtab
-       bhi     2f
-       mov     $2*hshsiz+hshtab,r1
-2:
-       mov     -(r1),r2
-       beq     3f
-       mov     $symbol,r3
-       cmp     (r2)+,(r3)+
-       bne     1b
-       cmp     (r
\ No newline at end of file
diff --git a/cmd/acct.s b/cmd/acct.s
deleted file mode 100644 (file)
index 8e6f1e3..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-/ acct -- time accounting
-
-.globl mesg, qsort, fopen, getw
-
-       mov     (sp)+,r5
-       tst     (sp)+
-
-1:
-       cmp     r5,$2
-       blt     1f
-       mov     (sp),r0
-       cmpb    (r0),$'-
-       bne     1f
-       cmpb    1(r0),$'d
-       bne     2f
-       inc     byday
-       dec     r5
-       tst     (sp)+
-       br      1b
-2:
-       cmpb    1(r0),$'p
-       bne     2f
-       inc     pflg
-       dec     r5
-       tst     (sp)+
-       br      1b
-2:
-       cmpb    1(r0),$'w
-       bne     1f
-       dec     r5
-       tst     (sp)+
-       cmp     r5,$2
-       blt     1b
-       dec     r5
-       mov     (sp)+,filnam
-       br      1b
-
-1:
-       dec     r5
-       mov     r5,argc
-       mov     sp,argp
-       mov     filnam,r0
-       jsr     r5,fopen; fbuf
-       bec     1f
-       jsr     r5,mesg
-               <Cannot open wtmp\n\0>; .even
-       sys     exit
-
-1:
-       setd
-
-1:
-       mov     $ibuf,r1
-2:
-       jsr     r5,getw; fbuf
-       bes     1f
-       mov     r0,(r1)+
-       cmp     r1,$ibuf+16.
-       blo     2b
-       jsr     pc,loop
-       br      1b
-1:
-       sys     time
-       mov     r0,i.time
-       mov     r1,i.time+2
-       clr     ibuf
-       mov     $'x,i.tty
-       jsr     pc,loop
-       jsr     pc,print
-       sys     exit
-
-loop:
-       clc
-       ror     i.time
-       ror     i.time+2
-       setl
-       movif   i.time,fr0
-       tst     byday
-       beq     1f
-       cmpf    midnight,fr0
-       cfcc
-       bgt     1f
-       movf    fr0,-(sp)
-       movf    midnight,fr0
-       jsr     pc,upall
-       jsr     pc,print
-       jsr     pc,clru
-       movf    (sp)+,fr0
-       jsr     pc,newday
-1:
-       movb    i.tty,r0
-       mov     $ttyf,r1
-       cmp     r0,$'x
-       bne     1f
-       jsr     pc,upall
-       jsr     pc,clrt
-       rts     pc
-1:
-       cmp     r0,(r1)
-       beq     1f
-       add     $18.,r1
-       cmp     r1,$et
-       blo     1b
-       br      2f
-1:
-       jsr     pc,update
-       clr     (r1)
-2:
-       cmp     ibuf,$"\0\0
-       bne     1f
-       rts     pc
-1:
-       mov     $ttyf,r1
-1:
-       tst     (r1)
-       beq     1f
-       add     $18.,r1
-       br      1b
-1:
-       mov     r0,(r1)+
-       mov     ibuf,(r1)+
-       mov     ibuf+2,(r1)+
-       mov     ibuf+4,(r1)+
-       mov     ibuf+6,(r1)+
-       movf    fr0,(r1)+
-       rts     pc
-
-clrt:
-       mov     $ttyf,r1
-1:
-       clr     (r1)+
-       cmp     r1,$et
-       blo     1b
-       rts     pc
-
-clru:
-       mov     $usrf,r1
-1:
-       clr     (r1)+
-       cmp     r1,$eu
-       blo     1b
-       rts     pc
-
-print:
-       jsr     pc,upall
-       mov     $usrf,r1
-       mov     r1,r2
-       mov     $16.,r3
-1:
-       tst     (r2)
-       beq     1f
-       add     r3,r2
-       br      1b
-1:
-       jsr     pc,qsort
-       clrf    fr0
-       jsr     r5,select; 1f
-       tstf    fr0
-       cfcc
-       beq     3f
-       jsr     pc,pdate
-       mov     $total,r2
-       jsr     pc,ptime
-       tst     pflg
-       beq     3f
-       jsr     r5,select; 2f
-3:
-       rts     pc
-
-1:
-       addf    8(r2),fr0
-       rts     pc
-
-2:
-       movf    8(r2),fr0
-       jsr     pc,pblank
-       jsr     pc,ptime
-       rts     pc
-
-pdate:
-       tst     byday
-       bne     1f
-       rts     pc
-1:
-       mov     r2,-(sp)
-       movf    fr0,-(sp)
-       movf    midnight,fr0
-       divf    day,fr0
-       seti
-       movfi   fr0,r0
-       mov     $montab,r1
-1:
-       sub     (r1)+,r0
-       bgt     1b
-       add     -(r1),r0
-       cmp     r1,$montab+24.
-       blt     1f
-       sub     $24.,r1
-1:
-       sub     $montab,r1
-       mov     r1,-(sp)
-       asr     r1
-       add     (sp)+,r1
-       add     $monasc,r1
-       mov     $obuf,r2
-       movb    (r1)+,(r2)+
-       movb    (r1)+,(r2)+
-       movb    (r1)+,(r2)+
-       movb    $' ,(r2)+
-       mov     r0,r1
-       clr     r0
-       dvd     $10.,r0
-       tst     r0
-       beq     1f
-       add     $'0,r0
-       movb    r0,(r2)+
-1:
-       add     $'0,r1
-       movb    r1,(r2)+
-       movb    $'\t,(r2)+
-       sub     $obuf,r2
-       mov     r2,0f
-       mov     $1,r0
-       sys     write; obuf; 0:..
-       movf    (sp)+,fr0
-       mov     (sp)+,r2
-       rts     pc
-
-pblank:
-       tst     byday
-       beq     1f
-       mov     $1,r0
-       sys     write; blank; 1
-1:
-       rts     pc
-
-upall:
-       mov     $ttyf,r1
-1:
-       mov     (r1),r0
-       beq     1f
-       jsr     pc,update
-       add     $18.,r1
-       br      1b
-1:
-       rts     pc
-
-update:
-       mov     r1,-(sp)
-       mov     $usrf,r2
-1:
-       mov     (sp),r1
-       tst     (r1)+
-       tst     (r2)
-       beq     1f
-       cmp     (r1)+,(r2)
-       bne     2f
-       cmp     (r1)+,2(r2)
-       bne     2f
-       cmp     (r1)+,4(r2)
-       bne     2f
-       cmp     (r1)+,6(r2)
-       beq     1f
-2:
-       add     $16.,r2
-       br      1b
-1:
-       mov     (sp),r1
-       tst     (r1)+
-       mov     (r1)+,(r2)+
-       mov     (r1)+,(r2)+
-       mov     (r1)+,(r2)+
-       mov     (r1)+,(r2)+
-       movf    fr0,fr1
-       subf    (r1),fr1
-       cfcc
-       blt     1f
-       cmpf    maxpd,fr1
-       cfcc
-       blt     1f
-       addf    (r2),fr1
-       movf    fr1,(r2)+
-1:
-       movf    fr0,(r1)+
-       mov     (sp)+,r1
-       rts     pc
-
-newday:
-       movf    midnight,fr1
-1:
-       cmpf    fr0,fr1
-       cfcc
-       blt     1f
-       addf    day,fr1
-       br      1b
-1:
-       movf    fr1,midnight
-       rts     pc
-
-select:
-       mov     $usrf,r2
-1:
-       tst     (r2)
-       beq     1f
-       mov     argc,r1
-       beq     2f
-       mov     argp,r3
-3:
-       mov     r2,r0
-       mov     (r3)+,r4
-4:
-       cmpb    (r0)+,(r4)+
-       beq     4b
-       tstb    -(r4)
-       bne     4f
-       cmpb    -(r0),$' /
-       beq     2f
-4:
-       sob     r1,3b
-       br      3f
-2:
-       jsr     pc,*(r5)
-3:
-       add     $16.,r2
-       br      1b
-1:
-       tst     (r5)+
-       rts     r5
-
-ptime:
-       mov     $obuf,r1
-       mov     r2,r0
-1:
-       movb    (r0)+,(r1)
-       cmpb    (r1)+,$' /
-       bne     1b
-       movb    $'\t,-1(r1)
-       mov     r1,-(sp)
-       seti
-       divf    thous,fr0
-       jsr     pc,digit
-       jsr     pc,digit
-       jsr     pc,digit
-       jsr     pc,digit
-       movb    $':,(r1)+
-       mulf    sixth,fr0
-       jsr     pc,digit
-       jsr     pc,digit
-       movb    $'\n,(r1)+
-       sub     $obuf,r1
-       mov     r1,0f
-       mov     (sp)+,r1
-1:
-       cmpb    (r1),$'0
-       bne     1f
-       movb    $' ,(r1)+
-       br      1b
-1:
-       cmpb    (r1),$':
-       bne     1f
-       movb    $'0,-(r1)
-1:
-       mov     $1,r0
-       sys     write; obuf; 0:..
-       rts     pc
-
-digit:
-       modf    ten,fr0
-       movfi   fr1,r0
-       add     $'0,r0
-       movb    r0,(r1)+
-       rts     pc
-
-filnam:        wtmp
-montab:
-       31.; 28.; 31.; 30.; 31.; 30.; 31.; 31.; 30.; 31.; 30.; 31.
-       31.; 29.; 31.; 30.; 31.; 30.; 31.; 31.; 30.; 31.; 30.; 31.
-monasc:
-       <Jan>
-       <Feb>
-       <Mar>
-       <Apr>
-       <May>
-       <Jun>
-       <Jul>
-       <Aug>
-       <Sep>
-       <Oct>
-       <Nov>
-       <Dec>
-day:   45436;32000;0;0
-thous: 47600;137374;0;0
-maxpd: 45636;032001;0;0
-sixth: 40031;114631;114631;114631
-ten:   41040;0;0;0
-total: <total   >
-blank: <       >
-wtmp:  </usr/adm/wtmp\0>
-.even
-.bss
-midnight:.=.+8.
-byday: .=.+2
-argc:  .=.+2
-argp:  .=.+2
-ibuf:  .=.+16.
-fbuf:  .=.+520.
-i.tty  = ibuf+8.
-i.time = ibuf+10.
-fi:    .=.+2
-ttyf:  .=.+[20.*18.]; et:
-usrf:  .=.+[200.*16.]; eu:
-obuf:  .=.+20.
-pflg:  .=.+2
-0.; 31.; 31.; 30.; 31.; 30.; 31.
-monasc:
-       <Jan>
-       <Feb>
-       <Mar>
-       <Apr>
-       <May>
-       <Jun>
-       <Jul>
-       <Aug>
-       <Sep
\ No newline at end of file
diff --git a/cmd/ar.s b/cmd/ar.s
deleted file mode 100644 (file)
index 6e33ccd..0000000
--- a/cmd/ar.s
+++ /dev/null
@@ -1,1988 +0,0 @@
-/ ar -- archive/library
-
-       mov     (sp)+,r0
-       sub     $2,r0
-       ble     userr
-       tst     (sp)+
-       mov     (sp)+,r1
-       clr     r2
-1:
-       tstb    (r1)
-       beq     1f
-       cmpb    (r1),$'v
-       bne     2f
-       inc     r1
-       incb    vflg
-       br      1b
-2:
-       tst     r2
-       bne     userr
-       movb    (r1)+,r2
-       br      1b
-1:
-       tst     r2
-       beq     userr
-       mov     $arglst,r1
-1:
-       mov     (sp)+,(r1)+
-       dec     r0
-       bgt     1b
-       clr     (r1)+
-       mov     $swlst,r1
-1:
-       cmp     r2,(r1)+
-       beq     1f
-       tst     (r1)+
-       bne     1b
-       br      userr
-1:
-       jmp     *(r1)
-
-swlst:
-       'r; comr
-       'u; comu
-       'd; comd
-       'x; comx
-       't; comt
-        0; 0
-
-userr:
-       jsr     r5,diag
-               <bad usage\n\0>
-       .even
-
-putc:
-       movb    r0,ch
-       mov     $1,r0
-       sys     write; ch; 1
-       rts     r5
-
-print:
-       movb    (r1)+,r0
-       beq     1f
-       jsr     r5,putc
-       br      print
-1:
-       rts     r5
-
-diag:
-       mov     r5,r1
-       jsr     r5,print
-       tst     tfo
-       beq     1f
-       sys     unlink; tfil
-1:
-       sys     exit
-
-getaf:
-       mov     arglst,0f
-       sys     open; 0:..; 0
-       bes     1f
-       mov     r0,afi
-       sys     read; buf; 2
-       cmp     buf,magic
-       bne     magerr
-       tst     (r5)+
-1:
-       rts     r5
-
-magerr:
-       mov     arglst,r1
-       jsr     r5,print
-       jsr     r5,diag
-               < -- not in archive format\n\0>
-       .even
-
-mktmp:
-       sys     stat; tfil; buf
-       bes     1f
-       incb    tfil+8
-       cmpb    tfil+8,$'z
-       blo     mktmp
-       br      tferr
-1:
-       sys     intr; done
-       sys     creat; tfil; 14
-       bes     tferr
-       mov     r0,tfo
-       sys     open; tfil; 0
-       bes     tferr
-       mov     r0,tfi
-       rts     r5
-
-tferr:
-       jsr     r5,diag
-               <cannot open temp file\n\0>
-       .even
-
-getdir:
-       mov     afi,r0
-       sys     read; dir; 16.
-       cmp     r0,$16.
-       bne     1f
-       jsr     r5,mvname
-       tst     (r5)+
-1:
-       rts     r5
-
-mvname:
-       mov     name,rname
-       mov     name+2,rname+2
-       mov     name+4,rname+4
-       mov     name+6,rname+6
-       rts     r5
-
-skip:
-       mov     size,r0
-       inc     r0
-       bic     $1,r0
-       mov     r0,0f
-       mov     afi,r0
-       sys     seek; 0:..; 1
-       rts     r5
-
-trim:
-       mov     r0,r2
-1:
-       tstb    (r0)
-       beq     1f
-       cmpb    (r0)+,$'/
-       beq     trim
-       br      1b
-1:
-       rts     r5
-
-match:
-       mov     $arglst+2,r1
-1:
-       mov     (r1)+,r0
-       beq     1f
-       blt     1b
-       jsr     r5,trim
-       mov     $name,r0
-2:
-       cmp     r0,$name+8.
-       beq     2f
-       cmpb    (r0),(r2)+
-       bne     1b
-       tstb    (r0)+
-       bne     2b
-2:
-       cmp     (r5)+,-(r1)
-1:
-       rts     r5
-
-mvfil:
-       mov     (r1),9f
-       mov     (r1),0f
-       sys     stat; 0:..; buf
-       bes     operr
-       sys     open; 9:..; 0
-       bes     operr
-       mov     r0,fio
-       mov     (r1),r0
-       mov     $-1,(r1)
-       jsr     r5,trim
-       mov     $name,r0
-1:
-       cmp     r0,$name+8.
-       beq     1f
-       movb    (r2)+,(r0)+
-       bne     1b
-1:
-       mov     buf+28.,mtim
-       mov     buf+30.,mtim+2
-       movb    buf+5,ouid
-       movb    buf+2,mode
-       mov     buf+6,size
-       mov     tfo,r0
-       sys     write; dir; 16.
-       mov     size,r2
-1:
-       mov     fio,r0
-       sys     read; buf; 512.
-       sub     r0,r2
-       mov     r0,0f
-       beq     1f
-       mov     tfo,r0
-       sys     write; buf; 0:..
-       br      1b
-1:
-       tst     r2
-       bne     phserr
-       bit     $1,size
-       beq     1f
-       mov     tfo,r0
-       sys     seek; 1; 1
-1:
-       mov     fio,r0
-       sys     close
-       jsr     r5,mvname
-       rts     r5
-
-operr:
-       mov     9b,r1
-       jsr     r5,print
-       jsr     r5,diag
-               < -- cannot open\n\0>
-       .even
-
-phserr:
-       mov     9b,r1
-       jsr     r5,print
-       jsr     r5,diag
-               < -- phase error\n\0>
-       .even
-
-copyfl:
-       mov     tfo,r0
-       sys     write; dir; 16.
-       mov     size,r1
-       mov     $rname,9b
-1:
-       mov     r1,0f
-       beq     1f
-       cmp     r1,$512.
-       blo     2f
-       mov     $512.,0f
-2:
-       mov     afi,r0
-       sys     read; buf; 0:..
-       sub     r0,r1
-       mov     r0,0f
-       beq     phserr
-       mov     tfo,r0
-       sys     write; buf; 0:..
-       br      1b
-1:
-       bit     $1,size
-       beq     1f
-       mov     afi,r0
-       sys     seek; 1; 1
-       mov     tfo,r0
-       sys     seek; 1; 1
-1:
-       rts     r5
-
-xtract:
-       movb    mode,0f
-       sys     creat; rname; 0:..
-       bes     noxerr
-       mov     r0,fio
-       mov     size,r1
-       mov     $rname,9b
-1:
-       mov     r1,0f
-       beq     1f
-       cmp     r1,$512.
-       blo     2f
-       mov     $512.,0f
-2:
-       mov     afi,r0
-       sys     read; buf; 0:..
-       sub     r0,r1
-       mov     r0,0f
-       beq     phserr
-       mov     fio,r0
-       sys     write; buf; 0:..
-       br      1b
-1:
-       mov     fio,r0
-       sys     close
-       bit     $1,size
-       beq     1f
-       mov     afi,r0
-       sys     seek; 1; 1
-1:
-       mov     r0,-(sp)
-       mov     r1,-(sp)
-       mov     mtim+2,r1
-       mov     mtim,r0
-       sys     mdate
-       mov     (sp)+,r1
-       mov     (sp)+,r1
-       rts     r5
-
-noxerr:
-       mov     $rname,r1
-       jsr     r5,print
-       jsr     r5,diag
-               < -- cannot create\n\0>
-       .even
-
-table:
-       mov     $rname,r1
-       jsr     r5,print
-       mov     $'\n,r0
-       jsr     r5,putc
-       rts     r5
-
-mesg:
-       mov     r1,-(sp)
-       mov     (r5)+,r0
-       tstb    vflg
-       beq     1f
-       jsr     r5,putc
-       mov     $' ,r0
-       jsr     r5,putc
-       mov     $rname,r1
-       jsr     r5,print
-       mov     $'\n,r0
-       jsr     r5,putc
-1:
-       mov     (sp)+,r1
-       rts     r5
-
-oldnew:
-       sys     stat; rname; buf
-       bes     1f
-       cmp     buf+28.,mtim
-       blo     1f
-       bhi     2f
-       cmp     buf+30.,mtim+2
-       blos    1f
-2:
-       tst     (r5)+
-       mov     $rname,tname
-       mov     $tname,r1
-1:
-       rts     r5
-
-comr:
-       jsr     r5,mktmp
-       jsr     r5,getaf
-               br copfl
-1:
-       jsr     r5,getdir
-               br copfl
-       jsr     r5,match
-               br 2f
-       jsr     r5,mesg; 'r
-       jsr     r5,skip
-       jsr     r5,mvfil
-       br      1b
-2:
-       jsr     r5,copyfl
-       jsr     r5,mesg; 'c
-       br      1b
-
-comu:
-       jsr     r5,mktmp
-       jsr     r5,getaf
-               br noaf
-1:
-       jsr     r5,getdir
-               br copfl
-       tst     arglst+2
-       beq     2f
-       jsr     r5,match
-               br 3f
-       mov     $-1,(r1)
-2:
-       jsr     r5,oldnew
-               br 3f
-       jsr     r5,mesg; 'r
-       jsr     r5,skip
-       jsr     r5,mvfil
-       br      1b
-3:
-       jsr     r5,copyfl
-       jsr     r5,mesg; 'c
-       br      1b
-
-comd:
-       jsr     r5,mktmp
-       jsr     r5,getaf
-               br noaf
-1:
-       jsr     r5,getdir
-               br 1f
-       jsr     r5,match
-               br 2f
-       mov     $-1,(r1)
-       jsr     r5,skip
-       jsr     r5,mesg; 'd
-       br      1b
-2:
-       jsr     r5,copyfl
-       jsr     r5,mesg; 'c
-       br      1b
-1:
-       jsr     r5,nfound
-       br      copfl
-
-noaf:
-       jsr     r5,diag
-               <no archive file\n\0>
-       .even
-
-crterr:
-       jsr     r5,diag
-               <cannot create archive file\n\0>
-       .even
-
-copfl:
-       mov     $arglst,r1
-       mov     (r1)+,0f
-1:
-       tst     (r1)+
-       beq     1f
-       blt     1b
-       tst     -(r1)
-       jsr     r5,mvfil
-       jsr     r5,mesg; 'a
-       br      1b
-1:
-       sys     intr; 0 / no interrups during copy back
-       sys     creat; 0:..; 17
-       bes     crterr
-       mov     r0,afo
-       sys     write; magic; 2
-1:
-       mov     tfi,r0
-       sys     read; buf; 512.
-       mov     r0,0f
-       beq     done
-       mov     afo,r0
-       sys     write; buf; 0:..
-       br      1b
-
-done:
-       jsr     r5,diag
-               <\0>
-       .even
-
-comx:
-       jsr     r5,getaf
-               br noaf
-1:
-       jsr     r5,getdir
-               br 1f
-       tst     arglst+2
-       beq     3f
-       jsr     r5,match
-               br 2f
-3:
-       mov     $-1,(r1)
-       jsr     r5,xtract
-       jsr     r5,mesg; 'x
-       br      1b
-2:
-       jsr     r5,skip
-       br      1b
-1:
-       jsr     r5,nfound
-       br      done
-
-comt:
-       jsr     r5,getaf
-               br noaf
-1:
-       jsr     r5,getdir
-               br 1f
-       tst     arglst+2
-       beq     2f
-       jsr     r5,match
-               br 3f
-       mov     $-1,(r1)
-2:
-       jsr     r5,table
-3:
-       jsr     r5,skip
-       br      1b
-1:
-       jsr     r5,nfound
-       br      done
-
-nfound:
-       mov     $arglst+2,r2
-1:
-       mov     (r2)+,r1
-       beq     1f
-       blt     1b
-       mov     $-1,-(r2)
-       jsr     r5,print
-       mov     $notfnd,r1
-       jsr     r5,print
-       br      1b
-1:
-       rts     r5
-
-notfnd:
-       < -- not found\n\0>
-       .even
-
-tfil:  </tmp/vtma\0>
-       .even
-magic: -147.
-
-       .bss
-
-afi:   .=.+2
-afo:   .=.+2
-tfi:   .=.+2
-tfo:   .=.+2
-fio:   .=.+2
-rname: .=.+9.
-ch:    .=.+1
-vflg:  .=.+1
-       .even
-tname: .=.+2
-dir:
-       name: .=.+8.
-       mtim: .=.+4
-       ouid: .=.+1
-       mode: .=.+1
-       size: .=.+2
-arglst:        .=.+200.
-buf:   .=.+512.
-
--1,(r1)
-2:
-       jsr     r5,table
-3:
-       jsr     r5,skip
-       br      1b
-1:
-       jsr     r5,nfound
-       br      done
-
-nfound:
-       mov     $arglst+2,r2
-1:
-       mov     (r2)+,r1
-       beq     1f
-       blt     1b
-       mov     $-1,-(r2)
-       jsr     r5,print
-       mov     $notfnd,r1
-       jsr     r5,print
-       br      1b
-1:
-       rts     r5
-
-notfnd:
-       < -- not found\n\0>
-       .even
-
-tfil:  </tmp/vtma\0>
-       .even
-magic: -147.
-
-       .bss
-
-afi:   .=.+2
-afo:   .=.+2
-tfi:   .=.+2
-tfo:   .=.+2
-fio:   .=.+2
-rname: .=.+9.
-ch:    .=.+1
-vflg:  .=.+1
-       .even
-tname: .=.+2
-dir:
-       name: .=.+8.
-       mtim: .=.+4
-       ouid: .=.+1
-       mode.globl      getchar
-.globl lookchar
-.globl fsfile
-.globl seekchar
-.globl backspace
-.globl putchar
-.globl alterchar
-.globl move
-.globl rewind
-.globl create
-.globl zero
-.globl allocate
-.globl release
-.globl collect
-.globl w, r, a, l
-/
-       cmp     (sp)+,$2
-       blo     1f
-       tst     (sp)+
-       mov     (sp)+,0f
-       sys     open; 0:.=.+2; 0
-       bec     2f
-       mov     $1,r0
-       sys     write; 4f; 5f-4f
-       sys     exit
-/
-4:     <Input file.\n>
-5:     .even
-/
-2:
-       mov     r0,source
-1:
-       sys     intr; case177
-       clr     delflag
-       mov     $pdl,r5
-/
-       clr     r0
-       jsr     pc,allocate
-       mov     r1,basptr
-       mov     $10.,r0
-       jsr     pc,putchar
-       mov     $1,r0
-       jsr     pc,allocate
-       mov     r1,inbas
-       mov     $10.,r0
-       jsr     pc,putchar
-       mov     $1,r0
-       jsr     pc,allocate
-       mov     $10.,r0
-       jsr     pc,putchar
-       mov     r1,tenptr
-       clr     r0
-       jsr     pc,allocate
-       mov     r1,chptr
-       clr     r0
-       jsr     pc,allocate
-       mov     r1,strptr
-       clr     r0
-       jsr     pc,allocate
-       mov     $1,r0
-       jsr     pc,putchar
-       mov     r1,kptr
-       mov     $1,r0
-       jsr     pc,allocate
-       mov     $2,r0
-       jsr     pc,putchar
-       mov     r1,sqtemp
-       clr     r0
-       jsr     pc,allocate
-       mov     r1,divxyz
-loop:
-       tst     delflag
-       bne     in177
-       mov     sp,errstack
-       jsr     pc,readc
-       mov     $casetab,r1
-1:     tst     (r1)+
-       beq     2f
-       cmp     r0,(r1)+
-       bne     1b
-       jmp     *-4(r1)
-2:     jmp     eh
-/
-/
-/      case for new line (which is special for apl box)
-/
-case012:
-       br      loop
-/
-/
-/      case q for quit
-/
-case161:
-       cmp     readptr,$readstack+2
-       blos    1f
-       mov     *readptr,r1
-       beq     2f
-       jsr     pc,release
-2:
-       sub     $2,readptr
-       mov     *readptr,r1
-       beq     2f
-       jsr     pc,release
-2:
-       sub     $2,readptr
-       jmp     loop
-1:
-       sys     exit
-/
-/
-/      case of delete character
-/
-case177:
-       mov     $1,delflag
-       mov     r0,-(sp)
-       mov     2(sp),r0
-       cmp     -6(r0),$sys+read
-       bne     1f
-       sub     $6,2(sp)
-       clr     delflag
-1:
-       mov     (sp)+,r0
-       2                       /rti
-/
-in177:
-       mov     $' ,ch
-       mov     $1,r0
-       sys     write; 1f; 1
-       clr delflag
-       jmp     eh
-/
-delflag: .=.+2
-1:     <\n>
-       .even
-/
-/
-/      case digit
-/
-case060:
-       movb    r0,savec
-       jsr     pc,readin
-       jsr     pc,push
-       br      loop
-/
-/
-/      case _ for negative numbers
-/
-case137:
-       jsr     pc,readin
-       jsr     pc,chsign
-       jsr     pc,push
-       br      loop
-/
-/
-/      case screamer
-/
-case041:
-       jsr     pc,in041
-       br      loop
-/
-in041:
-       sys     fork
-               br      9f
-       sys     wait
-       mov     $1,r0
-       sys     write; screamer; 2
-       rts     pc
-9:     sys     exec; 7f; 8f
-       4
-8:     7f; 0
-7:     </etc/msh\0>
-screamer: <!\n>
-       .even
-/
-/
-/      case d for duplicate
-/
-case144:
-       cmp     r5,$pdl
-       bne 9f; jmp eh; 9:
-       clr     r0
-       jsr     pc,allocate
-       mov     -2(r5),r0
-       jsr     pc,move
-       jsr     pc,push
-       br      loop
-/
-/
-/      case z for stack size
-/
-case172:
-       clr     r0
-       jsr     pc,allocate
-       mov     r5,r3
-       sub     $pdl,r3
-       asr     r3
-2:
-       beq     2f
-       clr     r2
-       dvd     $100.,r2
-       mov     r3,r0
-       jsr     pc,putchar
-       mov     r2,r3
-       br      2b
-2:
-       jsr     pc,push
-       jmp     loop
-/
-/
-/      case c for flush
-/
-case143:
-2:     jsr     pc,pop
-       bec 9f; jmp loop; 9:
-       jsr     pc,release
-       br      2b
-/
-/      case s for save
-/
-case163:
-       jsr     pc,readc
-       cmp     r5,$pdl
-       bne     2f
-       movb    $'s,ch
-       jmp     eh
-2:
-       cmpb    r0,$128.
-       blo 9f; jmp err; 9:
-       asl     r0
-       mov     stable(r0),r1
-       beq     2f
-       jsr     pc,release
-2:
-       jsr     pc,pop
-       mov     r1,stable(r0)
-       jmp     loop
-/
-/
-/      case l for load
-/
-case154:
-       jsr     pc,in154
-       jmp     loop
-/
-in154:
-       jsr     pc,readc
-       cmp     r0,$128.
-       blo 9f; jmp err; 9:
-       asl     r0
-       mov     stable(r0),r1
-       beq     1f
-       mov     r1,-(sp)
-       jsr     pc,length
-       jsr     pc,allocate
-       mov     (sp)+,r0
-       jsr     pc,move
-       jsr     pc,push
-       rts     pc
-1:
-       clr     r0
-       jsr     pc,allocate
-       jsr     pc,push
-       rts     pc
-/
-/
-/      case - for subtract
-/
-case055:
-       jsr     pc,in055
-       jmp     loop
-/
-in055:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       jsr     pc,chsign
-       jsr     pc,push
-       br      in053
-/
-/
-/      case + for add
-/
-case053:
-       jsr     pc,in053
-       jmp     loop
-/
-in053:
-       mov     $add3,r0
-       jsr     pc,binop
-       rts     pc
-/
-/
-/      case * for multiply
-/
-case052:
-       mov     $mul3,r0
-       jsr     pc,binop
-       tst     k
-       beq     1f
-       jsr     pc,pop
-       mov     r1,r3
-       mov     kptr,r2
-       jsr     pc,div3
-       jsr     pc,push
-       mov     r3,r1
-       jsr     pc,release
-       mov     r4,r1
-       jsr     pc,release
-1:     jmp     loop
-/
-/      case / for divide
-/
-case057:
-       mov     $1f,r0
-       jsr     pc,binop
-       mov     r4,r1
-       jsr     pc,release
-       jmp     loop
-1:
-       tst     k
-       beq     1f
-       mov     r2,-(sp)
-       mov     kptr,r2
-       jsr     pc,mul3
-       mov     r1,-(sp)
-       mov     r3,r1
-       jsr     pc,release
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-1:     jsr     pc,div3
-       rts     pc
-/
-/
-/      case % for remaindering
-/
-case045:
-       mov     $div3,r0
-       jsr     pc,binop
-       jsr     pc,pop
-       jsr     pc,release
-       mov     r4,r1
-       jsr     pc,push
-       jmp     loop
-/
-/
-binop:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,r2
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,r3
-       jsr     pc,(r0)
-       jsr     pc,push
-       mov     r2,r1
-       jsr     pc,release
-       mov     r3,r1
-       jsr     pc,release
-       rts     pc
-/
-/
-/      case i for input base
-/
-case151:
-       jsr     pc,in151
-       jmp     loop
-/
-in151:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,-(sp)
-       mov     inbas,r1
-       mov     (sp)+,inbas
-       jsr     pc,release
-       rts     pc
-/
-inbas: .=.+2
-/
-/
-/      case o for output base
-/
-case157:
-       jsr     pc,in157
-       jmp     loop
-/
-in157:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,-(sp)
-       mov     basptr,r1
-       jsr     pc,release
-       mov     (sp),basptr
-/
-/      set field widths for output
-/      and set output digit handling routines
-/
-       mov     (sp),r1
-       mov     $bigout,outdit
-       jsr     pc,length
-       cmp     r0,$1.
-       bne     2f
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       cmp     r0,$16.
-       bhi     2f
-       mov     $hexout,outdit
-2:
-       jsr     pc,length
-       jsr     pc,allocate
-       mov     (sp),r0
-       jsr     pc,move
-       clr     (sp)
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       bpl     2f
-       add     $1.,(sp)
-       jsr     pc,chsign
-2:
-       mov     r1,r2
-       mov     $1,r0
-       jsr     pc,allocate
-       mov     $-1,r0
-       jsr     pc,putchar
-       mov     r1,r3
-       jsr     pc,add3
-       jsr     pc,length
-       asl     r0
-       add     r0,(sp)
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       cmp     r0,$9.
-       blos    2f
-       add     $1,(sp)
-2:
-       jsr     pc,release
-       mov     r2,r1
-       jsr     pc,release
-       mov     r3,r1
-       jsr     pc,release
-       mov     (sp)+,fw
-       cmp     outdit,$hexout
-       bne     2f
-       mov     $1,fw
-2:
-       mov     $60.,ll
-       cmp     fw,$60.
-       blo 9f; rts pc; 9:
-       mov     $60.,r1
-       clr     r0
-       dvd     fw,r0
-       mov     r0,r1
-       mpy     fw,r1
-       mov     r1,ll
-       rts     pc
-/
-fw:    1                       /field width for digits
-ll:    60.                     /line length
-/
-/
-/      case k for skale factor
-/
-case153:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     w(r1),r0
-       sub     a(r1),r0
-       cmp     r0,$1
-       blos 9f; jmp eh; 9:
-       jsr     pc,rewind
-       jsr     pc,getchar
-       bpl 9f; jmp eh; 9:
-       mov     r0,k
-       mov     r0,r2
-       jsr     pc,release
-       mov     kptr,r1
-       jsr     pc,create
-       clr     r0
-2:     cmp     r2,$2
-       blo     2f
-       jsr     pc,putchar
-       sub     $2,r2
-       br      2b
-2:     mov     $1,r0
-       cmp     r2,$1
-       blo     2f
-       mov     $10.,r0
-2:     jsr     pc,putchar
-1:     jmp     loop
-/
-/
-/      case ^ for exponentiation
-/
-case136:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,r3
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,r2
-       jsr     pc,exp3
-       jsr     pc,push
-       mov     r2,r1
-       jsr     pc,release
-       mov     r3,r1
-       jsr     pc,release
-       jmp     loop
-/
-/
-/      case v for square root
-/
-case166:
-       jsr     pc,pop
-       bec     9f; jmp eh; 9:
-/
-/      multiply argument by skale factor
-/
-       mov     r1,r2
-       mov     kptr,r3
-       jsr     pc,mul3
-       mov     r1,r3
-       mov     r2,r1
-       jsr     pc,release
-/
-/      check for zero or negative
-/
-       mov     w(r3),r2
-       sub     a(r3),r2
-       tst     r2
-       bne 9f; jmp sqz; 9:
-/
-/      look at the top one or two digits
-/
-       mov     r3,r1
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       mov     r0,r4
-       bpl 9f; jmp eh; 9:
-       bit     $1,r2
-       bne     2f
-       mov     r4,r1
-       mul     $100.,r1
-       mov     r1,r4
-       mov     r3,r1
-       jsr     pc,backspace
-       add     r0,r4
-2:
-/
-/      allocate space for result
-/
-       inc     r2
-       asr     r2
-       mov     r2,r0
-       jsr     pc,allocate
-       jsr     pc,zero
-       mov     r2,r0
-       jsr     pc,seekchar
-       mov     r1,r2
-/
-/      get high order digit of arg and square root it
-/
-       mov     $1,r0
-2:     sub     r0,r4
-       blt     2f
-       add     $2,r0
-       br      2b
-2:     inc     r0
-       asr     r0
-       mov     r0,r4
-       mov     r2,r1
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       mov     r4,r0
-       jsr     pc,alterchar
-       mov     r1,-(sp)
-       mov     r3,-(sp)
-/
-/      get successive approx. from Newton
-/
-1:     mov     (sp),r3         /arg
-       mov     2(sp),r2        /approx
-       jsr     pc,div3
-       mov     r1,r3
-       jsr     pc,add3
-       mov     r1,-(sp)
-       mov     r3,r1
-       jsr     pc,release
-       mov     r4,r1
-       jsr     pc,release
-       mov     (sp)+,r1
-       mov     sqtemp,r2
-       mov     r1,r3
-       jsr     pc,div3
-       mov     r1,-(sp)
-       mov     r3,r1
-       jsr     pc,release
-       mov     r4,r1
-       jsr     pc,release
-       mov     (sp)+,r3
-       mov     2(sp),r1
-       jsr     pc,length
-       jsr     pc,allocate
-       mov     2(sp),r0
-       jsr     pc,move
-       jsr     pc,chsign
-       mov     r1,r2
-       jsr     pc,add3
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       jsr     pc,release
-       mov     r2,r1
-       jsr     pc,release
-       tst     r0
-       bpl     2f
-/
-/      loop if new < old
-/
-       mov     2(sp),r1
-       jsr     pc,release
-       mov     r3,2(sp)
-       br      1b
-/
-2:
-       mov     r3,r1
-       jsr     pc,release
-       mov     2(sp),r1
-       jsr     pc,push
-       mov     (sp),r1
-       jsr     pc,release
-       tst     (sp)+
-       tst     (sp)+
-       jmp     loop
-/
-sqz:   clr     r0
-       jsr     pc,allocate
-       jsr     pc,push
-       mov     r3,r1
-       jsr     pc,release
-       jmp     loop
-sqtemp:        .=.+2
-/
-/
-/      case [ for subroutine definition
-/
-case133:
-       clr     -(sp)
-       clr     r0
-       jsr     pc,allocate
-       jsr     pc,push
-1:     jsr     pc,readc
-       cmp     r0,$']
-       bne     3f
-       tst     (sp)
-       beq     1f
-       dec     (sp)
-       br      2f
-3:
-       cmp     r0,$'[
-       bne     2f
-       inc     (sp)
-2:
-       jsr     pc,putchar
-       br      1b
-/
-1:     tst     (sp)+
-       jmp     loop
-/
-/
-/      case x for execute top of stack
-/
-case170:
-       jsr     pc,in170
-       jmp     loop
-/
-in170:
-       jsr     pc,pop
-       bec 9f; jmp eh; 9:
-       mov     r1,-(sp)
-       tst     *readptr
-       beq     1f
-       mov     *readptr,r1
-       cmp     r(r1),w(r1)
-       bne     1f
-       jsr     pc,release
-       br      2f
-1:
-       add     $2,readptr
-       cmp     readptr,$readtop
-       bhis    1f
-2:     mov     (sp)+,r1
-       mov     r1,*readptr
-       beq     2f
-       jsr     pc,rewind
-       rts     pc
-2:
-       jsr     pc,readc
-       cmp     r0,$'\n
-       beq     3f
-       mov     r0,savec
-3:
-       rts     pc
-1:
-nderr:
-       mov     $1,r0
-       sys     write; 1f; 2f-1f
-       sys     exit
-1:     <Nesting depth.\n>
-2:     .even
-/
-readptr: readstack
-       .bss
-readstack: .=.+100.
-readtop:
-       .text
-/
-/      case ? for apl box function
-/
-case077:
-       add     $2,readptr
-       cmp     readptr,$readtop
-       bhis    nderr
-       clr     *readptr
-in077:
-       mov     source,-(sp)
-       clr     source
-       jsr     pc,readc
-       cmp     r0,$'!
-       bne     1f
-       jsr     pc,in041
-       mov     (sp)+,source
-       br      in077
-1:
-       mov     r0,savec
-       clr     r0
-       jsr     pc,allocate
-       jsr     pc,readc
-       jsr     pc,putchar
-1:
-       jsr     pc,readc
-       jsr     pc,putchar
-       cmp     r0,$'\n
-       bne     1b
-       mov     (sp)+,source
-       mov     r1,*readptr
-       jmp     loop
-/
-/
-/      case < for conditional execution
-/
-case074:
-       jsr     pc,in055        /go subtract
-       jsr     pc,pop
-       jsr     pc,length
-       tst     r0
-       beq     1f
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       tst     r0
-       bmi     1f
-       jsr     pc,release
-       jsr     pc,in154        /load from register
-       br      case170
-/
-1:
-       jsr     pc,release
-       jsr     pc,readc
-       jmp     loop
-/
-/
-/      case = for conditional execution
-/
-case075:
-       jsr     pc,in055        /go subtract
-       jsr     pc,pop
-       jsr     pc,length
-       tst     r0
-       beq     1f      /is zero
-       jsr     pc,release
-       jsr     pc,readc
-       jmp     loop
-1:
-       jsr     pc,release
-       jsr     pc,in154        /load from register
-       jmp     case170         /go to execute code
-/
-/
-/      case > for conditional execution
-/
-case076:
-       jsr     pc,in055        /go subtract
-       jsr     pc,pop
-       jsr     pc,length
-       tst     r0
-       beq     1f
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       tst     r0
-       bpl     1f
-       jsr     pc,release
-       jsr     pc,in154        /load from register
-       jmp     case170         /go to execute code
-1:
-       jsr     pc,release
-       jsr     pc,readc
-       jmp     loop
-err:   4
-/
-eh:
-       movb    ch,1f+2
-       mov     $1,r0
-       sys     write; 1f; 2f-1f
-       mov     $readstack,readptr
-       mov     errstack,sp
-       jmp     loop
-1:     <(  ) ?\n>
-2:     .even
-/
-/
-/      routine to read and convert a number from the
-/      input stream.  Numbers beginnig with 0 are
-/      converted as octal.  Routine converts
-/      up to next nonnumeric.
-/
-/
-readin:
-       clr     r0
-       jsr     pc,allocate
-       mov     r1,-(sp)
-       mov     strptr,r1
-       jsr     pc,create
-       jsr     pc,readc
-1:
-       cmpb    ch,$'0
-       blt     1f
-       cmpb    ch,$'9
-       bgt     1f
-       mov     ch,r0
-       sub     $'0,r0
-       mov     chptr,r1
-       jsr     pc,create
-       tst     r0
-       beq     2f
-       jsr     pc,putchar
-2:     mov     r1,chptr
-       mov     (sp),r3
-       mov     inbas,r2
-       jsr     pc,mul3
-       mov     r1,(sp)
-       mov     r3,r1
-       jsr     pc,release
-       mov     (sp),r3
-       mov     chptr,r2
-       jsr     pc,add3
-       mov     r1,(sp)
-       mov     r3,r1
-       jsr     pc,release
-       jsr     pc,readc
-       mov     r0,ch
-       br      1b
-1:
-       mov     ch,savec
-       mov     (sp)+,r1
-       rts     pc
-/
-/
-/      routine to read another character from the input
-/      stream.  If the caller does not want the character,
-/      it is to be placed in the cell savec.
-/      The routine exits to the system on end of file.
-/      Character is returned in r0.
-/
-/      jsr     pc,readc
-/      movb    r0,...
-/
-/
-readc:
-       tst     savec
-       beq     1f
-       movb    savec,r0
-       clr     savec
-       rts     pc
-1:
-       tst     *readptr
-       bne     1f
-2:     mov     source,r0
-       sys     read; ch; 1
-       bes     eof
-       tst     r0
-       beq     eof
-       movb    ch,r0
-       rts     pc
-1:
-       mov     r1,-(sp)
-       mov     *readptr,r1
-       jsr     pc,getchar
-       bes     eof1
-       mov     r0,ch
-       mov     (sp)+,r1
-       rts     pc
-/
-eof:
-       tst     source
-       beq     1f
-       clr     source
-       br      2b
-1:
-       sys     exit
-/
-eof1:
-       mov     *readptr,r1
-       beq     2f
-       jsr     pc,release
-2:
-       sub     $2,readptr
-       mov     (sp)+,r1
-       jmp     readc
-/
-/
-/      case p for print
-/
-case160:
-       cmp     r5,$pdl
-       bne     9f; jmp eh; 9:
-       jsr     pc,in160
-       jmp     loop
-/
-/
-in160:
-       mov     $1,r0
-       sys     write; sphdr; 4
-       br      1f
-/
-sphdr: <    >
-       .even
-/
-1:     cmp     r5,$pdl
-       bne     1f
-       mov     $1,r0
-       sys     write; qm; 1
-       mov     $1,r0
-       sys     write; nl; 1
-       rts     pc
-/
-/      do the conversion
-/
-1:
-       mov     -2(r5),r1
-       jsr     pc,printf
-       rts     pc
-/
-/
-/      case f for print the stack
-/
-case146:
-       mov     r5,-(sp)
-1:
-       cmp     r5,$pdl
-       beq     2f
-1:
-       jsr     pc,in160
-       jsr     pc,pop
-       cmp     r5,$pdl
-       bne     1b
-2:
-       mov     $stable-2,r0
-1:
-       tst     (r0)+
-       cmp     r0,$stable+254.
-       bhi     1f
-/
-       mov     (r0),r1
-       beq     1b
-       mov     r0,-(sp)
-       sub     $stable,r0
-       asr     r0
-       movb    r0,7f+1
-       mov     $1,r0
-       sys     write; 7f; 8f-7f
-       jsr     pc,printf
-       mov     (sp)+,r0
-       br      1b
-1:
-       mov     (sp)+,r5
-       jmp     loop
-/
-7:     <" " >
-8:     .even
-/
-/
-/      routine to convert to decimal and print the
-/      top element of the stack.
-/
-/      jsr     pc,printf
-/
-/
-printf:
-       mov     r2,-(sp)
-       mov     r1,-(sp)
-       mov     r0,-(sp)
-       clr     -(sp)
-       jsr     pc,rewind
-2:
-       jsr     pc,getchar
-       bes     2f
-       cmp     r0,$143
-       blos    2b
-       cmp     r0,$-1
-       beq     2b
-       bis     $1,(sp)
-       br      2b
-2:
-       tst     (sp)+
-       beq     2f
-       jsr     pc,length
-       mov     r0,0f
-       mov     a(r1),3f
-       mov     $1,r0
-       sys     write; 3:.=.+2; 0:.=.+2
-       br      prout
-2:
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       bec     1f
-       mov     $1,r0
-       sys     write; blank; 1
-       mov     $1,r0
-       sys     write; asczero; 1
-       br      prout
-1:
-       jsr     pc,length
-       mov     r1,-(sp)
-       jsr     pc,allocate
-       mov     (sp),r0
-       mov     r1,(sp)
-       jsr     pc,move
-       mov     ll,count
-       inc     count
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       cmpb    r0,$-1
-       bne     2f
-       mov     basptr,r1
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       cmp     r0,$-1
-       beq     2f
-       mov     (sp),r1
-       jsr     pc,chsign
-       mov     $'-,ch
-       jsr     pc,wrchar
-       br      1f
-2:
-       mov     $' ,ch
-       jsr     pc,wrchar
-1:
-       mov     strptr,r1
-       jsr     pc,create
-       mov     basptr,r1
-       jsr     pc,length
-       cmp     r0,$1
-       blo     dingout
-       bne     1f
-       jsr     pc,rewind
-       jsr     pc,getchar
-       cmp     r0,$1.
-       beq     unout
-       cmp     r0,$-1
-       beq     dingout
-1:
-       mov     (sp),r3
-       mov     basptr,r2
-       jsr     pc,div3
-       mov     r1,r2
-       mov     (sp),r1
-       jsr     pc,release
-       mov     r2,(sp)
-       mov     r4,r1
-       jsr     pc,*outdit
-       mov     (sp),r1
-       jsr     pc,length
-       bne     1b
-/
-       mov     strptr,r1
-       jsr     pc,fsfile
-1:
-       jsr     pc,backspace
-       bes     1f
-       mov     r0,ch
-       jsr     pc,wrchar
-       br      1b
-1:
-       mov     (sp)+,r1
-       jsr     pc,release
-/
-/      cleanup, print new line and return
-/
-prout: mov     $1,r0
-       sys     write; nl; 1
-       mov     (sp)+,r0
-       mov     (sp)+,r1
-       mov     (sp)+,r2
-       rts     pc
-/
-/
-dingout:
-       clr     -(sp)
-       br      1f
-unout:
-       mov     $1,-(sp)
-1:
-       mov     strptr,r1
-       jsr     pc,create
-       mov     $-1,r0
-       jsr     pc,putchar
-       mov     r1,r3
-1:
-       mov     2(sp),r1
-       jsr     pc,length
-       beq     1f
-       mov     r1,r2
-       jsr     pc,add3
-       mov     r1,2(sp)
-       mov     r2,r1
-       jsr     pc,release
-       mov     $1,r0
-       tst     (sp)
-       beq     2f
-       mov     $'1,ch
-       jsr     pc,wrchar
-       br      1b
-2:
-       tst     delflag
-       beq 9f; jmp in177; 9:
-       sys     write; ding; 3
-       br      1b
-1:
-       tst     (sp)+
-       mov     (sp)+,r1
-       jsr     pc,release
-       br      prout
-/
-ding:  <\a\e     >                       /<bell prefix tab>
-blank: < >
-sp5:   <\n     >
-minus: <->
-one:   <1>
-       .even
-count: .=.+2
-/
-bigout:
-       mov     r1,-(sp)        /big digit
-       mov     strptr,r1
-       jsr     pc,length
-       add     fw,r0
-       dec     r0
-       mov     r0,-(sp)        /end of field
-       clr     -(sp)           /negative
-       mov     4(sp),r1
-       jsr     pc,length
-       bne     2f
-       mov     strptr,r1
-       mov     $'0,r0
-       jsr     pc,putchar
-       br      1f
-2:
-       mov     4(sp),r1        /digit
-       jsr     pc,fsfile
-       jsr     pc,backspace
-       bpl     2f
-       mov     $1,(sp)         /negative
-       jsr     pc,chsign
-2:
-       mov     4(sp),r3        /digit
-       mov     r3,r1
-       jsr     pc,length
-       beq     1f
-       mov     tenptr,r2
-       jsr     pc,div3
-       mov     r1,4(sp)        /digit
-       mov     r3,r1
-       jsr     pc,release
-       mov     r4,r1
-       jsr     pc,rewind
-       jsr     pc,getchar
-       jsr     pc,release
-       add     $'0,r0
-       mov     strptr,r1
-       jsr     pc,putchar
-       br      2b
-1:
-       mov     strptr,r1
-       jsr     pc,length
-       cmp     r0,2(sp)        /end of field
-       bhis    1f
-       mov     $'0,r0
-       jsr     pc,putchar
-       br      1b
-1:
-       tst     (sp)            /negative
-       beq     1f
-       mov     $'-,r0
-       mov     strptr,r1
-       dec     w(r1)
-       jsr     pc,putchar
-1:
-       mov     $' ,r0
-       jsr     pc,putchar
-       tst     (sp)+
-       tst     (sp)+
-       mov     (sp)+,r1
-       jsr     pc,release
-       rts     pc
-/
-tenptr:        .=.+2
-/
-/
-/
-hexout:
-       mov     r1,-(sp)
-       jsr     pc,rewind
-       jsr     pc,getchar
-       add     $60,r0
-       cmp     r0,$'9
-       blos    2f
-       add     $'A-'9-1,r0
-2:
-       mov     strptr,r1
-       jsr     pc,putchar
-       mov     (sp)+,r1
-       jsr     pc,release
-       rts     pc
-/
-/
-wrchar:
-       tst     delflag
-       beq 9f; jmp in177; 9:
-       mov     $1,r0
-       tst     count
-       bne     7f
-       sys     write; sp5; 6
-       mov     ll,count
-       mov     $1,r0
-7:
-       dec     count
-       sys     write; ch; 1
-       rts     pc
-/
-/
-/      here for unimplemented stuff
-/
-junk:
-       movb    r0,1f
-       mov     $1,r0
-       sys     write; 1f; 2f-1f
-       jmp     loop
-1:     <0 not in switch.\n>
-2:     .even
-/
-/
-/
-/      routine to place one word onto the pushdown list
-/      Error exit to system on overflow.
-/
-/
-push:
-       mov     r1,(r5)+
-       cmp     r5,$pdltop
-       bhis    pdlout
-       rts     pc
-/
-pdlout:
-       mov     $1,r0
-       sys     write; 1f; 2f-1f
-       4
-1:     <Out of pushdown.\n>
-2:     .even
-/
-/
-/      routine to remove one word from the pushdown list
-/      carry bit set on empty stack
-/
-/
-/      jsr     pc,pop
-/
-pop:
-       cmp     r5,$pdl
-       bhi     1f
-       clr     r1
-       sec
-       rts     pc
-1:     mov     -(r5),r1
-       clc
-       rts     pc
-/
-/
-/
-/
-outdit:        hexout
-source: .=.+2
-savec: .=.+2
-ch:    .=.+2
-nl:    <\n>
-asczero:       <0>
-qm:    <?\n>
-       .even
-/
-chptr: .=.+2
-strptr:        .=.+2
-basptr:        .=.+2
-errstack:.=.+2
-/
-       .bss
-stable:        .=.+256.
-       .text
-casetab:
-       case012; 012    /nl
-       loop;    040    /sp
-       case041; 041    /!
-       case045; 045    /%
-       case052; 052    /*
-       case053; 053    /+
-       case055; 055    /-
-       junk;    056    /.
-       case057; 057    //
-       case060; 060    /0
-       case060; 061    /1
-       case060; 062    /2
-       case060; 063    /3
-       case060; 064    /4
-       case060; 065    /5
-       case060; 066    /6
-       case060; 067    /7
-       case060; 070    /8
-       case060; 071    /9
-       case074; 074    /<
-       case075; 075    /=
-       case076; 076    />
-       case077; 077    /?
-       case143; 103    /C
-       case144; 104    /D
-       case146; 106    /F
-       case151; 111    /I
-       case153; 113    /K
-       case154; 114    /L
-       case157; 157    /O
-       case160; 120    /P
-       case161; 121    /Q
-       case163; 123    /S
-       case166;  126   /V
-       case170; 130    /X
-       case172; 132    /Z
-       case133; 133    /[
-       case136; 136    /^
-       case137; 137    /_
-       case143; 143    /c
-       case144; 144    /d
-       case146; 146    /f
-       case151; 151    /i
-       case153; 153    /k
-       case154; 154    /l
-       case157; 157    /o
-       case160; 160    /p
-       case161; 161    /q
-       case163; 163    /s
-       case166; 166    /v
-       case170; 170    /x
-       case172; 172    /z
-       0;0
-/
-       .bss
-pdl:   .=.+100.
-pdltop:
-       .text
-4; 104 /D
-       case146; 106    /F
-       case151; 111    /I
-       case153; 113    /K
-       case154; 114    /L
-       case157; 157    /O
-       case160; 120    /P
-       case161; 121    /Q
-       case163; 123    /S
-       case166;  126   /V
-       case170; 130    /X
-       case172; 132    /Z
-       case133; 133    /[
-       case136; 136    /^
-       case137; 137    /_
-       case143; 143    /c
-       case144; 144    /d
-       case146; 146    /f
-       case151; 151    /i
-       case153; 153    /k
-       case154; 154    /l
-       case157; 157    /o
-       case160; 160    /p
-       case161; 161    /q
-       case163; 163    /s
-       case166; 166    /v
-       case170; 170    /x
-       case172; 172    /z
-       0;0
-/
\ No newline at end of file
diff --git a/cmd/as25.s b/cmd/as25.s
deleted file mode 100644 (file)
index c03b8d7..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/ as25 is empty
-ts     r5
-
-uids:  </etc/passwd\0>
-
-       .bss
-ubuf:  .=.+518.
-buf
-       cmpb    r0,$':
-       bne     3b
-       jsr     r5,cvnum; getc
-do:
-       sub     $2,r4
-       mov     r1,0f+2
-       tst     (r5)+
-1:
-       mov     (r5)+,0f
-       sys     chown; 0:..; 0
-       bec     2f
-       mov     0b,r0
-       mov     r0,0f
-       clr     0f+2
-3:
-       tstb    (r0)+
-       beq     3f
-       inc     0f+2
-       br      3b
-3:
-       mov     $1,r0
-       sys     write; 0:..; ..
-       jsr     r5,mesg; <?\n\0>; .even
-2:
-       dec     r4
-       bgt     1b
-       sys     exit
-
-cvnum:
-       clr     r1
-1:
-       jsr     r5,*(r5); ubuf
-       bcs     1f
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     1f
-       mpy     $10.,r1
-       add     r0,r1
-       br      1b
-1:
-       tst     (r5)+
-       rts     r5
-
-geta:
-       movb    (r3)+,
\ No newline at end of file
diff --git a/cmd/as8.s b/cmd/as8.s
deleted file mode 100644 (file)
index 596ea52..0000000
--- a/cmd/as8.s
+++ /dev/null
@@ -1,83 +0,0 @@
-/ as8 -- PDP-11 assembler pass 2
-
-chartab:
-       <\0abcdefg>
-       <hijklmno>
-       <pqrstuvw>
-       <xyz012345>
-       <6789_.>
-
-qnl:   <?\n>
-qii:
-       <II\n>
-a.out: <a.out\0>
-badfil:        <//\0>                  / a file which should never exist
-
-.even
-a.outp:        a.out
-a.tmp1:        badfil
-a.tmp2:        badfil
-a.tmp3:        badfil
-
-tseekp:        txtseek
-rseekp:        trelseek
-
-txtmagic:
-       br      .+20
-txtsiz:        .=.+2
-datsiz:        .=.+2
-bsssiz:        .=.+2
-symsiz:        .=.+2
-stksiz:        .=.+2
-exorig:        .=.+2
-       .=.+2
-
-txtseek: 20
-datseek: .=.+2
-       .=.+2
-trelseek: .=.+2
-drelseek: .=.+2
-       .=.+2
-symseek: .=.+2
-
-fbbufp:        .=.+2
-defund:        .=.+2
-savdot:        .=.+6
-datbase: .=.+2
-bssbase: .=.+2
-fbfil: .=.+2
-fin:   .=.+2
-ibufc: .=.+2
-txtfil:        .=.+2
-symf:  .=.+2
-adrbuf:        .=.+12.
-xsymbol:       .=.+2
-fout:  .=.+2
-ch:    .=.+2
-wordf: .=.+2
-argb:  .=.+22.
-line:  .=.+2
-savop: .=.+2
-curfb: .=.+20.
-nxtfb: .=.+20.
-nxtfbp:        .=.+20.
-curfbr:        .=.+10.
-nxtfbr:        .=.+10.
-numval:        .=.+2
-maxtyp:        .=.+2
-relfil:        .=.+2
-ibufp: .=.+2
-inbuf: .=.+512.
-txtp:  .=.+6+512.
-relp:  .=.+6+512.
-swapf: .=.+2
-rlimit:        .=.+2
-
-.=.+2
-trelseek: .=.+2
-drelseek: .=.+2
-       .=.+2
-symseek: .=.+2
-
-fbbufp:        .=.+2
-d
\ No newline at end of file
diff --git a/cmd/as9.s b/cmd/as9.s
deleted file mode 100644 (file)
index 7824cb2..0000000
--- a/cmd/as9.s
+++ /dev/null
@@ -1,301 +0,0 @@
-/ as9 -- PDP-11 assembler pass 2
-
-eae = 0
-
-symtab = .-200
-
-/ special variables
-
- 02; dot:000000 /.
- 01; dotdot:000000 /..
-
-/ register
-
-24;000000 /r0
-24;000001 /r1
-24;000002 /r2
-24;000003 /r3
-24;000004 /r4
-24;000005 /r5
-24;000006 /sp
-24;000007 /pc
-
-
-.if eae
-/eae & switches
-
-01;177570 /csw
-01;177300 /div
-01;177302 /ac
-01;177304 /mq
-01;177306 /mul
-01;177310 /sc
-01;177311 /sr
-01;177312 /nor
-01;177314 /lsh
-01;177316 /ash
-
-.endif
-
-/ system calls
-
-01;0000001 /exit
-01;0000002 /fork
-01;0000003 /read
-01;0000004 /write
-01;0000005 /open
-01;0000006 /close
-01;0000007 /wait
-01;0000010 /creat
-01;0000011 /link
-01;0000012 /unlink
-01;0000013 /exec
-01;0000014 /chdir
-01;0000015 /time
-01;0000016 /makdir
-01;0000017 /chmod
-01;0000020 /chown
-01;0000021 /break
-01;0000022 /stat
-01;0000023 /seek
-01;0000024 /tell
-01;0000025 /mount
-01;0000026 /umount
-01;0000027 /setuid
-01;0000030 /getuid
-01;0000031 /stime
-01;0000032 /quit
-01;0000033 /intr
-01;0000034 /fstat
-01;0000035 /cemt
-01;0000036 /mdate
-01;0000037 /stty
-01;0000040 /gtty
-01;0000041 /ilgins
-01;0000042 /nice
-
-/ double operand
-
-13;0010000 /mov
-13;0110000 /movb
-13;0020000 /cmp
-13;0120000 /cmpb
-13;0030000 /bit
-13;0130000 /bitb
-13;0040000 /bic
-13;0140000 /bicb
-13;0050000 /bis
-13;0150000 /bisb
-13;0060000 /add
-13;0160000 /sub
-
-/ branch
-
-06;0000400 /br
-06;0001000 /bne
-06;0001400 /beq
-06;0002000 /bge
-06;0002400 /blt
-06;0003000 /bgt
-06;0003400 /ble
-06;0100000 /bpl
-06;0100400 /bmi
-06;0101000 /bhi
-06;0101400 /blos
-06;0102000 /bvc
-06;0102400 /bvs
-06;0103000 /bhis
-06;0103000 /bec
-06;0103000 /bcc
-06;0103400 /blo
-06;0103400 /bcs
-06;0103400 /bes
-
-/ single operand
-
-15;0005000 /clr
-15;0105000 /clrb
-15;0005100 /com
-15;0105100 /comb
-15;0005200 /inc
-15;0105200 /incb
-15;0005300 /dec
-15;0105300 /decb
-15;0005400 /neg
-15;0105400 /negb
-15;0005500 /adc
-15;0105500 /adcb
-15;0005600 /sbc
-15;0105600 /sbcb
-15;0005700 /tst
-15;0105700 /tstb
-15;0006000 /ror
-15;0106000 /rorb
-15;0006100 /rol
-15;0106100 /rolb
-15;0006200 /asr
-15;0106200 /asrb
-15;0006300 /asl
-15;0106300 /aslb
-15;0000100 /jmp
-15;0000300 /swab
-
-/ jsr
-
-07;0004000 /jsr
-
-/ rts
-
-10;000200 /rts
-
-/ simple operand
-
-11;104400 /sys
-
-/ flag-setting
-
-01;0000241 /clc
-01;0000242 /clv
-01;0000244 /clz
-01;0000250 /cln
-01;0000261 /sec
-01;0000262 /sev
-01;0000264 /sez
-01;0000270 /sen
-
-/ floating point ops
-
-01;170000 / cfcc
-01;170001 / setf
-01;170011 / setd
-01;170002 / seti
-01;170012 / setl
-15;170400 / clrf
-15;170700 / negf
-15;170600 / absf
-15;170500 / tstf
-12;172400 / movf
-14;177000 / movif
-05;175400 / movfi
-14;177400 / movof
-05;176000 / movfo
-14;172000 / addf
-14;173000 / subf
-14;171000 / mulf
-14;174400 / divf
-14;173400 / cmpf
-14;171400 / modf
-24;000000 / fr0
-24;000001 / fr1
-24;000002 / fr2
-24;000003 / fr3
-24;000004 / fr4
-24;000005 / fr5
-
-/ 11/45 operations
-
-30;072000 /als (ash)
-30;073000 /alsc (ashc)
-30;070000 /mpy
-.if eae-1
-30;070000/ mul
-30;071000 / div
-30;072000 / ash
-30;073000 /ashc
-.endif
-30;071000 /dvd
-07;074000 /xor
-15;006700 /sxt
-11;006400 /mark
-31;077000 /sob
-
-/ specials
-
-16;000000 /.byte
-20;000000 /.even
-21;000000 /.if
-22;000000 /.endif
-23;000000 /.globl
-25;000000 /.text
-26;000000 /.data
-27;000000 /.bss
-32;000000 /.comm
-
-usymtab:
-start:
-       mov     $1,r0
-       sys     write; qii; 3
-       cmp     (sp),$4
-       bge     1f
-       jmp     aexit
-1:
-       cmp     (sp)+,$5
-       blt     1f
-       mov     $40,defund              / globalize all undefineds
-1:
-       tst     (sp)+
-       mov     (sp)+,a.tmp1
-       mov     (sp)+,a.tmp2
-       mov     (sp)+,a.tmp3
-       jsr     r5,ofile; a.tmp1
-       movb    r0,txtfil
-       jsr     r5,ofile; a.tmp2
-       movb    r0,fbfil
-       jsr     r5,ofile; a.tmp3
-       movb    r0,symf
-       movb    r0,fin
-       sys     creat; a.out; 12
-       bec     1f
-       jsr     r5,filerr; a.outp
-1:
-       movb    r0,fout
-       jmp     go
-
-ofile:
-       mov     *(r5),0f
-       sys     open; 0:..; 0
-       bes     1f
-       tst     (r5)+
-       rts     r5
-1:
-       jmp     filerr
-
-end:
-
-omm
-
-usymtab:
-start:
-       mov     $1,r0
-       sys     write; qii; 3
-       cmp     (sp),$4
-       bge     1f
-       jmp     aexit
-1:
-       cmp     (sp)+,$5
-       blt     1f
-       mov     $40,defund              / globalize all undefineds
-1:
-       tst     (sp)+
-       mov     (sp)+,a.tmp1
-       mov     (sp)+,a.tmp2
-       mov     (sp)+,a.tmp3
-       jsr     r5,ofile; a.tmp1
-       movb    r0,txtfil
-       jsr     r5,ofile; a.tmp2
-       movb    r0,fbfil
-       jsr     r5,ofile; a.tmp3
-       movb    r0,symf
-       movb    r0,fin
-       sys     creat; a.out; 12
-       bec     1f
-       jsr     r5,filerr; a.outp
-1:
-       movb    r0,fout
-       jmp     go
-
-ofile:
-       mov     *(r5),0f
-       sys     open; 0:..; 0
-       bes     1f
-       
\ No newline at end of file
diff --git a/cmd/bas0.s b/cmd/bas0.s
deleted file mode 100644 (file)
index a02f992..0000000
+++ /dev/null
@@ -1,391 +0,0 @@
-/ bas0 -- basic
-
-.globl main
-.globl sin, cos, log, exp, atan, pow
-.globl atoi, atof, ftoa, ftoo
-.globl rand, srand
-
-one = 40200
-
-main:
-       setd
-       sys     time
-       mov     r1,r0
-       mov     r0,randx
-       jsr     pc,srand
-       sys     intr; intrup
-       mov     sp,gsp
-       clr     seeka
-       mov     $'a,r1
-1:
-       movb    r1,tmpf+8
-       sys     stat; tmpf; line
-       bes     1f
-       inc     r1
-       cmp     r1,$'z
-       blos    1b
-       br      2f
-1:
-       sys     creat; tmpf; 14
-       bes     2f
-       mov     r0,tfo
-       sys     open; tmpf; 0
-       bec     1f
-2:
-       mov     $3f,r0
-       jsr     pc,print
-       sys     exit
-3:
-       <Tmp file?\n\0>; .even
-1:
-       mov     r0,tfi
-       jsr     pc,isymtab
-       cmp     (sp),$2
-       blt     loop
-       mov     4(sp),0f
-       sys     open; 0:..; 0
-       bes     1f
-       mov     r0,fi
-       br      loop
-1:
-       mov     $1f,r0
-       jsr     pc,print
-       br      loop
-1:
-       <Cannot open file\n\0>; .even
-
-intrup:
-       mov     $'\n,r0
-       jsr     r5,putc
-       jsr     r5,error
-               <ready\n\0>; .even
-
-loop:
-       mov     gsp,sp
-       clr     lineno
-       jsr     pc,rdline
-       mov     $line,r3
-1:
-       movb    (r3),r0
-       jsr     pc,digit
-               br 1f
-       jsr     r5,atoi; nextc
-       cmp     r0,$' /
-       bne     1f
-       mov     $lintab,r3
-       mov     r1,r0
-       bgt     2f
-       jsr     pc,serror
-2:
-       cmp     r0,(r3)
-       beq     2f
-       tst     (r3)
-       beq     2f
-       add     $6,r3
-       br      2b
-2:
-       cmp     r3,$elintab-12.
-       blo     2f
-       jsr     r5,error
-               <too many lines\n\0>; .even
-2:
-       mov     r0,(r3)+
-       mov     seeka,(r3)+
-       mov     tfo,r0
-       sys     seek; seeka:..; 0
-       mov     $line,r0
-       jsr     pc,size
-       inc     r0
-       add     r0,seeka
-       mov     r0,0f
-       mov     tfo,r0
-       sys     write; line; 0:..
-       br      loop
-1:
-       mov     $line,r3
-       jsr     pc,singstat
-       br      loop
-
-nextc:
-       movb    (r3)+,r0
-       rts     r5
-
-size:
-       clr     -(sp)
-1:
-       inc     (sp)
-       cmpb    (r0)+,$'\n
-       bne     1b
-       mov     (sp)+,r0
-       rts     pc
-
-rdline:
-       mov     $line,0f
-1:
-       mov     fi,r0
-       sys     read; 0:..; 1
-       bes     2f
-       tst     r0
-       beq     2f
-       cmp     0b,$line+99.
-       bhis    2f                      / bad check, but a check
-       movb    *0b,r0
-       inc     0b
-       cmp     r0,$'\n
-       bne     1b
-       clrb    *0b
-       rts     pc
-2:
-       mov     fi,r0
-       beq     1f
-       sys     close
-       clr     fi
-       br      1b
-1:
-       jmp     _done
-
-error:
-       tst     fi
-       beq     1f
-       sys     close
-       clr     fi
-1:
-       tst     lineno
-       beq     1f
-       jsr     pc,nextlin
-               br 1f
-       mov     $line,r0
-       jsr     pc,print
-1:
-       mov     r5,r0
-       jsr     pc,print
-       jmp     loop
-
-serror:
-       dec     r3
-       tst     fi
-       beq     1f
-       sys     close
-       clr     fi
-1:
-       mov     $line,r1
-1:
-       cmp     r1,r3
-       bne     2f
-       mov     $'_,r0
-       jsr     r5,putc
-       mov     $10,r0
-       jsr     r5,putc
-2:
-       movb    (r1),r0
-       jsr     r5,putc
-       cmpb    (r1)+,$'\n
-       bne     1b
-       jmp     loop
-
-print:
-       mov     r0,0f
-       jsr     pc,size
-       mov     r0,0f+2
-       mov     $1,r0
-       sys     write; 0:..; ..
-       rts     pc
-
-digit:
-       cmp     r0,$'0
-       blo     1f
-       cmp     r0,$'9
-       bhi     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
-alpha:
-       cmp     r0,$'a
-       blo     1f
-       cmp     r0,$'z
-       bhi     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
-name:
-       mov     $nameb,r1
-       clr     (r1)
-       clr     2(r1)
-1:
-       cmp     r1,$nameb+4
-       bhis    2f
-       movb    r0,(r1)+
-2:
-       movb    (r3)+,r0
-       jsr     pc,alpha
-               br 2f
-       br      1b
-2:
-       jsr     pc,digit
-               br 2f
-       br      1b
-2:
-       mov     $resnam,r1
-1:
-       cmp     nameb,(r1)
-       bne     2f
-       cmp     nameb+2,2(r1)
-       bne     2f
-       sub     $resnam,r1
-       asr     r1
-       add     $2,(sp)
-       rts     pc
-2:
-       add     $4,r1
-       cmp     r1,$eresnam
-       blo     1b
-       mov     $symtab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     nameb,(r1)
-       bne     2f
-       cmp     nameb+2,2(r1)
-       bne     2f
-       rts     pc
-2:
-       add     $14.,r1
-       br      1b
-1:
-       cmp     r1,$esymtab-28.
-       blo     1f
-       jsr     r5,error
-               <out of symbol space\n\0>; .even
-1:
-       mov     nameb,(r1)
-       mov     nameb+2,2(r1)
-       clr     4(r1)
-       clr     14.(r1)
-       rts     pc
-
-skip:
-       cmp     r0,$' /
-       bne     1f
-       movb    (r3)+,r0
-       br      skip
-1:
-       rts     pc
-
-putc:
-       tstb    drflg
-       beq     1f
-       jsr     pc,drput
-       rts     r5
-1:
-       mov     r0,ch
-       mov     $1,r0
-       sys     write; ch; 1
-       rts     r5
-
-nextlin:
-       clr     -(sp)
-       mov     $lintab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     lineno,(r1)
-       bhi     2f
-       mov     (sp),r0
-       beq     3f
-       cmp     (r0),(r1)
-       blos    2f
-3:
-       mov     r1,(sp)
-2:
-       add     $6,r1
-       br      1b
-1:
-       mov     (sp)+,r1
-       beq     1f
-       mov     (r1)+,lineno
-       mov     (r1)+,0f
-       mov     tfi,r0
-       sys     seek; 0:..; 0
-       mov     tfi,r0
-       sys     read; line; 100.
-       add     $2,(sp)
-1:
-       rts     pc
-
-getloc:
-       mov     $lintab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     r0,(r1)
-       beq     2f
-       add     $6,r1
-       br      1b
-1:
-       jsr     r5,error
-               <label not found\n\0>; .even
-2:
-       rts     pc
-
-isymtab:
-       mov     $symtab,r0
-       mov     $symtnam,r1
-       clrf    fr0
-       movf    $one,fr1
-1:
-       mov     (r1)+,(r0)+
-       mov     (r1)+,(r0)+
-       mov     $1,(r0)+
-       subf    r1,r0
-       movf    r0,(r0)+
-       cmp     r1,$esymtnam
-       blo     1b
-       clr     (r0)+
-       rts     pc
-
-       r1,(sp)
-2:
-       add     $6,r1
-       br      1b
-1:
-       mov     (sp)+,r1
-       beq     1f
-       mov     (r1)+,lineno
-       mov     (r1)+,0f
-       mov     tfi,r0
-       sys     seek; 0:..; 0
-       mov     tfi,r0
-       sys     read; line; 100.
-       add     $2,(sp)
-1:
-       rts     pc
-
-getloc:
-       mov     $lintab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     r0,(r1)
-       beq     2f
-       add     $6,r1
-       br      1b
-1:
-       jsr     r5,error
-               <label not found\n\0>; .even
-2:
-       rts     pc
-
-isymtab:
-       mov     $symtab,r0
-       mov     $symtnam,r1
-       clrf    fr0
-       movf    $one,fr1
-1:
-       mov     (r1)+,(r0)+
-       mov     (r1)+,(r0)+
-       mov     $1,(r0)+
-       subf    r1,r0
-       movf    r0,(r0)+
-       cmp     r1
\ No newline at end of file
diff --git a/cmd/bas1.s b/cmd/bas1.s
deleted file mode 100644 (file)
index 007ea58..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-/ bas1 -- compile
-
-compile:
-       clr     forp
-       mov     $space,r4
-       tst     lineno
-       beq     1f
-       rts     pc
-1:
-       jsr     pc,nextlin
-               br 1f
-       mov     lineno,r0
-       jsr     pc,getloc
-       mov     r4,4(r1)
-       jsr     pc,statement
-               br .+2
-       inc     lineno
-       cmp     r4,$espace-20.
-       blo     1b
-       jsr     r5,error
-               <out of code space\n\0>; .even
-1:
-       tst     forp
-       bne     2f
-       mov     $loop,(r4)+
-       rts     pc
-
-singstat:
-       clr     forp
-       mov     $exline,r4
-       jsr     pc,statement
-               br 1f
-       cmp     -2(r4),$_asgn
-       beq     1f
-       mov     $_print,(r4)+
-       mov     $_nline,(r4)+
-1:
-       tst     forp
-       bne     2f
-       cmp     r4,$eexline
-       blo     1f
-       jsr     r5,error
-               <out of code space\n\0>; .even
-1:
-       mov     $loop,(r4)+
-       mov     r4,exprloc
-       mov     $exline,r4
-       jmp     execute
-2:
-       jmp     forer
-
-statement:
-       mov     $line,r3
-       movb    (r3)+,r0
-       jsr     pc,digit
-               br stat1
-       dec     r3
-       jsr     r5,atoi; nextc
-       cmp     r0,$' /
-       beq     1f
-       mov     $line,r3
-       movb    (r3)+,r0
-       br      stat1
-1:
-       mov     $_line,(r4)+
-       mov     r1,(r4)+
-
-stat1:
-       jsr     pc,skip
-       cmp     r0,$'\n
-       bne     .+4
-       rts     pc
-       mov     r3,-(sp)
-       jsr     pc,alpha
-               br 1f
-       jsr     pc,name
-               br 1f
-       tst     (sp)+
-       jsr     pc,skip
-       dec     r3
-       jmp     *2f(r1)
-2:
-       stlist
-       stdone
-       strun
-       stprint
-       stdisp
-       stif
-       stgoto
-       streturn
-       stfor
-       stnext
-       stoctl
-       stdraw
-       steras
-
-1:
-       mov     (sp)+,r3
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     joe
-       add     $2,(sp)
-       rts     pc
-
-stlist:
-       cmp     r0,$'\n
-       bne     1f
-       clrf    r0
-       jsr     pc,const
-       movif   $77777,r0
-       jsr     pc,const
-       br      2f
-1:
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     1f
-       mov     $_dup,(r4)+
-       br      2f
-1:
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     joe
-2:
-       mov     $_list,(r4)+
-       rts     pc
-
-stdone:
-       cmp     r0,$'\n
-       bne     joe
-       mov     $_done,(r4)+
-       rts     pc
-
-strun:
-       cmp     r0,$'\n
-       bne     joe
-       mov     $_run,(r4)+
-       rts     pc
-
-stdisp:
-       mov     $_sdisp,(r4)+
-       jsr     pc,stprint
-       mov     $_fdisp,(r4)+
-       rts     pc
-
-stprint:
-       jsr     pc,skip
-       cmp     r0,$'\n
-       beq     2f
-       cmp     r0,$'"
-       beq     1f
-       dec     r3
-       jsr     pc,expr
-       mov     $_print,(r4)+
-       dec     r3
-       br      stprint
-1:
-       mov     $_ascii,(r4)+
-       inc     r3
-1:
-       movb    (r3)+,(r4)
-       cmpb    (r4),$'"
-       beq     1f
-       cmpb    (r4)+,$'\n
-       bne     1b
-       br      joe
-1:
-       add     $2,r4
-       bic     $1,r4
-       movb    (r3)+,r0
-       br      stprint
-2:
-       mov     $_nline,(r4)+
-       rts     pc
-
-stif:
-       jsr     pc,expr
-       mov     $_if,(r4)+
-       mov     r4,-(sp)
-       tst     (r4)+
-       jsr     pc,stat1
-               br .+2
-       mov     (sp)+,r1
-       mov     r4,(r1)
-       rts     pc
-
-stgoto:
-       jsr     pc,expr
-       mov     $_goto,(r4)+
-       rts     pc
-
-streturn:
-       cmp     r0,$'\n
-       beq     1f
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     joe
-       br      2f
-1:
-       clrf    r0
-       jsr     pc,const
-2:
-       mov     $_return,(r4)+
-       rts     pc
-
-joe:
-       jsr     pc,serror
-
-stfor:
-       mov     r4,-(sp)
-       jsr     pc,e2
-       mov     r4,-(sp)
-       cmp     r0,$'=
-       bne     joe
-       tst     val
-       bne     joe
-       jsr     pc,expr
-       mov     forp,(r4)+      / overlay w _asgn
-       mov     r4,forp
-       cmp     (r4)+,(r4)+     / _tra ..
-       mov     (sp)+,r0
-       mov     (sp)+,r1
-1:
-       mov     (r1)+,(r4)+
-       cmp     r1,r0
-       blo     1b
-       mov     $_fori,(r4)+
-       mov     forp,r1
-       mov     $_tra,(r1)+
-       mov     r4,(r1)+
-       dec     r3
-       jsr     pc,expr
-       mov     $_lesseq,(r4)+
-       mov     $_if,(r4)+
-       mov     forp,(r4)+
-       mov     r4,forp
-       cmp     r0,$'\n
-       beq     1f
-       jsr     pc,stat1
-               br .+2
-       br      stnext
-1:
-       rts     pc
-
-forer:
-       jsr     r5,error; <for/next imbalance\n\0>; .even
-
-stnext:
-       mov     forp,r1
-       beq     forer
-       mov     -(r1),r0
-       mov     -(r0),forp
-       mov     $_ptra,(r4)+
-       mov     $_asgn,(r0)+
-       cmp     (r0)+,(r0)+
-       mov     r0,(r4)+
-       mov     r4,(r1)+
-       rts     pc
-
-stoctl:
-       jsr     pc,expr
-       mov     $_octal,(r4)+
-       rts     pc
-
-stdraw:
-       jsr     pc,expr
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     1f
-       movf    $one,r0
-       jsr     pc,const
-       br      2f
-1:
-       dec     r3
-       jsr     pc,expr
-2:
-       mov     $_draw,(r4)+
-       rts     pc
-
-steras:
-       mov     $_erase,(r4)+
-       rts     pc
-
-
-       cmp     r0,$'\n
-       beq     1f
-       jsr     pc,stat1
-               br .+2
-       br      stnext
-1:
-       rts     pc
-
-forer:
-       jsr     r5,error; <for/next imbalance\n\0>; .even
-
-stnext:
-       mov     forp,r1
-       beq     forer
-       mov     -(r1),r0
-       mov     -(r0),forp
-       mov     $_ptra,(r4)+
-       mov     $_asgn,(r0)+
-       cmp     (r0)+,(r0)+
-       mov     r0,(r4)+
-       mov     r4,(r1)+
-       rts     pc
-
-stoctl:
-       jsr     pc,expr
-       mov     $_octal,(r4)+
-       rts     pc
-
-stdraw:
-       jsr     pc,expr
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     1f
-       movf    $one,r0
-       jsr     pc,const
-       br      2f
-1:
-       dec     r3
-       jsr     pc,expr
-2:
-       mov     $_draw,(r4)+
-       rts     pc
-
-steras:
-       mov     $_erase,(r4)+
\ No newline at end of file
diff --git a/cmd/cat.s b/cmd/cat.s
deleted file mode 100644 (file)
index 6c5dfa4..0000000
--- a/cmd/cat.s
+++ /dev/null
@@ -1,105 +0,0 @@
-/ cat -- concatinate files
-
-       mov     (sp)+,r5
-       tst     (sp)+
-       mov     $obuf,r2
-       cmp     r5,$1
-       beq     3f
-
-loop:
-       dec     r5
-       ble     done
-       mov     (sp)+,r0
-       cmpb    (r0),$'-
-       bne     2f
-       clr     fin
-       br      3f
-2:
-       mov     r0,0f
-       sys     open; 0:..; 0
-       bes     loop
-       mov     r0,fin
-3:
-       mov     fin,r0
-       sys     read; ibuf; 512.
-       bes     3f
-       mov     r0,r4
-       beq     3f
-       mov     $ibuf,r3
-4:
-       movb    (r3)+,r0
-       jsr     pc,putc
-       dec     r4
-       bne     4b
-       br      3b
-3:
-       mov     fin,r0
-       beq     loop
-       sys     close
-       br      loop
-
-done:
-       sub     $obuf,r2
-       beq     1f
-       mov     r2,0f
-       mov     $1,r0
-       sys     write; obuf; 0:..
-1:
-       sys     exit
-
-putc:
-       movb    r0,(r2)+
-       cmp     r2,$obuf+512.
-       blo     1f
-       mov     $1,r0
-       sys     write; obuf; 512.
-       mov     $obuf,r2
-1:
-       rts     pc
-
-       .bss
-ibuf:  .=.+512.
-obuf:  .=.+512.
-fin:   .=.+2
-       .text
-
-,$'-
-       bne     2f
-       clr     fin
-       br      3f
-2:
-       mov     r0,0f
-       sys     open; 0:..; 0
-       bes     loop
-       mov     r0,fin
-3:
-       mov     fin,r0
-       sys     read; ibuf; 512.
-       bes     3f
-       mov     r0,r4
-       beq     3f
-       mov     $ibuf,r3
-4:
-       movb    (r3)+,r0
-       jsr     pc,putc
-       dec     r4
-       bne     4b
-       br      3b
-3:
-       mov     fin,r0
-       beq     loop
-       sys     close
-       br      loop
-
-done:
-       sub     $obuf,r2
-       beq     1f
-       mov     r2,0f
-       mov     $1,r0
-       sys     write; obuf; 0:..
-1:
-       sys     exit
-
-putc:
-       movb    r0,(r2)+
-       cmp     r2
\ No newline at end of file
diff --git a/cmd/cc.c b/cmd/cc.c
deleted file mode 100644 (file)
index 874b4ea..0000000
--- a/cmd/cc.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/* C command */
-
-char *tmp0 "//";
-char *tmp1 "//";
-char *tmp2 "//";
-char *tmp3 "//";
-char *tmp4 "//";
-char ts[500];
-char *tsp ts;
-char *av[50];
-char *clist[50];
-char *llist[50];
-
-main(argc, argv)
-char *argv[]; {
-       char *t, *pref;
-       int nc, nl, cflag, i, j, c, f20;
-
-       i = nc = nl = cflag = f20 = 0;
-       pref = "/lib/crt0.o";
-       while(++i < argc) {
-               if(*argv[i] == '-')
-                       switch (argv[i][1]) {
-                               default:
-                                       goto passa;
-                               case 'c':
-                                       cflag++;
-                                       break;
-                               case '2':
-                                       pref = "/lib/crt20.o";
-                                       f20 = 1;
-                       }
-               else {
-               passa:
-                       t = copy(argv[i]);
-                       if(getsuf(t)=='c') {
-                               clist[nc++] = t;
-                               t = setsuf(copy(t));
-                               if (dup(llist, t))
-                                       continue;
-                       }
-                       llist[nl++] = t;
-               }
-       }
-       if(nc==0)
-               goto nocom;
-       tmp0 = copy("/tmp/ctm0a");
-       while((c=open(tmp0, 0))>=0) {
-               close(c);
-               tmp0[9]++;
-       }
-       while((creat(tmp0, 012))<0)
-               tmp0[9]++;
-       intr(delfil);
-       (tmp1 = copy(tmp0))[8] = '1';
-       (tmp2 = copy(tmp0))[8] = '2';
-       (tmp3 = copy(tmp0))[8] = '3';
-       (tmp4 = copy(tmp0))[8] = '4';
-       for (i=0; i<nc; i++) {
-               if (nc>1)
-                       printf("%s:\n", clist[i]);
-               av[0] = "c0";
-               av[1] = expand(clist[i]);
-               if (av[1] == 0) {
-                       cflag++;
-                       continue;
-               }
-               av[2] = tmp1;
-               av[3] = tmp2;
-               av[4] = 0;
-               if (callsys("/lib/c0", av)) {
-                       cflag++;
-                       continue;
-               }
-               av[0] = "c1";
-               av[1] = tmp1;
-               av[2] = tmp2;
-               av[3] = tmp3;
-               av[4] = 0;
-               if(callsys("/lib/c1", av)) {
-                       cflag++;
-                       continue;
-               }
-               av[0] = "as";
-               av[1] = "-";
-               if(f20) {
-                       av[2] = "/lib/20.s";
-                       av[3] = tmp3;
-                       av[4] = 0;
-               } else {
-                       av[2] = tmp3;
-                       av[3] = 0;
-               }
-               callsys("/bin/as", av);
-               t = setsuf(clist[i]);
-               unlink(t);
-               if(link("a.out", t) | unlink("a.out")) {
-                       printf("move failed: %s\n", t);
-                       cflag++;
-               }
-       }
-nocom:
-       if (cflag==0 & nl!=0) {
-               i = 0;
-               av[0] = "ld";
-               av[1] = pref;
-               j = 2;
-               while(i<nl)
-                       av[j++] = llist[i++];
-               if(f20) {
-                       av[j++] = "-l2";
-                       av[j++] = 0;
-               } else {
-                       av[j++] = "/lib/libc.a";
-                       av[j++] = "-l";
-                       av[j++] = 0;
-               }
-               if(f20) {
-                       callsys("/usr/lib/ld20", av);
-               } else {
-                       callsys("/bin/ld", av);
-               }
-               if (nc==1 & nl==1)
-                       unlink(llist[0]);
-       }
-delfil:
-       dexit();
-}
-
-dexit()
-{
-       unlink(tmp1);
-       unlink(tmp2);
-       unlink(tmp3);
-       unlink(tmp4);
-       unlink(tmp0);
-       exit();
-}
-
-expand(file)
-char *file;
-{
-       int ibuf1[259], ibuf2[259], obuf[259];
-       char *hdrp, hdr[64];
-       int nlflg, c;
-
-       if (fopen(file, ibuf1)<0)
-               return(file);
-       if (getc(ibuf1) != '%') {
-               close(ibuf1[0]);
-               return(file);
-       }
-       ibuf1[1]++;             /* back up over % */
-       ibuf1[2]--;
-       if (fcreat(tmp4, obuf) < 0) {
-               printf("Can't creat %s\n", tmp4);
-               dexit();
-       }
-       nlflg = 1;
-       while (c = getc(ibuf1)) {
-               if (c == '%' & nlflg) {
-                       hdrp = hdr;
-                       while ((c = getc(ibuf1)) != '\n')
-                               if (c!=' ')
-                                       *hdrp++ = c;
-                       *hdrp = '\0';
-                       if (hdr[0] == '\0')
-                               goto nohdr;
-                       if (fopen(hdr, ibuf2) < 0) {
-                               printf("Missing file %s\n", hdr);
-                               close(ibuf1[0]);
-                               return(0);
-                       }
-                       while (c = getc(ibuf2)) {
-                               if (nlflg)
-                                       putc(1, obuf);  /* SOH */
-                               nlflg = c=='\n';
-                               putc(c, obuf);
-                       }
-                       close(ibuf2[0]);
-                       c = '\n';
-               }
-       nohdr:
-               nlflg = c=='\n';
-               putc(c, obuf);
-       }
-       fflush(obuf);
-       close(obuf[0]);
-       close(ibuf1[0]);
-       return(tmp4);
-}
-
-getsuf(s)
-char s[];
-{
-       int c;
-       char t, *os;
-
-       c = 0;
-       os = s;
-       while(t = *s++)
-               if (t=='/')
-                       c = 0;
-               else
-                       c++;
-       s =- 3;
-       if (c<=8 & c>2 & *s++=='.' & *s=='c')
-               return('c');
-       return(0);
-}
-
-setsuf(s)
-char s[];
-{
-       char *os;
-
-       os = s;
-       while(*s++);
-       s[-2] = 'o';
-       return(os);
-}
-
-callsys(f, v)
-char f[], *v[]; {
-       int t, status;
-
-       if ((t=fork())==0) {
-               execv(f, v);
-               printf("Can't find %s\n", f);
-               exit(1);
-       } else
-               if (t == -1) {
-                       printf("Try again\n");
-                       return(1);
-               }
-       while(t!=wait(&status));
-       if ((t=(status&0377)) != 0 & t!=14) {
-               if (t!=12)              /* interrupt */
-                       printf("Fatal error in %s\n", f);
-               dexit();
-       }
-       return((status>>8) & 0377);
-}
-
-copy(s)
-char s[]; {
-       char *otsp;
-
-       otsp = tsp;
-       while(*tsp++ = *s++);
-       return(otsp);
-}
-
-dup(l, s)
-char **l, s[]; {
-
-       char *t, *os, c;
-
-       os = s;
-       while(t = *l++) {
-               s = os;
-               while(c = *s++)
-                       if (c != *t++)
-                               break;
-               if (*t++ == '\0') return (1);
-       }
-       return(0);
-}
-lse
-               if (t == -1) {
-                       printf("Try again\
\ No newline at end of file
diff --git a/cmd/chmod.s b/cmd/chmod.s
deleted file mode 100644 (file)
index c721804..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/ chmod - change mode
-
-chmode:
-       mov     sp,r5
-       mov     (r5),r4
-       cmp     r4,$3
-       blt     chmerr
-       add     $4,r5
-       mov     (r5)+,r1
-       clr     0f
-1:
-       movb    (r1)+,r0
-       beq     1f
-       asl     0f
-       asl     0f
-       asl     0f
-       bic     $!7,r0
-       bis     r0,0f
-       br      1b
-1:
-       mov     (r5)+,0f-2
-       sys     chmod; ..; 0:..
-       bes     chmerr
-       dec     r4
-       cmp     r4,$3
-       bge     1b
-       sys     exit
-
-chmerr:
-       mov     $1,r0
-       sys     write; 1f; 2
-       sys     exit
-
-1:     <?\n>
-q      1f
-       jsr     pc,1b
-1:
-       mov     (sp)+,r0
-       add     $'0,r0
-       jsr     pc,putc
-       rts     pc
-
-cfcc
-       ble     2f
-       dec     r4
-       mulf    r3,r0
-       br      1b
-2:
-       modf    r2,r0
-       movfi   r1,r0
-       add     $'0,r0
-       jsr     pc,putc
-       mov     $'.,r0
-       j
\ No newline at end of file
diff --git a/cmd/chown.s b/cmd/chown.s
deleted file mode 100644 (file)
index f4417fb..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/ chown -- change owner
-
-
-       .globl  fopen, getc, mesg
-
-       mov     sp,r5
-       mov     (r5),r4
-       cmp     r4,$3
-       bge     1f
-       jsr     r5,mesg; <chown uid f1 ...\n\0>; .even
-1:
-       add     $4,r5
-       mov     (r5),r3
-       cmpb    (r3),$'0
-       blt     1f
-       cmpb    (r3),$'9
-       bgt     1f
-       jsr     r5,cvnum; geta
-       br      do
-1:
-       mov     $uids,r0
-       jsr     r5,fopen; ubuf
-       bec     1f
-       jsr     r5,mesg; <Can't open /etc/uids\n\0>; .even
-       sys     exit
-1:
-       mov     r3,r2
-2:
-       jsr     r5,getc; ubuf
-       bcc     3f
-who:
-       jsr     r5,mesg; <Who?\n\0>; .even
-       sys     exit
-3:
-       cmp     r0,$':
-       beq     3f
-       cmpb    (r2)+,r0
-       beq     2b
-2:
-       jsr     r5,getc; ubuf
-       bcs     who
-       cmp     r0,$'\n
-       bne     2b
-       br      1b
-3:
-       tstb    (r2)
-       bne     2b
-3:
-       jsr     r5,getc; ubuf
-       cmpb    r0,$':
-       bne     3b
-       jsr     r5,cvnum; getc
-do:
-       sub     $2,r4
-       mov     r1,0f+2
-       tst     (r5)+
-1:
-       mov     (r5)+,0f
-       sys     chown; 0:..; 0
-       bec     2f
-       mov     0b,r0
-       mov     r0,0f
-       clr     0f+2
-3:
-       tstb    (r0)+
-       beq     3f
-       inc     0f+2
-       br      3b
-3:
-       mov     $1,r0
-       sys     write; 0:..; ..
-       jsr     r5,mesg; <?\n\0>; .even
-2:
-       dec     r4
-       bgt     1b
-       sys     exit
-
-cvnum:
-       clr     r1
-1:
-       jsr     r5,*(r5); ubuf
-       bcs     1f
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     1f
-       mpy     $10.,r1
-       add     r0,r1
-       br      1b
-1:
-       tst     (r5)+
-       rts     r5
-
-geta:
-       movb    (r3)+,r0
-       tst     (r5)+
-       rts     r5
-
-uids:  </etc/passwd\0>
-
-       .bss
-ubuf:  .=.+518.
-buf
-       cmpb    r0,$':
-       bne     3b
-       jsr     r5,cvnum; getc
-do:
-       sub     $2,r4
-       mov     r1,0f+2
-       tst     (r5)+
-1:
-       mov     (r5)+,0f
-       sys     chown; 0:..; 0
-       bec     2f
-       mov     0b,r0
-       mov     r0,0f
-       clr     0f+2
-3:
-       tstb    (r0)+
-       beq     3f
-       inc     0f+2
-       br      3b
-3:
-       mov     $1,r0
-       sys     write; 0:..; ..
-       jsr     r5,mesg; <?\n\0>; .even
-2:
-       dec     r4
-       bgt     1b
-       sys     exit
-
-cvnum:
-       clr     r1
-1:
-       jsr     r5,*(r5); ubuf
-       bcs     1f
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     1f
-       mpy     $10.,r1
-       add     r0,r1
-       br      1b
-1:
-       tst     (r5)+
-       rts     r5
-
-geta:
-       movb    (r3)+,
\ No newline at end of file
diff --git a/cmd/cmp.s b/cmd/cmp.s
deleted file mode 100644 (file)
index fa0febb..0000000
--- a/cmd/cmp.s
+++ /dev/null
@@ -1,133 +0,0 @@
-/ cmp -- compare files
-
-
-       cmp     (sp)+,$3
-       beq     1f
-       jsr     r5,mesg; <Usage: cmp arg1 arg2\n\0>; .even
-       sys     exit
-1:
-       tst     (sp)+
-       mov     (sp)+,0f
-       sys     open; 0:..; 0
-       bec     1f
-       jsr     r5,mesg; <Can't open arg1.\n\0>; .even
-       sys     exit
-1:
-       mov     r0,f1
-       mov     (sp)+,0f
-       sys     open; 0:..; 0
-       bec     1f
-       jsr     r5,mesg; <Can't open arg2.\n\0>; .even
-       sys     exit
-1:
-       mov     r0,f2
-       clr     r2
-1:
-       jsr     r5,getw; f1
-       bvs     eof1
-       mov     r0,r3
-       jsr     r5,getw; f2
-       bvs     eof2
-       cmp     r0,r3
-       beq     2f
-       mov     r0,r4
-       mov     r2,r0
-       jsr     pc,octal
-       jsr     r5,mesg; <: \0>; .even
-       mov     r3,r0
-       jsr     pc,octal
-       jsr     r5,mesg; < \0>;
-       mov     r4,r0
-       jsr     pc,octal
-       jsr     r5,mesg; <\n\0>
-2:
-       add     $2,r2
-       br      1b
-eof1:
-       jsr     r5,getw; f2
-       bvs     1f
-       jsr     r5,mesg; <EOF on arg1.\n\0>; .even
-       sys     exit
-1:
-       sys     exit
-
-eof2:
-       jsr     r5,mesg; <EOF on arg2.\n\0>; .even
-       sys     exit
-
-mesg:
-       movb    (r5)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      mesg
-1:
-       inc     r5
-       bic     $1,r5
-       rts     r5
-
-getw:
-       mov     (r5)+,r1
-       cmp     2(r1),$1
-       bne     1f
-       mov     *4(r1),r0
-       bic     $!377,r0
-       dec     2(r1)
-       rts     r5
-1:
-       sub     $2,2(r1)
-       bge     1f
-       mov     (r1),r0
-       mov     r1,0f
-       add     $6,0f
-       sys     read; 0:..; 512.
-       mov     r0,2(r1)
-       bne     2f
-       sev
-       rts     r5
-2:
-       mov     r1,4(r1)
-       add     $6,4(r1)
-       sub     $2,2(r1)
-1:
-       mov     *4(r1),r0
-       add     $2,4(r1)
-       rts     r5
-
-octal:
-       mov     r4,-(sp)
-       mov     r0,r5
-       mov     $6,-(sp)
-1:
-       clr     r4
-       alsc    $1,r4
-       cmp     (sp),$6
-       beq     2f
-       alsc    $2,r4
-2:
-       add     $'0,r4
-       mov     r4,ch
-       mov     $1,r0
-       sys     write; ch; 1
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       mov     (sp)+,r4
-       rts     pc
-
-       .bss
-
-ch:    .=.+2
-f1:    .=.+6; .=.+512.
-f2:    .=.+6; .=.+512.
-*4(r1),r0
-       bic     $!377,r0
-       dec     2(r1)
-       rts     r5
-1:
-       sub     $2,2(r1)
-       bge     1f
-       mov     (r1),r0
-       mov     r1,0f
-       add     $6,0f
-       sys     read; 0:..
\ No newline at end of file
diff --git a/cmd/colon.s b/cmd/colon.s
deleted file mode 100644 (file)
index 25cfeb0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/ colon -- do nothing
-
-       sys     exit
-
-; 9:
-       mov     r1,frlist(r0)
-       mov     exp2(r0),r0
-       add     $strbuf,r0
-       mov     r0,l(r1)
-       mov     $frlist-2,r1
-1:     mov     (r1),r1
-       tst     r1
-       beq     1f
-       mov     $strbuf,a(r1)
-       mov     $strbuf,l(r1)
-       br      1b
-1:
-       mov     (sp)+,r1
-       mov     (sp)+,r0
-       rts     pc
-/
-/
-       .bss
-stats: .=.+16.
-useful:        .=.+2
-hdrptr:        .=.+2   /do not move me
-frlist:        .=hdrptr+32.
-frend:
-headers:.=hdrptr+512.
-headend:
-strbuf:        .=.+4000
-strend:
-end:
-v      frlist-2,r1
-       mov     (r1),frlist-2
-       clr     w(r1)
-       mov     $strbuf,r0
-       mov     r0,a(r1)
-       mov     $strend-strbuf,r0
-       jsr     pc,log2
-       asl     r
\ No newline at end of file
diff --git a/cmd/cp.c b/cmd/cp.c
deleted file mode 100644 (file)
index 25fdd2c..0000000
--- a/cmd/cp.c
+++ /dev/null
@@ -1,57 +0,0 @@
-main(argc,argv)
-char **argv;
-{
-char buf[512];
-int fold, fnew, n;
-char *p1, *p2, *bp;
-int mode;
-       if(argc != 3) {
-               write(1,"Usage: cp oldfile newfile\n",26);
-               exit();
-       }
-       if((fold = open(argv[1],0)) < 0){
-               write(1,"Cannot open old file.\n",22);
-               exit();
-       }
-       fstat(fold,buf);
-       mode = buf[2] & 037;
-       if((fnew = creat(argv[2],mode)) < 0){
-               stat(argv[2], buf);
-               if((buf[3] & 0100) != 0){
-                       p1 = argv[1] - 1;
-                       p2 = argv[2] - 1;
-                       bp = buf - 1;
-                       while(*++bp = *++p2);
-                       *bp = '/';
-                       p2 = bp;
-                       while(*++bp = *++p1)
-                               if(*bp == '/')
-                                       bp = p2;
-                       if((fnew = creat(buf,mode)) < 0){
-                               write(1,"Cannot creat new file.\n",23);
-                               exit();
-                       }
-               }else{
-               write(1,"Cannot creat new file.\n",23);
-               exit();
-               }
-       }
-       while(n = read(fold, buf, 512))
-       if(n < 0){
-               write(1,"Read error\n",11);
-               exit();
-       }else
-               if(write(fnew,buf,n) != n){
-                       write(1,"Write error.\n",13);
-                       exit();
-               }
-       fstat(fnew,buf);
-       exit();
-}
-
-                       p2 = argv[2] - 1;
-                       bp = buf - 1;
-                       while(*++bp = *++p2);
-                       *bp = '/';
-                       p2 = bp;
-                       while(*++bp
\ No newline at end of file
diff --git a/cmd/date.s b/cmd/date.s
deleted file mode 100644 (file)
index c0a1270..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/ get date -- date
-/ set date -- date mmddhhmm
-
-.globl ptime
-
-       cmp     (sp)+,$2
-       blt     prdate
-       tst     (sp)+
-       mov     (sp),r0
-       setd
-       seti
-       jsr     r5,tmul; 0
-       jsr     r5,tmul; 10.
-       movfi   fr1,r1          / months in r2
-       asl     r1
-       jsr     r5,tmul; 0
-       jsr     r5,tmul; 10.
-       movfi   fr1,r3          / days in r3
-       dec     r3
-       add     mtab-2(r1),r3
-       cmp     r1,$6           / march or later?
-       blt     1f
-       add     yr1972,r3       / leap year correction
-1:
-       mpy     $24.,r3         / days to hours
-       jsr     r5,tmul; 0
-       jsr     r5,tmul; 10.
-       movif   r3,fr0
-       addf    fr0,fr1         / total hours
-       jsr     r5,tmul; 6.
-       jsr     r5,tmul; 10.
-       movif   $3600.,fr0
-       mulf    fr0,fr1
-       tstb    (r0)
-       bne     error
-       setl
-       tst     yr1972
-       beq     1f
-       movif   yrtime,fr0
-       addf    fr0,fr1
-1:
-       movif   two,fr0
-       divf    fr0,fr1
-       movfi   fr1,-(sp)
-       mov     (sp)+,r0
-       mov     (sp)+,r1
-       alsc    $1,r0
-       sys     stime
-       br      1f
-
-prdate:
-       sys     time
-1:
-       alsc    $-8,r0
-       bic     $!377,r0
-       dvd     $20250.,r0
-       add     $0.,r0
-       mov     r0,r1
-       clr     r0
-       dvd     $7.,r0
-       mpy     $5.,r1
-       add     $days,r1
-       mov     r1,0f
-       mov     $1,r0
-       sys     write; 0:..; 5
-       sys     time
-       mov     $1,r2
-       jsr     pc,ptime
-       mov     $1,r0
-       sys     write; nl; 1
-       sys     exit
-
-error:
-       mov     $1,r0
-       sys     write; 1f; 2
-       sys     exit
-1:     <?>
-nl:    <\n>
-
-tmul:
-       movif   (r5)+,fr2
-       mulf    fr2,fr1
-       movb    (r0)+,r2
-       beq     error
-       sub     $'0,r2
-       cmp     r2,$10.
-       bhis    error
-       movif   r2,fr2
-       addf    fr2,fr1
-       rts     r5
-
-yrtime:
-       28872.; 4608.
-
-mtab:
-       0
-       31.
-       59.
-       90.
-       120.
-       151.
-       181.
-       212.
-       243.
-       273.
-       304.
-       334.
-0
-
-yr1972:        1
-two:   0; 2
-days:  <Sun \0>
-       <Mon \0>
-       <Tue \0>
-       <Wed \0>
-       <Thur >
-       <Fri \0>
-       <Sat \0>
-       .even
-r1,0f
-       mov     $1,r0
-       sys     write; 0:..; 5
-       sys     time
-       mov     $1,r2
-       jsr     pc,ptime
-       mov     $1,r0
-       sys     write; nl; 1
-       sys     exit
-
-error:
-       mov     $1,r0
-       sys     write; 1f; 2
-       sys     exit
-1:
\ No newline at end of file
diff --git a/cmd/db1.s b/cmd/db1.s
deleted file mode 100644 (file)
index c6ef59f..0000000
--- a/cmd/db1.s
+++ /dev/null
@@ -1,733 +0,0 @@
-/ db1 -- debugger
-
-fpp = 1
-eae = 0
-ldfps = 170100^tst
-
-db:
-       mov     sp,r5
-       mov     (r5)+,r4
-       tst     (r5)+
-       cmp     r4,$2
-       blt     1f
-       mov     (r5),dbfile
-       mov     (r5),odbfil
-       mov     (r5)+,namfil
-       cmp     r4,$2
-       beq     1f
-       mov     (r5)+,namfil
-1:
-       sys     open; dbfile: core; 0
-       bec     9f
-       jmp     fnfnd
-9:
-       mov     r0,dbfin
-       clr     dbfout
-       sys     open; odbfil:core; 1
-       bes     1f
-       mov     r0,dbfout
-1:
-       sys     open; namfil: a.out; 0
-       bes     1f
-       mov     r0,r1
-       sys     read; nambuf; 20
-       cmp     nambuf,objmagic
-       bne     1f
-       mov     nambuf+2,r0     / text
-       add     nambuf+4,r0     / data
-       cmp     nambuf+16,$1    / relocation?
-       beq     6f
-       asl     r0              / sym origin
-6:
-       add     $20,r0
-       mov     r0,0f
-       mov     r1,r0
-       sys     seek; 0:..; 0
-       mov     nambuf+10,r0    / symbol size
-       cmp     r0,$maxsym
-       blos    3f
-       mov     $maxsym,r0
-3:
-       add     r0,0f
-       sys     break; 0: nambuf
-       mov     r0,0f
-       mov     r1,r0
-       sys     read; nambuf; 0:..
-       add     $nambuf,r0
-       mov     r0,namsiz
-       mov     r1,r0
-       sys     close
-1:
-       jsr     r5,get; zero    / test new object
-       cmp     r0,$407         / br .+20
-       bne     1f
-       mov     $20,getoff
-1:
-       mov     sp,savsp
-       sys     intr; errexit
-       cmp     r4,$2           / arg count
-       beq     9f              / not core image
-       cmp     r4,$4           / no-core image flag
-       beq     9f
-       mov     dbfin,r0
-       sys     fstat; regbuf
-       mov     regbuf+6,r0
-       sub     $512.,r0
-       mov     r0,f.size
-       mov     dbfin,r0
-       sys     seek; -512.; 2
-       mov     dbfin,r0
-       sys     read; regbuf; 512.
-       mov     u.uusp, u.pusp
-       sub     u.core,u.break
-       .if     fpp
-       mov     u.sp,r0
-       sub     u.core,r0
-       mov     6*eae+512.+regbuf(r0),r0
-       bic     $!200,r0                / floating double mode
-       mov     r0,fpsr
-       beq     loop
-       mov     $fregnames+12,r0        / bias for double mode
-       mov     $4,r1
-2:
-       sub     r1,(r0)
-       add     $4,r1
-       add     $14,r0
-       cmp     r0,$ereg
-       blo     2b
-       .endif
-       br      loop
-9:
-       mov     $-1,u.break     / no remapping
-loop:
-       clr     error
-       jsr     pc,readlin
-       jsr     pc,readexp
-       tst     error
-       bne     errexit
-       mov     $1,count
-       cmpb    r0,$',
-       bne     2f
-       movb    (r4)+,r0
-       mov     addres,-(sp)
-       mov     adrflg,-(sp)
-       jsr     pc,readexp
-       mov     addres,count
-       mov     (sp)+,adrflg
-       mov     (sp)+,addres
-       tst     error
-       bne     errexit
-2:
-       movb    (r4),r0
-       jsr     pc,command
-       tst     error
-       beq     loop
-errexit:
-       mov     savsp,sp
-       jsr     r5,mesg; <?\n\0>; .even
-       br      loop
-
-fnfnd:
-       jsr     r5,mesg; <File not found.\n\0>; .even
-ex:
-       sys     exit
-
-readlin:
-       mov     $inbuf,r4
-1:
-       mov     ttyfin,r0
-       sys     read; ch; 1
-       tst     r0
-       beq     ex
-       cmpb    ch,$'\n
-       beq     1f
-       movb    ch,(r4)+
-       br      1b
-1:
-       clrb    (r4)
-       mov     $inbuf,r4
-       rts     pc
-
-switch:
-       mov     (r5)+,r1
-2:
-       cmp     r0,(r1)+
-       bne     1f
-       tst     (sp)+
-       jmp     *(r1)
-1:
-       tst     (r1)+
-       bne     2b
-       rts     r5
-
-readexp:
-       mov     $'+,lastop
-       clr     addres
-       clr     starmod
-       clr     taddr
-       clr     adrflg
-nextxp:
-       movb    (r4)+,r0
-       cmp     r0,$'0
-       blt     1f
-       cmp     r0,$'9
-       ble     numin
-       cmp     r0,$'a
-       blt     1f
-       cmp     r0,$'z
-       bgt     1f
-       jmp     letin
-1:
-       cmp     r0,$'a-40
-       blt     1f
-       cmp     r0,$'z-40
-       ble     letin
-1:
-       jsr     r5,switch; expsw
-       tstb    -(r4)
-       tst     starmod
-       beq     1f
-       mov     dot,taddr
-       br      operand
-1:
-       rts     pc
-
-expsw:
-       '+;     opex
-       '-;     opex
-       ' ;     nextxp
-       '.;     letin
-       '_;     letin
-       '^;     circumf
-       '*;     star
-       -1;     0
-
-star:
-       mov     pc,starmod
-       br      nextxp
-
-operand:
-       inc     adrflg
-       tst     starmod
-       beq     1f
-       clr     starmod
-       bis     bytemod,error
-       jsr     r5,get; taddr
-       tst     error
-       bne     1f
-       mov     r0,taddr
-1:
-       cmp     lastop,$'+
-       beq     1f
-       sub     taddr,addres
-       br      2f
-1:
-       add     taddr,addres
-2:
-       mov     $'+,lastop
-       br      nextxp
-
-circumf:
-       mov     dot,taddr
-       dec     taddr
-       tst     bytemod
-       bne     operand
-       dec     taddr
-       br      operand
-
-numin:
-       clr     r1
-       clr     r3
-1:
-       sub     $'0,r0
-       asl     r1
-       asl     r1
-       asl     r1
-       mpy     $10.,r3
-       bis     r0,r1
-       add     r0,r3
-       movb    (r4)+,r0
-       cmp     r0,$'0
-       blo     1f
-       cmp     r0,$'9
-       blos    1b
-1:
-       cmp     r0,$'.
-       bne     1f
-       mov     r3,r1
-       inc     r4
-1:
-       mov     r1,taddr
-       dec     r4
-       br      operand
-
-letin:
-       dec     r4
-       mov     $nambuf,namstrt
-letin1:
-       mov     $symbol,r1
-       clr     (r1)+
-       clr     (r1)+
-       clr     (r1)+
-       clr     (r1)
-       mov     $symbol,r1
-       mov     $8.,-(sp)
-       br      2f
-1:
-       tstb    (r4)+
-       cmpb    (r4),$'.
-       beq     2f
-       cmpb    (r4),$'0
-       blo     3f
-       cmpb    (r4),$'9
-       blos    2f
-       cmpb    (r4),$'a-40
-       blo     3f
-       cmpb    (r4),$'z-40
-       bhi     4f
-       bisb    $40,(r4)
-       br      2f
-4:
-       cmpb    (r4),$'_
-       beq     2f
-       cmpb    (r4),$'a
-       blo     3f
-       cmpb    (r4),$'z
-       bhi     3f
-2:
-       dec     (sp)
-       ble     1b
-       movb    (r4),(r1)+
-       br      1b
-3:
-       tst     (sp)+
-       jsr     pc,lookupn
-       tst     error
-       bne     1f
-       cmpb    (r4),$';
-       beq     2f
-1:
-       jmp     operand
-2:
-       tstb    (r4)+
-       mov     r1,namstrt
-       br      letin1
-
-opex:
-       mov     r0,lastop
-       jmp     nextxp
-
-
-command:
-       jsr     r5,switch; comsw
-       inc     error
-       rts     pc
-
-comsw:
-       '/;     slash
-       '\\;    bslash
-       '?;     quest
-       '\0;    newln
-       '^;     circumf
-       '=;     equal
-       ':;     colon
-       '!;     excla
-       '';     squote
-       '";     dquote
-       '$;     dolr
-       '&;     amper
-       '%;     ex
-       '`;     grave
-       -1;     0
-
-dolr:
-       mov     u.savps,r1
-       bic     $!17,r1
-       asl     r1
-       mov     traptab(r1),r1
-       jsr     pc,string
-       jsr     pc,pnl
-       mov     $doltab,r5
-       mov     $u.pusp+2,r4
-1:
-       mov     (r5)+,r1
-       beq     1f
-       jsr     pc,*(r5)+
-       br      1b
-       .if     fpp
-1:
-       mov     (r5)+,r1
-       beq     1f
-       ldfps   fpsr
-       jsr     pc,*(r5)+
-       br      1b
-1:
-       mov     (r5)+,r1
-       jsr     pc,*(r5)+
-       .endif
-       .if eae
-1:
-       mov     (r5)+,r1
-       beq     1f
-       jsr     pc,*(r5)+
-       br      1b
-       .endif
-1:
-       rts     pc
-
-traptab:
-       1f; .data; 1:<?0\0>; .text
-       1f; .data; 1:<bus\0>; .text
-       1f; .data; 1:<ill inst\0>; .text
-       1f; .data; 1:<trace or bpt\0>; .text
-       1f; .data; 1:<iot\0>; .text
-       1f; .data; 1:<power fail\0>; .text
-       1f; .data; 1:<emt\0>; .text
-       1f; .data; 1:<bad sys call\0>; .text
-       1f; .data; 1:<programmed interrupt\0>; .text
-       1f; .data; 1:<FP exception\0>; .text
-       1f; .data; 1:<memory fault\0>; .text
-       1f; .data; 1:<quit\0>; .text
-       1f; .data; 1:<interrupt\0>; .text
-       1f; .data; 1:<killed\0>; .text
-       1f; .data; 1:<?16\0>; .text
-       1f; .data; 1:<?17\0>; .text
-
-doltab:
-       1f; prgreg; .data; 1:<sp        \0>; .text
-       1f; proct; .data; 1:<ps \0>; .text
-       1f; prgreg; .data; 1:<pc        \0>; .text
-       1f; prgreg; .data; 1:<r0        \0>; .text
-       1f; prgreg; .data; 1:<r1        \0>; .text
-       1f; prgreg; .data; 1:<r2        \0>; .text
-       1f; prgreg; .data; 1:<r3        \0>; .text
-       1f; prgreg; .data; 1:<r4        \0>; .text
-       1f; prgreg; .data; 1:<r5        \0>; .text
-       0
-       .if     fpp
-       1f; prfreg; .data; 1:<fr0       \0>; .text
-       1f; prfreg; .data; 1:<fr1       \0>; .text
-       1f; prfreg; .data; 1:<fr2       \0>; .text
-       1f; prfreg; .data; 1:<fr3       \0>; .text
-       1f; prfreg; .data; 1:<fr4       \0>; .text
-       1f; prfreg; .data; 1:<fr5       \0>; .text
-       0
-       1f; proct; .data; 1:<fpsr       \0>; .text
-       .endif
-       .if     eae
-       1f; proct; .data; 1:<sc \0>; .text
-       1f; proct; .data; 1:<ac \0>; .text
-       1f; proct; .data; 1:<mq \0>; .text
-       0
-       .endif
-
-.data
-.even
-.text
-
-       .if     fpp
-prfreg:
-       movf    -(r4),fr0
-       cfcc
-       beq     1f
-       jsr     pc,string
-       jsr     pc,printf
-       jsr     pc,pnl
-1:
-       rts     pc
-       .endif
-
-prgreg:
-       jsr     pc,string
-       mov     -(r4),r0
-       jsr     pc,printo
-       mov     (r4),r0
-       jsr     pc,lookupv
-       tst     r2
-       beq     1f
-       jsr     r5,mesg; <      \0>; .even
-       mov     (r4),r0
-       jsr     pc,pname
-1:
-       jsr     pc,pnl
-       rts     pc
-
-proct:
-       jsr     pc,string
-       mov     -(r4),r0
-       jsr     pc,printo
-       jsr     pc,pnl
-       rts     pc
-
-string:
-       movb    (r1)+,r0
-       beq     1f
-       jsr     pc,putc
-       br      string
-1:
-       rts     pc
-
-putc:
-       mov     r0,och
-       mov     $1,r0
-       sys     write; och; 1
-       rts     pc
-
-equal:
-       jsr     r5,coleq; printo
-       rts     pc
-amper:
-       clr     bytemod
-       mov     $2,incdot
-       jsr     r5,cycle; asymp
-       rts     pc
-
-asymp:
-       jsr     pc,pname
-       jsr     pc,pnl
-       rts     pc
-
-bslash:
-       inc     bytemod
-       mov     $1,incdot
-       br      1f
-
-slash:
-       clr     bytemod
-       mov     $2,incdot
-1:
-       jsr     r5,cycle; octp
-       rts     pc
-
-grave:
-       clr     bytemod
-       mov     $2,incdot
-       jsr     r5,cycle;  decp
-       rts     pc
-
-quest:
-       clr     bytemod
-       jsr     r5,cycle; psym
-       rts     pc
-
-decp:
-       jsr     pc,printd
-       jsr     r5,mesg; <.\n\0>; .even
-       rts     pc
-
-octp:
-       jsr     pc,printo
-       jsr     pc,pnl
-       rts     pc
-
-newln:
-       tst     adrflg
-       bne     1f
-       add     incdot,dot
-1:
-       mov     nlcom,r0
-       jmp     command
-
-excla:
-       tst     adrflg
-       bne     1f
-2:
-       inc     error
-       rts     pc
-1:
-       bit     $1,dot
-       beq     1f
-       tst     bytemod
-       beq     2b
-1:
-       jsr     r5,put; dot; addres
-       rts     pc
-
-squote:
-       inc     bytemod
-       mov     $1,incdot
-       br      2f
-dquote:
-       clr     bytemod
-       mov     $2,incdot
-2:
-       jsr     r5,cycle; ascp
-       rts     pc
-
-ascp:
-       mov     r0,-(sp)
-       jsr     pc,ascp1
-       mov     (sp)+,r0
-       tst     bytemod
-       bne     1f
-       swab    r0
-       jsr     pc,ascp1
-1:
-       cmp     count,$1
-       bgt     1f
-       jsr     pc,pnl
-1:
-       rts     pc
-
-ascp1:
-       bic     $!377,r0
-       cmp     r0,$'\n
-       beq     2f
-       cmp     r0,$011
-       beq     2f
-       cmp     r0,$40
-       blo     1f
-       cmp     r0,$177
-       bhis    1f
-2:
-       jsr     pc,putc
-       rts     pc
-1:
-       mov     r0,r1
-       jsr     r5,mesg; <\\\0>
-       clr     r0
-       alsc    $10.,r0
-       add     $'0,r0
-       jsr     pc,putc
-       clr     r0
-       alsc    $3,r0
-       add     $'0,r0
-       jsr     pc,putc
-       clr     r0
-       alsc    $3,r0
-       add     $'0,r0
-       jsr     pc,putc
-       rts     pc
-
-colon:
-       jsr     r5,coleq; pname
-       rts     pc
-
-coleq:
-       jsr     pc,setadr
-       mov     addres,r0
-       jsr     pc,*(r5)+
-       jsr     pc,pnl
-       rts     r5
-
-cycle:
-       mov     r0,nlcom
-       jsr     pc,setadr
-       mov     addres,dot
-       tst     bytemod
-       bne     1f
-       bic     $1,dot
-1:
-       jsr     r5,get; dot
-       tst     error
-       bne     1f
-       tst     bytemod
-       beq     2f
-       bic     $!377,r0
-2:
-       jsr     pc,*(r5)
-       tst     error
-       bne     1f
-       dec     count
-       ble     1f
-       add     incdot,dot
-       br      1b
-1:
-       tst     (r5)+
-       rts     r5
-
-setadr:
-       tst     adrflg
-       bne     1f
-       mov     dot,addres
-1:
-       rts     pc
-
-       .if     fpp
-printf:
-       ldfps   $200            / round+double
-       mov     r4,-(sp)
-       mov     r3,-(sp)
-       movif   $10.,r3
-       movif   $1,r2
-       clr     r4
-       tstf    r0
-       cfcc
-       beq     2f
-       bge     1f
-       negf    r0
-       mov     $'-,r0
-       jsr     pc,putc
-1:
-       cmpf    r3,r0
-       cfcc
-       bgt     1f
-       inc     r4
-       divf    r3,r0
-       br      1b
-1:
-       cmpf    r2,r0
-       cfcc
-       ble     2f
-       dec     r4
-       mulf    r3,r0
-       br      1b
-2:
-       modf    r2,r0
-       movfi   r1,r0
-       add     $'0,r0
-       jsr     pc,putc
-       mov     $'.,r0
-       jsr     pc,putc
-       mov     $8.,r3
-1:
-       modf    r3,r0
-       movfi   r1,r0
-       add     $'0,r0
-       jsr     pc,putc
-       dec     r3
-       bgt     1b
-       mov     $'E,r0
-       jsr     pc,putc
-       mov     r4,r0
-       mov     (sp)+,r3
-       mov     (sp)+,r4
-       br      printd
-       .endif
-
-printd:
-       mov     r1,-(sp)
-       mov     r0,r1
-       bpl     1f
-       neg     r1
-       mov     $'-,r0
-       jsr     pc,putc
-1:
-       jsr     pc,1f
-       mov     (sp)+,r1
-       rts     pc
-1:
-       clr     r0
-       dvd     $10.,r0
-       mov     r1,-(sp)
-       mov     r0,r1
-       beq     1f
-       jsr     pc,1b
-1:
-       mov     (sp)+,r0
-       add     $'0,r0
-       jsr     pc,putc
-       rts     pc
-
-cfcc
-       ble     2f
-       dec     r4
-       mulf    r3,r0
-       br      1b
-2:
-       modf    r2,r0
-       movfi   r1,r0
-       add     $'0,r0
-       jsr     pc,putc
-       mov     $'.,r0
-       j
\ No newline at end of file
diff --git a/cmd/db2.s b/cmd/db2.s
deleted file mode 100644 (file)
index d91d2ba..0000000
--- a/cmd/db2.s
+++ /dev/null
@@ -1,373 +0,0 @@
-/ db2 -- debugger
-
-lookupn:
-       cmp     symbol,$'.
-       bne     1f
-       mov     dot,taddr
-       rts     pc
-1:
-       tst     error
-       beq     1f
-       rts     pc
-1:
-       mov     r2,-(sp)
-       mov     $regnames,r1
-       mov     $ereg,r2
-       jsr     pc,1f
-       tst     error
-       beq     2f
-       clr     error
-       mov     namstrt,r1
-       mov     namsiz,r2
-       jsr     pc,1f
-2:
-       mov     (sp)+,r2
-       rts     pc
-1:
-       mov     $symbol,r0
-       cmp     (r0)+,(r1)+
-       bne     2f
-       cmp     (r0)+,(r1)+
-       bne     3f
-       cmp     (r0)+,(r1)+
-       bne     4f
-       cmp     (r0)+,(r1)+
-       bne     5f
-       tst     (r1)+
-       mov     (r1)+,taddr
-       rts     pc
-2:
-       tst     (r1)+
-3:
-       tst     (r1)+
-4:
-       tst     (r1)+
-5:
-       cmp     (r1)+,(r1)+
-       cmp     r1,r2
-       blo     1b
-       inc     error
-       clr     taddr
-       rts     pc
-
-lookupv:
-       mov     r5,-(sp)
-       mov     $nambuf,r5
-       clr     r2
-       mov     $177777,r3
-1:
-       cmp     r5,namsiz
-       bhis    4f
-       mov     12(r5),r1
-       sub     r0,r1
-       neg     r1
-       blt     3f
-       cmp     r1,r3
-       bhi     3f
-       cmp     r1,$4000
-       bhis    3f
-       cmp     r2,r5
-       bhi     3f
-       mov     r1,r3
-       mov     r5,r2
-3:
-       add     $14,r5
-       br      1b
-4:
-       mov     (sp)+,r5
-       rts     pc
-
-get:
-       mov     *(r5)+,r0
-       add     getoff,r0
-       jsr     r5,remap
-               br 3f
-       mov     r0,0f
-       mov     dbfin,r0
-       sys     seek; 0:0; 0
-       bec     1f
-2:
-       inc     error
-       rts     r5
-1:
-       mov     dbfin,r0
-       sys     read; temp; 2
-       bes     2b
-       tst     r0
-       beq     2b
-       mov     temp,r0
-       rts     r5
-3:
-       clr     -(sp)
-       movb    (r0),(sp)
-       movb    1(r0),1(sp)
-       mov     (sp)+,r0
-       rts     r5
-
-remap:
-       cmp     r0,u.break
-       blo     1f
-       cmp     r0,u.uusp
-       blo     2f
-       cmp     r0,$160000
-       bhis    3f
-       sub     u.uusp,r0
-       add     u.break,r0
-       br      1f
-3:
-       sub     $160000,r0
-       cmp     r0,$512.+2
-       bhis    2f
-       add     $regbuf,r0
-       rts     r5
-1:
-       tst     (r5)+
-       rts     r5
-2:
-       inc     error
-       rts     r5
-
-printo:
-       mov     $obuf+6,r1
-       clr     r2
-1:
-       inc     r2
-       movb    r0,-(r1)
-       bicb    $!7,(r1)
-       bisb    $'0,(r1)
-       clc
-       ror     r0
-       asr     r0
-       asr     r0
-       bne     1b
-       mov     r2,0f+2
-       mov     r1,0f
-       mov     $1,r0
-       sys     write; 0:obuf; 6
-       rts     pc
-
-mesg:
-       movb    (r5)+,r0
-       beq     1f
-       jsr     pc,putc
-       br      mesg
-1:
-       inc     r5
-       bic     $1,r5
-       rts     r5
-
-pnl:
-       jsr     r5,mesg; <\n\0>
-       rts     pc
-
-psp:
-       jsr     r5,mesg; < \0>
-       rts     pc
-
-pstar:
-       jsr     r5,mesg; <*\0>
-       rts     pc
-
-plp:
-       jsr     r5,mesg; <(\0>
-       rts     pc
-
-prp:
-       jsr     r5,mesg; <)\0>
-       rts     pc
-
-pb:
-       jsr     r5,mesg; <b\0>
-       rts     pc
-
-pcom:
-       jsr     r5,mesg; <,\0>
-       rts     pc
-
-put:
-       mov     *(r5)+,r0
-       add     getoff,r0
-       jsr     r5,remap
-               br 3f
-       mov     r0,0f
-       mov     dbfout,r0
-       bne     1f
-2:
-       tst     (r5)+
-3:
-       inc     error
-       rts     r5
-1:
-       tst     error
-       bne     3b
-       sys     seek; 0:0; 0
-       bes     2b
-       mov     (r5)+,0f
-       mov     dbfout,r0
-       tst     bytemod
-       beq     1f
-       mov     $1,0f+2
-       br      2f
-1:
-       mov     $2,0f+2
-2:
-       sys     write; 0:0; 2
-       bes     3b
-       rts     r5
-
-decodadr:
-       mov     r0,r3
-       mov     r3,-(sp)
-       bic     $!10,(sp)
-       bic     $!7,r0
-       cmp     r0,$7
-       beq     pcadr
-7:
-       mov     r3,r0
-       asr     r0
-       asr     r0
-       asr     r0
-       bic     $!6,r0
-       jmp     *1f(r0)
-
-1:
-       simp
-       incr
-       decr
-       indx
-
-simp:
-       tst     (sp)
-       beq     1f
-       jsr     pc,plp
-1:
-       jsr     pc,preg
-       tst     (sp)+
-       beq     9f
-       jsr     pc,prp
-       br      9f
-
-incr:
-       tst     (sp)+
-       beq     1f
-       jsr     pc,pstar
-1:
-       jsr     pc,plp
-       jsr     pc,preg
-       jsr     r5,mesg; <)+\0>; .even
-       br      9f
-
-decr:
-       tst     (sp)+
-       beq     1f
-       jsr     pc,pstar
-1:
-       jsr     r5,mesg; <-(\0>; .even
-       jsr     pc,preg
-       jsr     pc,prp
-       br      9f
-
-indx:
-       tst     (sp)+
-       beq     1f
-       jsr     pc,pstar
-1:
-       jsr     pc,get1
-       jsr     pc,pname
-       jsr     pc,plp
-       jsr     pc,preg
-       jsr     pc,prp
-       br      5f
-
-pcadr:
-       mov     r3,r0
-       bit     $20,r3
-       beq     7b
-       tst     (sp)+
-       beq     1f
-       jsr     pc,pstar
-1:
-       bit     $40,r3
-       bne     6f
-       jsr     r5,mesg; <$\0>
-       jsr     pc,get1
-       jsr     pc,pname
-       br      5f
-6:
-       jsr     pc,get1
-       add     $2,r0
-       add     r1,r0
-       mov     $3,r1
-       jsr     pc,pname
-       br      5f
-9:
-       tst     (r5)+
-       clr     r0
-       rts     r5
-5:
-       mov     $2,r0
-       rts     r5
-
-preg:
-       mov     r3,r0
-       bic     $!7,r0
-       asl     r0
-       mov     regtab(r0),obuf
-       mov     $1,r0
-       sys     write; obuf; 2
-       rts     pc
-
-regtab:
-       "r0
-       "r1
-       "r2
-       "r3
-       "r4
-       "r5
-       "sp
-       "pc
-
-pname:
-       mov     r5,-(sp)
-       mov     r3,-(sp)
-       mov     r1,-(sp)
-       jsr     pc,lookupv
-       tst     r2
-       beq     5f
-       cmp     (sp),$1
-       bne     1f
-       tst     r3
-       bne     5f
-1:
-       mov     r2,r1
-       mov     r0,r5
-       jsr     pc,string
-       cmp     12(r2),r5
-       beq     1f
-       blt     2f
-       jsr     r5,mesg; <-\0>
-       br      3f
-2:
-       jsr     r5,mesg; <+\0>
-3:
-       mov     r3,r0
-5:
-       jsr     pc,printo
-1:
-       tst     (sp)+
-       mov     (sp)+,r3
-       mov     (sp)+,r5
-       rts     pc
-
-get1:
-       mov     *(r5)+,r1
-       add     $2,r1
-       mov     r1,temp
-       jsr     r5,get; temp
-       rts     pc
-
-       asl     r0
-       mov     regtab(r0),obuf
-       mov     $1,r0
-       sys     write; obuf; 2
-       rts     pc
\ No newline at end of file
diff --git a/cmd/db3.s b/cmd/db3.s
deleted file mode 100644 (file)
index 8a91cca..0000000
--- a/cmd/db3.s
+++ /dev/null
@@ -1,334 +0,0 @@
-/ db3 -- debugger
-
-psym:
-       mov     $2,incdot
-       jsr     pc,prints
-       jsr     pc,pnl
-       rts     pc
-
-prints:
-       mov     r0,-(sp)
-       mov     $optab,r1
-1:
-       mov     (sp),r0
-       bic     (r1)+,r0
-       cmp     (r1)+,r0
-       bne     2f
-       mov     (r1)+,-(sp)
-       jsr     pc,string
-       jmp     *(sp)+
-2:
-       add     $8.,r1
-       br      1b
-
-optab:
-       107777; 010000; double; <mov\0\0\0>
-       107777; 020000; double; <cmp\0\0\0>
-       107777; 030000; double; <bit\0\0\0>
-       107777; 040000; double; <bic\0\0\0>
-       107777; 050000; double; <bis\0\0\0>
-       007777; 060000; double; <add\0\0\0>
-       007777; 160000; double; <su\0\0\0\0>
-
-       100077; 005000; single; <clr\0\0\0>
-       100077; 005100; single; <com\0\0\0>
-       100077; 005200; single; <inc\0\0\0>
-       100077; 005300; single; <dec\0\0\0>
-       100077; 005400; single; <neg\0\0\0>
-       100077; 005500; single; <adc\0\0\0>
-       100077; 005600; single; <sbc\0\0\0>
-       100077; 005700; single; <tst\0\0\0>
-       100077; 006000; single; <ror\0\0\0>
-       100077; 006100; single; <rol\0\0\0>
-       100077; 006200; single; <asr\0\0\0>
-       100077; 006300; single; <asl\0\0\0>
-       000077; 000100; single; <jmp\0\0\0>
-       000077; 000300; single; <swab\0\0>
-       000077; 170100; singlw; <ldfps\0>
-       000077; 170200; singlw; <stfps\0>
-       000077; 170300; singlw; <stst\0\0>
-       000077; 170400; singlw; <clrf\0\0>
-       000077; 170500; singlw; <tstf\0\0>
-       000077; 170600; singlw; <absf\0\0>
-       000077; 170700; singlw; <negf\0\0>
-       000077; 006700; singlw; <sxt\0\0\0>
-       000077; 006600; singlw; <mtpi\0\0>
-       000077; 106600; singlw; <mtpd\0\0>
-       000077; 006500; singlw; <mfpi\0\0>
-       000077; 106500; singlw; <mfpd\0\0>
-       000777; 070000; muldiv; <mul\0\0\0>
-       000777; 071000; muldiv; <div\0\0\0>
-       000777; 072000; muldiv; <ash\0\0\0>
-       000777; 073000; muldiv; <ashc\0\0>
-
-       000377; 000400; branch; <br\0\0\0\0>
-       000377; 001000; branch; <bne\0\0\0>
-       000377; 001400; branch; <beq\0\0\0>
-       000377; 002000; branch; <bge\0\0\0>
-       000377; 002400; branch; <blt\0\0\0>
-       000377; 003000; branch; <bgt\0\0\0>
-       000377; 003400; branch; <ble\0\0\0>
-       000377; 100000; branch; <bpl\0\0\0>
-       000377; 100400; branch; <bmi\0\0\0>
-       000377; 101000; branch; <bhi\0\0\0>
-       000377; 101400; branch; <blos\0\0>
-       000377; 102000; branch; <bvc\0\0\0>
-       000377; 102400; branch; <bvs\0\0\0>
-       000377; 103000; branch; <bhis\0\0>
-       000377; 103400; branch; <blo\0\0\0>
-
-       000000; 000000; noaddr; <halt\0\0>
-       000000; 000001; noaddr; <wait\0\0>
-       000000; 000002; noaddr; <rti\0\0\0>
-       000000; 000004; noaddr; <iot\0\0\0>
-       000000; 000005; noaddr; <reset\0>
-
-       000377; 171000; fltrev; <mulf\0\0>
-       000377; 171400; fltrev; <modf\0\0>
-       000377; 172000; fltrev; <addf\0\0>
-       000377; 172400; fltrev; <movf\0\0>
-       000377; 173000; fltrev; <subf\0\0>
-       000377; 173400; fltrev; <cmpf\0\0>
-       000377; 174000; fltnor; <movf\0\0>
-       000377; 174400; fltrev; <divf\0\0>
-       000377; 175000; fltnor; <movei\0>
-       000377; 175400; fltnor; <movfi\0>
-       000377; 176000; fltnor; <movfo\0>
-       000377; 176400; fltrev; <movie\0>
-       000377; 177000; fltrev; <movif\0>
-       000377; 177400; fltrev; <movof\0>
-       000000; 170000; noaddr; <cfcc\0\0>
-       000000; 170001; noaddr; <setf\0\0>
-       000000; 170002; noaddr; <seti\0\0>
-       000000; 170011; noaddr; <setd\0\0>
-       000000; 170012; noaddr; <setl\0\0>
-
-       000777; 004000; specl1; <jsr\0\0\0>
-       000777; 074000; specl1; <xor\0\0\0>
-       000007; 000200; specl2; <rts\0\0\0>
-       000017; 000240; specl3; <cflg\0\0>
-       000017; 000260; specl3; <sflg\0\0>
-       000377; 104000; specl4; <emt\0\0\0>
-       000377; 104400; specl5; <sys\0\0\0>
-       000077; 006400; specl7; <mark\0\0>
-       000777; 077000; specl8; <sob\0\0\0>
-       000007; 000230; specl9; <spl\0\0\0>
-       177777; 000000; specl6; <oct\0\0\0>
-
-fltrev:
-       bic     $!377,(sp)
-muldiv:
-       jsr     pc,psp
-       mov     (sp)+,r0
-       asl     r0
-       asl     r0
-       swab    r0
-       aslb    r0
-       aslb    r0
-       aslb    r0
-       aslb    r0
-       asr     r0
-       asr     r0
-       asr     r0
-       asr     r0
-       bic     $!7707,r0
-       mov     r0,-(sp)
-       br      fltnor1
-
-fltnor:
-       bic     $!377,(sp)
-       br      1f
-
-double:
-       tst     (sp)
-       bge     1f
-       jsr     pc,pb
-1:
-       jsr     pc,psp
-       mov     (sp),r0
-fltnor1:
-       als     $-6,r0
-       jsr     r5,decodadr; dot
-       add     r0,incdot
-       add     dot,r0
-       mov     r0,temp
-       jsr     pc,pcom
-       mov     (sp)+,r0
-       jsr     r5,decodadr; temp
-       add     r0,incdot
-       rts     pc
-
-single:
-       tst     (sp)
-       bge     singlw
-       jsr     pc,pb
-singlw:
-       jsr     pc,psp
-       mov     (sp)+,r0
-       jsr     r5,decodadr; dot
-       add     r0,incdot
-       rts     pc
-
-specl8: / sob
-       jsr     pc,psp
-       mov     (sp),r3
-       als     $-6,r3
-       jsr     pc,preg
-       jsr     pc,pcom
-       mov     (sp)+,r0
-       bic     $!77,r0
-       neg     r0
-       br      1f
-
-branch:
-       jsr     pc,psp
-       mov     (sp)+,r0
-       bic     $!377,r0
-       bit     $200,r0
-       beq     1f
-       bis     $177400,r0
-1:
-       inc     r0
-       asl     r0
-       add     dot,r0
-       jsr     pc,pname
-       rts     pc
-
-noaddr:
-       tst     (sp)+
-       rts     pc
-
-specl1: / jsr
-       jsr     pc,psp
-       mov     (sp),r3
-       als     $-6,r3
-       jsr     pc,preg
-       jsr     pc,pcom
-       mov     (sp)+,r0
-       jsr     r5,decodadr; dot
-       add     r0,incdot
-       rts     pc
-
-specl2: / rts
-       jsr     pc,psp
-       mov     (sp)+,r3
-       jsr     pc,preg
-       rts     pc
-
-specl3: / opr
-       jsr     pc,psp
-       mov     (sp)+,r2
-       mov     $3f,r1
-1:
-       bit     $17,r2
-       beq     1f
-       bit     $10,r2
-       beq     2f
-       movb    (r1),r0
-       jsr     pc,putc
-2:
-       inc     r1
-       asl     r2
-       br      1b
-1:
-       rts     pc
-3:
-       <nzvc>
-
-specl7: / mark
-       bic     $!77,(sp)
-       br      specl4
-
-specl9: / spl
-       bic     $!7,(sp)
-       br      specl4
-
-specl4: / emt
-       jsr     pc,psp
-       mov     (sp)+,r0
-       bic     $!377,r0
-8:
-       jsr     pc,printo
-       rts     pc
-
-specl5: / sys
-       jsr     pc,psp
-       mov     (sp)+,r2
-       bic     $!377,r2
-       mov     r2,r0
-       asl     r2
-       asl     r2
-       cmp     r2,$esystab-systab
-       bhis    8b
-       mov     systab(r2),r1
-       jsr     pc,string
-       mov     systab+2(r2),-(sp)
-       mov     dot,temp1
-1:
-       dec     (sp)
-       bge     2f
-       tst     (sp)+
-       rts     pc
-2:
-       jsr     r5,mesg; <;\0>
-       add     $2,temp1
-       add     $2,incdot
-       jsr     r5,get; temp1
-       jsr     pc,pname
-       br      1b
-
-systab:
-       1f; 0; .data; 1:<rele\0>; .text
-       1f; 0; .data; 1:<exit\0>; .text
-       1f; 0; .data; 1:<fork\0>; .text
-       1f; 2; .data; 1:<read\0>; .text
-       1f; 2; .data; 1:<write\0>; .text
-       1f; 2; .data; 1:<open\0>; .text
-       1f; 0; .data; 1:<close\0>; .text
-       1f; 0; .data; 1:<wait\0>; .text
-       1f; 2; .data; 1:<creat\0>; .text
-       1f; 2; .data; 1:<link\0>; .text
-       1f; 1; .data; 1:<unlink\0>; .text
-       1f; 2; .data; 1:<exec\0>; .text
-       1f; 1; .data; 1:<chdir\0>; .text
-       1f; 0; .data; 1:<time\0>; .text
-       1f; 1; .data; 1:<makdir\0>; .text
-       1f; 2; .data; 1:<chmod\0>; .text
-       1f; 2; .data; 1:<chown\0>; .text
-       1f; 1; .data; 1:<break\0>; .text
-       1f; 2; .data; 1:<stat\0>; .text
-       1f; 2; .data; 1:<seek\0>; .text
-       1f; 2; .data; 1:<tell\0>; .text
-       1f; 2; .data; 1:<mount\0>; .text
-       1f; 1; .data; 1:<umount\0>; .text
-       1f; 0; .data; 1:<setuid\0>; .text
-       1f; 0; .data; 1:<getuid\0>; .text
-       1f; 0; .data; 1:<stime\0>; .text
-       1f; 1; .data; 1:<quit\0>; .text
-       1f; 1; .data; 1:<intr\0>; .text
-       1f; 1; .data; 1:<fstat\0>; .text
-       1f; 1; .data; 1:<emt\0>; .text
-       1f; 1; .data; 1:<smdate\0>; .text
-       1f; 1; .data; 1:<stty\0>; .text
-       1f; 1; .data; 1:<gtty\0>; .text
-       1f; 1; .data; 1:<ilgins\0>; .text
-       1f; 0; .data; 1:<hog\0>; .text
-       1f; 0; .data; 1:<sleep\0>; .text
-       1f; 0; .data; 1:<sync\0>; .text
-       1f; 0; .data; 1:<kill\0>; .text
-       1f; 0; .data; 1:<switches\0>; .text
-       1f; 0; .data; 1:<boot\0>; .text
-esystab:
-.data
-.even
-.text
-
-specl6: / unknown
-       jsr     pc,psp
-       mov     (sp)+,r0
-       jsr     pc,printo
-       rts     pc
-tr\0>; .text
-       1f; 1; .data; 1:<fstat\0>; .text
-       1f; 1; .data; 1:<emt\0>; .text
-       1
\ No newline at end of file
diff --git a/cmd/db4.s b/cmd/db4.s
deleted file mode 100644 (file)
index 7828e7c..0000000
--- a/cmd/db4.s
+++ /dev/null
@@ -1,107 +0,0 @@
-/ db4 -- debugger
-
-maxsym = 24000.
-core:
-   <core\0>
-a.out:
-   <a.out\0>
-.even
-zero:  0
-.bss
-regbuf:
-       u.sp:   .=.+2
-       u.usp:  .=.+2
-       u.uusp: .=.+2
-       u.break:.=.+2
-       u.r0:   .=.+2
-       u.savps:.=.+2
-       u.core: .=.+2
-       .=regbuf+512.
-       u.pusp: .=.+2
-.data
-objmagic: br .+20
-namsiz:        nambuf
-incdot: 2
-nlcom: '/
-
-regnames:
-       <sp\0\0\0\0\0\0>; 1; 161000
-       <ps\0\0\0\0\0\0>; 1; 160776
-       <pc\0\0\0\0\0\0>; 1; 160774
-       <r0\0\0\0\0\0\0>; 1; 160772
-       <r1\0\0\0\0\0\0>; 1; 160770
-       <r2\0\0\0\0\0\0>; 1; 160766
-       <r3\0\0\0\0\0\0>; 1; 160764
-       <r4\0\0\0\0\0\0>; 1; 160762
-       <r5\0\0\0\0\0\0>; 1; 160760
-.if fpp
-fregnames:
-       <fr0\0\0\0\0\0>; 1; 160754
-       <fr1\0\0\0\0\0>; 1; 160750
-       <fr2\0\0\0\0\0>; 1; 160744
-       <fr3\0\0\0\0\0>; 1; 160740
-       <fr4\0\0\0\0\0>; 1; 160734
-       <fr5\0\0\0\0\0>; 1; 160730
-.endif
-ereg:
-
-       .bss
-
-starmod:.=.+2
-symbol:        .=.+10.
-getoff:        .=.+2
-namstrt: .=.+2
-bytemod: .=.+2
-savsp: .=.+2
-error: .=.+2
-ttyfin: .=.+2
-dbfin: .=.+2
-dbfout: .=.+2
-ch: .=.+2
-lastop: .=.+2
-addres: .=.+2
-taddr: .=.+2
-adrflg: .=.+2
-f.size:        .=.+2
-fpsr:  .=.+2
-och:   .=.+2
-dot: .=.+2
-count: .=.+2
-syscnt: .=.+2
-temp: .=.+2
-temp1: .=.+2
-obuf: .=.+8.
-ecore = db+8192.
-inbuf: .=.+128.
-nambuf:        .=.+20
-
- 1; 160750
-       <fr2\0\0\0\0\0>; 1; 160744
-       <fr3\0\0\0\0\0>; 1; 160740
-       <fr4\0\0\0\0\0>; 1; 160734
-       <fr5\0\0\0\0\0>; 1; 160730
-.endif
-ereg:
-
-       .bss
-
-starmod:.=.+2
-symbol:        .=.+10.
-getoff:        .=.+2
-namstrt: .=.+2
-bytemod: .=.+2
-savsp: .=.+2
-error: .=.+2
-ttyfin: .=.+2
-dbfin: .=.+2
-dbfout: .=.+2
-ch: .=.+2
-lastop: .=.+2
-addres: .=.+2
-taddr: .=.+2
-adrflg: .=.+2
-f.size:        .=.+2
-fpsr:  .=.+2
-och:   .=.+2
-dot: .=.+2
-c
\ No newline at end of file
diff --git a/cmd/df.s b/cmd/df.s
deleted file mode 100644 (file)
index 3d150d0..0000000
--- a/cmd/df.s
+++ /dev/null
@@ -1,99 +0,0 @@
-/ df -- find free space
-
-       cmp     (sp)+,$1
-       bgt     1f
-       mov     $rf0,0f
-       jsr     pc,df
-       mov     $1,r0
-       sys     write; plus; 1
-       mov     $rk1,0f
-       jsr     pc,df
-       mov     $1,r0
-       sys     write; plus; 1
-       mov     $rk2,0f
-       jsr     pc,df
-       mov     $1,r0
-       sys     write; plus; 1
-       mov     $rk3,0f
-       jsr     pc,df
-       mov     $1,r0
-2:
-       mov     $1,r0
-       sys     write; nl; 1
-       sys     exit
-
-1:
-       tst     (sp)+
-       mov     (sp)+,0f
-       jsr     pc,df
-       br      2b
-
-df:
-       clr     r3
-       sys     36.
-       sys     open; 0:..; 0
-       bes     9f
-       sys     read; nfree; 1024.
-       mov     $freeb,r1
-       mov     nfree,r2
-       asr     r2
-1:
-       mov     $16.,r4
-       mov     (r1)+,r5
-2:
-       rol     r5
-       adc     r3
-       dec     r4
-       bne     2b
-       dec     r2
-       bgt     1b
-9:
-       clr     r2
-       dvd     $10.,r2
-       mov     r3,-(sp)
-       mov     r2,r3
-       beq     2f
-       jsr     pc,9b
-2:
-       movb    (sp)+,ch
-       add     $'0,ch
-       mov     $1,r0
-       sys     write; ch; 1
-       rts     pc
-
-rf0:   </dev/rf0\0>
-rk0:   </dev/rk0\0>
-rk1:   </dev/rk1\0>
-rk2:   </dev/rk2\0>
-rk3:   </dev/rk3\0>
-plus:  <+>
-nl:    <\n>
-       .even
-
-       .bss
-ch:    .=.+2
-nfree: .=.+2
-freeb: .=.+1022.
-
-0f
-       jsr     pc,df
-       br      2b
-
-df:
-       clr     r3
-       sys     36.
-       sys     open; 0:..; 0
-       bes     9f
-       sys     read; nfree; 1024.
-       mov     $freeb,r1
-       mov     nfree,r2
-       asr     r2
-1:
-       mov     $16.,r4
-       mov     (r1)+,r5
-2:
-       rol     r5
-       adc     r3
-       dec     r4
-       bne     2b
-       
\ No newline at end of file
diff --git a/cmd/dsw.s b/cmd/dsw.s
deleted file mode 100644 (file)
index 0303b06..0000000
--- a/cmd/dsw.s
+++ /dev/null
@@ -1,95 +0,0 @@
-/ dsw - delete from tty
-
-       cmp     (sp)+,$2
-       blt     1f
-       tst     (sp)+
-       mov     (sp)+,0f
-1:
-       sys     stat; 0:dot; stbuf
-       bes     error
-       bit     $40000,stbuf+2
-       beq     error
-       mov     0b,0f
-       sys     open; 0:..; 0
-       bes     error
-       mov     r0,r1
-1:
-       clrb    buf+10.
-       mov     r1,r0
-       sys     read; buf; 10.
-       bes     done
-       tst     r0
-       beq     done
-       tst     buf
-       beq     1b
-       mov     0b,r2
-       mov     $obuf,r3
-2:
-       movb    (r2)+,(r3)+
-       bne     2b
-       mov     $buf+2,r2
-       dec     r3
-       cmpb    -1(r3),$'/
-       beq     2f
-       movb    $'/,(r3)+
-2:
-       movb    (r2)+,(r3)+
-       bne     2b
-       sys     stat; obuf; stbuf
-       bes     error
-       bit     $40000,stbuf+2
-       bne     1b
-       mov     $buf+2,r2
-2:
-       tstb    (r2)+
-       bne     2b
-       movb    $' ,-(r2)
-       sub     $buf+1,r2
-       mov     r2,0f
-
-2:
-       mov     $1,r0
-       sys     write; buf+2; 0:..
-       clr     r0
-       sys     read; ch; 1
-       cmpb    ch,$'\n
-       beq     1b
-       clr     r0
-       sys     read; ch1; 1
-       cmpb    ch1,$'\n
-       beq     3f
-4:
-       clr     r0
-       sys     read; ch; 1
-       cmpb    ch,$'\n
-       beq     2b
-       br      4b
-3:
-       cmpb    ch,$'x
-       beq     done
-       cmpb    ch,$'y
-       bne     2b
-       sys     unlink; obuf
-       bes     error
-       br      1b
-
-done:
-       sys     exit
-
-error:
-       mov     $1,r0
-       sys     write; mes; 2
-       sys     exit
-
-dot:   <.\0>
-mes:   <?\n>
-
-       .bss
-obuf:  .=.+100.
-stbuf: .=.+40.
-buf:   .=.+11.
-ch:    .=.+1
-ch1:   .=.+1
-
-v      $buf+2,r2
-2:
\ No newline at end of file
diff --git a/cmd/dusg.s b/cmd/dusg.s
deleted file mode 100644 (file)
index 38c0cc8..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/ dusg -- summarize disk usage
-
-       mov     (sp)+,r5
-       tst     (sp)+
-1:
-       dec     r5
-       bgt     2f
-       tstb    buf1
-       beq     3f
-       sys     exit
-3:
-       mov     $dot,r0
-       br      3f
-2:
-       mov     (sp)+,r0
-3:
-       cmpb    (r0),$'-
-       bne     2f
-       cmpb    1(r0),$'a
-       bne     3f
-       inc     aflg
-       br      1b
-3:
-       cmpb    1(r0),$'s
-       bne     1b
-       dec     aflg
-       br      1b
-2:
-       mov     $buf1,r1
-2:
-       movb    (r0)+,(r1)+
-       bne     2b
-       dec     r1
-       clr     buf3+10.
-       clr     icnt
-       jsr     pc,tree
-       tst     aflg
-       bpl     1b
-       jsr     r5,name
-       br      1b
-
-tree:
-       sys     stat; buf1; buf2
-       bes     1f
-       cmp     buf2,$40.
-       bgt     2f
-1:
-       clr     r4
-       rts     pc
-2:
-       mov     icnt,r0
-       mov     $ibuf,r2
-       mov     buf2,r3
-1:
-       tst     r0
-       beq     1f
-       cmp     r3,(r2)+
-       bne     2f
-       clr     r4
-       jsr     r5,cname
-       rts     pc
-2:
-       dec     r0
-       br      1b
-1:
-       mov     r3,(r2)+
-       inc     icnt
-       bit     $40000,buf2+2
-       bne     1f
-       jsr     pc,gsize
-       jsr     r5,cname
-       rts     pc
-1:
-       jsr     pc,gsize
-       mov     r4,r3
-       sys     open; buf1; 0
-       bec     1f
-       rts     pc
-1:
-       mov     r0,-(sp)
-       mov     r1,-(sp)
-1:
-       mov     2(sp),r0
-       sys     read; buf3; 10.
-       bes     1f
-       tst     r0
-       beq     1f
-       tst     buf3
-       beq     1b
-       cmp     buf3+2,$".\0
-       beq     1b
-       cmp     buf3+2,$"..
-       bne     2f
-       tst     buf3+4
-       beq     1b
-2:
-       mov     $buf3+2,r2
-       mov     (sp),r1
-       movb    $'/,(r1)+
-       cmpb    -2(r1),$'/
-       bne     2f
-       dec     r1
-2:
-       movb    (r2)+,(r1)+
-       bne     2b
-       dec     r1
-       mov     r3,-(sp)
-       jsr     pc,tree
-       mov     r4,r3
-       add     (sp)+,r3
-       br      1b
-1:
-       mov     (sp)+,r1
-       clrb    (r1)
-       mov     (sp)+,r0
-       sys     close
-       mov     r3,r4
-       tst     aflg
-       bmi     1f
-       jsr     r5,name
-1:
-       rts     pc
-
-cname:
-       tst     aflg
-       bgt     name
-       rts     r5
-
-name:
-       jsr     pc,pnum
-       mov     $011,r0
-       jsr     pc,pchar
-       mov     $buf1,r2
-1:
-       movb    (r2)+,r0
-       beq     1f
-       jsr     pc,pchar
-       br      1b
-1:
-       mov     $'\n,r0
-       jsr     pc,pchar
-       rts     r5
-
-gsize:
-       mov     r5,-(sp)
-       mov     buf2+6,r5               / size
-       add     $511.,r5
-       clr     r4
-       alsc    $-9,r4
-       cmp     r5,$8.
-       blo     1f
-       mov     r5,-(sp)
-       add     $255.,r5
-       alsc    $-8,r4
-       add     (sp)+,r5
-1:
-       mov     r5,r4
-       mov     (sp)+,r5
-       rts     pc
-
-pnum:
-       mov     r4,-(sp)
-       mov     r5,-(sp)
-       mov     r4,r5
-       jsr     pc,1f
-       mov     (sp)+,r5
-       mov     (sp)+,r4
-       rts     pc
-1:
-       clr     r4
-       dvd     $10.,r4
-       mov     r5,-(sp)
-       mov     r4,r5
-       beq     1f
-       jsr     pc,1b
-1:
-       mov     (sp)+,r0
-       add     $'0,r0
-       jsr     pc,pchar
-       rts     pc
-
-pchar:
-       mov     r0,0f
-       mov     $1,r0
-       sys     write; 0f; 1
-       rts     pc
-0:     0
-
-dot:   <.\0>
-
-       .bss
-
-icnt:  .=.+2
-buf1:  .=.+100.
-buf2:  .=.+40.
-buf3:  .=.+12.
-aflg:  .=.+2
-ibuf:  .=.+1000.
-,r5
-       clr     r4
-       alsc    $-9,r4
-       cmp     r5,$8.
-       blo     1f
-       mov     r5,-(sp)
-       add     $255.,r5
-       alsc    $-8,r4
\ No newline at end of file
diff --git a/cmd/fc.c b/cmd/fc.c
deleted file mode 100644 (file)
index 8df9bff..0000000
--- a/cmd/fc.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* fortran command */
-
-char   ts[500];
-char   *tsp ts;
-char   *av[50];
-char   *llist[50];
-
-main(argc, argv)
-char *argv[]; {
-       char *t;
-       int nl, cflag, i, j;
-
-       llist[0] = 0;
-       i = nl = cflag = 0;
-       while(++i < argc) {
-               if (getsuf(t=copy(argv[i])) == 'f') {
-                       printf("%s:\n", t);
-                       av[0] = "fc";
-                       av[1] = t;
-                       av[2] = 0;
-                       if(callsys("/usr/fort/fc1", av) == 0) {
-                               av[0] = "as";
-                               av[1] = "-";
-                               av[2] = "f.tmp1";
-                               av[3] = 0;
-                               callsys("/bin/as", av);
-                               setsuf(t);
-                               unlink(t);
-                               if(link("a.out", t) | unlink("a.out")) {
-                                       printf("move failed: %s\n", t);
-                                       return;
-                               }
-                       } else {
-                               cflag++;
-                               goto loop;
-                       }
-               } else if (*t == '-' & t[1] =='c') {
-                       cflag++;
-                       goto loop;
-               }
-               if (nodup(llist, t)) {
-                       llist[nl++] = t;
-                       llist[nl] = 0;
-               }
-loop:;
-       }
-       unlink("f.tmp1");
-       if (cflag | nl==0) return;
-       i = 0;
-       av[0] = "ld";
-       av[1] = "/lib/fr0.o";
-       j = 2;
-       while(i<nl)
-               av[j++] = llist[i++];
-       av[j++] = "-lf";
-       av[j++] = "/lib/filib.a";
-       av[j++] = "-l";
-       av[j++] = 0;
-       callsys("/bin/ld", av);
-}
-
-getsuf(s)
-char s[]; {
-       int c;
-       char t, *os;
-
-       c = 0;
-       os = s;
-       while(t = *s++)
-               if (t=='/')
-                       c = 0;
-               else
-                       c++;
-       s =- 3;
-       if (c<=8 & c>2 & *s++=='.' & *s=='f')
-               return('f');
-       return(0);
-}
-
-setsuf(s)
-char s[]; {
-       while(*s++);
-       s[-2] = 'o';
-}
-
-callsys(f, v)
-char f[], *v[]; {
-       int t, status;
-
-       if ((t=fork())==0) {
-               execv(f, v);
-               printf("Can't find %s\n", f);
-               exit(-1);
-       } else
-               if (t == -1) {
-                       printf("Try again\n");
-                       exit(-1);
-       }
-       while(t!=wait(&status));
-       if ((status&0377) != 0)
-               exit(-1);
-       return((status>>8) & 0377);
-}
-
-copy(s)
-char s[]; {
-       char *otsp;
-
-       otsp = tsp;
-       while(*tsp++ = *s++);
-       return(otsp);
-}
-
-nodup(l, s)
-char *l[], s[]; {
-       char *t, *os, c;
-
-       os = s;
-       while(t = *l++) {
-               s = os;
-               while(c = *s++)
-                       if (c != *t++) goto ll;
-               if (*t++ == '\0') return (0);
-ll:;
-       }
-       return(1);
-}
-(t=fork())==0) {
-               execv(f, v);
-               printf("Can't find %s\n", f);
-               exit(-1);
-       } else
-               if (t == -1) {
-                       printf("Try again\n");
-                       exit(-1);
-       }
-       while(t!=wait(&status));
-       if ((status&0377) != 0)
-               exit(-1);
-       retur
\ No newline at end of file
diff --git a/cmd/fstrip.s b/cmd/fstrip.s
deleted file mode 100644 (file)
index 9addb1e..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/ fstrip -- remove fortran internal symbols
-
-.globl fopen
-.globl getw
-.globl putw
-.globl flush
-
-       mov     (sp)+,argc
-       tst     (sp)+
-       br      loop
-unloop:
-       sys     unlink; s.tmp
-loop:
-       dec     argc
-       bgt     1f
-       sys     exit
-1:
-       mov     (sp)+,r4
-       mov     r4,r0
-       jsr     r5,fopen; ibuf
-       bcc     1f
-       jsr     r5,mesg; <open error: \0>; .even
-       br      loop
-1:
-       mov     $'a,r1
-1:
-       movb    r1,s.tmp+8
-       sys     stat; s.tmp; obuf
-       bec     2f
-       sys     creat; s.tmp; 10
-       bec     1f
-2:
-       inc     r1
-       cmp     r1,$'z
-       blos    1b
-       jsr     r5,mesg; <can't create temp file for \0>; .even
-       sys     exit
-1:
-       mov     r0,obuf
-       clr     obuf+2
-       clr     obuf+4
-       jsr     r5,getw; ibuf
-       cmp     r0,magic
-       beq     1f
-       jsr     r5,mesg; <improper format: \0>; .even
-       br      unloop
-1:
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       mov     r0,r2
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       add     r0,r2
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       jsr     r5,putw; obuf
-       jsr     r5,getw; ibuf
-       cmp     r0,$1
-       bne     9f
-       asr     r2              / no relocation
-9:
-       jsr     r5,putw; obuf
-1:
-       jsr     r5,getw; ibuf
-       bcc     2f
-       jsr     r5,mesg; <unexpected EOF: \0>; .even
-       sys     exit
-2:
-       jsr     r5,putw; obuf
-       dec     r2
-       bne     1b
-       clr     r2
-1:
-       jsr     r5,getsym
-       bcs     1f
-       cmpb    symbol+1,$'0
-       blo     3f              / not digit
-       cmpb    symbol+1,$'9
-       bhi     3f
-       cmpb    symbol,$'t
-       beq     1b
-       cmpb    symbol,$'d
-       beq     1b
-       cmpb    symbol,$'c
-       beq     1b
-3:
-       jsr     r5,putsym
-       add     $14,r2
-       br      1b
-1:
-       jsr     r5,flush; obuf
-       mov     obuf,r0
-       sys     close
-       mov     ibuf,r0
-       sys     close
-       mov     r4,0f
-       sys     creat; 0:..; 0          / same mode as before
-       bec     1f
-       jsr     r5,mesg; <can't rewrite: \0>; .even
-       jmp     unloop
-1:
-       mov     r0,ibuf
-       sys     open; s.tmp; 0
-       bec     1f
-       jsr     r5,mesg; <can't read temp file for: \0>; .even
-       sys     exit
-1:
-       mov     r0,ibuf+2
-       sys     read; obuf; 512.
-       mov     r2,obuf+10      / new data
-       br      2f
-1:
-       mov     ibuf+2,r0
-       sys     read; obuf; 512.
-2:
-       mov     r0,0f
-       beq     1f
-       mov     ibuf,r0
-       sys     write; obuf; 0:..
-       br      1b
-1:
-       mov     ibuf,r0
-       sys     close
-       mov     ibuf+2,r0
-       sys     close
-       jmp     unloop
-
-mesg:
-       movb    (r5)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      mesg
-1:
-       inc     r5
-       bic     $1,r5
-       mov     r4,r1
-1:
-       movb    (r1)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       mov     $1,r0
-       sys     write; qnl; 1
-       rts     r5
-
-getsym:
-       mov     r5,-(sp)
-       mov     $symbol,r5
-       mov     $6,-(sp)
-1:
-       jsr     r5,getw; ibuf
-       bcs     2f
-       mov     r0,(r5)+
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       mov     (sp)+,r5
-       rts     r5
-2:
-       tst     (sp)+
-       mov     (sp)+,r5
-       sec
-       rts     r5
-
-putsym:
-       mov     r5,-(sp)
-       mov     $symbol,r5
-       mov     $6,-(sp)
-1:
-       mov     (r5)+,r0
-       jsr     r5,putw; obuf
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       mov     (sp)+,r5
-       rts     r5
-
-s.tmp:
-       </tmp/stma\0>
-qnl:
-       <\n>
-       .even
-magic:
-       br      .+20
-
-.bss
-argc:  .=.+2
-symbol:        .=.+14
-ibuf:  .=.+518.
-obuf:  .=.+518.
-ch:    .=.+2
-
-; 1
-       br      1b
-1:
-       mov     $1,r0
-       sys     write; qnl; 1
-       rts
\ No newline at end of file
diff --git a/cmd/getty.s b/cmd/getty.s
deleted file mode 100644 (file)
index 37b7654..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/ getty --  get name and tty mode
-/ for initialization
-
-/ cycle through speeds and "login:" messages
-/ summarized in itab
-
-stty = 31.
-
-       sys     quit; 0
-       sys     intr; 0
-0:
-       jsr     r5,nextspeed
-1:
-       mov     $name,r5
-2:
-       jsr     r5,getc
-       cmp     r0,$174
-       beq     5f
-       cmp     r0,$176
-       beq     5f
-       cmp     r0,$'\n
-       beq     1f
-       cmp     r0,$'\r
-       beq     4f
-       cmp     r0,$'@
-       beq     1b
-       cmp     r0,$'#
-       bne     3f
-       cmp     r5,$name
-       blos    2b
-       dec     r5
-       br      2b
-3:
-       movb    r0,(r5)+
-       br      2b
-4:
-       bis     $20,flags               /cr bit
-       mov     $1,r0
-       sys     write; nl; 1
-       br      2f
-5:
-       mov     $tab2741,itabp
-       inc     nowr
-       br      0b
-1:
-       mov     $1,r0
-       sys     write; cr; 1
-2:
-       clrb    (r5)+
-
-/ determine whether terminal is upper-case only
-
-       cmp     r5,$name+1
-       bhi     1f
-       bic     $4,flags        /no data-assume lc
-1:
-       mov     $name,r5
-1:
-       movb    (r5)+,r0
-       beq     1f
-       cmp     r0,$'A
-       blo     2f
-       cmp     r0,$'Z
-       bhi     2f
-       add     $40,r0          / map to lc
-       movb    r0,-1(r5)
-       br      1b
-2:
-       cmp     r0,$'a
-       blo     1b
-       cmp     r0,$'z
-       bhi     1b
-       bic     $4,flags
-       br      1b
-1:
-       clr     r0
-       mov     fstate,r4
-       bis     flags,4(r4)
-       sys     stty; fstate: ..
-
-go:
-       sys     exec; login; loginp
-       sys     exit
-
-getc:
-       clr     r0
-       sys     read; ch; 1
-       tst     r0
-       beq     done
-       mov     ch,r2
-       beq     1f
-getc1:
-       cmp     r2,$174
-       bhis    3f
-       tst     nowr
-       bne     3f
-       mov     $1,r0
-       sys     write; ch; 1
-3:
-       mov     r2,r0
-       rts     r5
-1:
-       dec     $0              / wait a while
-       bne     1b
-       mov     $name,(sp)
-       jsr     r5,nextspeed
-2:
-       clr     r0              / flush nulls
-       sys     read; ch; 1
-       tst     r0
-       beq     done
-       movb    ch,r2
-       beq     2b
-       br      getc1
-
-done:
-       sys     exit
-
-nextspeed:
-       mov     itabp,r1
-       mov     (r1)+,0f
-       bne     1f
-       mov     $itab,itabp
-       br      nextspeed
-1:
-       clr     r0
-       sys     stty; 0:..
-       bes     go
-       mov     (r1)+,-(sp)
-       mov     (r1)+,fstate
-       mov     r1,itabp
-       mov     (sp)+,r1
-1:
-       movb    (r1)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       rts     r5
-
-itabp: itab
-loginp:        login
-       name
-       0
-
-itab:
-       itty37; ttymes; tty37
-       itn300; tnmes;  tn300
-tab2741: i2741; m2741; f2741
-       0
-
-itty37:        511; 511; 340   / any parity, raw, 150 baud
-tty37: 511; 511; 210   / 37 parity, echo, 150 baud
-itn300:        521; 521; 340   / any parity, raw, cr, 300 baud
-tn300: 521; 521; 310   / any parity, echo, 300 baud
-i2741: 1501; 501; 100540       /134 bits, 2741, raw, first time
-f2741: 1501; 501; 500  /134 bps, 2741
-
-       0
-m2741: <\nlogin: \0>
-
-ttymes:
-       <\n\r\p:\alogin: \0>
-tnmes:
-       <\n\r\p;login: \0>
-
-login: </bin/login\0>
-       .even
-
-nl:    <\n>
-cr:    <\r>
-
-flags: 004     / upper case map
-
-       .bss
-ch:    .=.+2
-nowr:  .=.+2
-name:  .=.+32.
-f2741
-       0
-
-itty37:        511; 511; 340   / any parity, raw, 150 baud
-tty37: 511; 511; 210   / 37 parity, echo, 150 baud
-itn300:        521; 521; 340   / any parity, raw, cr, 300 baud
-tn300: 521; 521; 310   / any parity, echo, 300 baud
-i2741: 1501; 501; 100540       /134 bits, 2741, raw, first time
-f2741: 1501; 501; 500  /134 bps, 2741
-
-       0
-m2741: <\nlogin: \0>
-
-ttymes:
-       <\n\r\p:\alogin: \0>
-tnmes:
-       <\n\r\p;log
\ No newline at end of file
diff --git a/cmd/glob.c b/cmd/glob.c
deleted file mode 100644 (file)
index aa4ac6b..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/* global command --
-
-   glob params
-
-   "*" in params matches r.e ".*"
-   "?" in params matches r.e. "."
-   "[...]" in params matches character class
-   "[...a-z...]" in params matches a through z.
-
-   perform command with argument list
-  constructed as follows:
-     if param does not contain "*", "[", or "?", use it as is
-     if it does, find all files in current directory
-     which match the param, sort them, and use them
-
-   prepend the command name with "/bin" or "/usr/bin"
-   as required.
-*/
-
-char   ab[2000];               /* generated characters */
-char   *ava[200];              /* generated arguments */
-char   **av ava;
-char   *string ab;
-
-main(argc, argv)
-char *argv[];
-{
-       int i, j, c;
-       int inode, dirf, ap;
-       int fb[5], sb[17];
-       char *cp, *cpo;
-
-       if (argc < 3) {
-               write(1, "Arg count\n", 10);
-               return;
-       }
-       ap = 0;
-       av++;
-       fb[4] = 0;
-loop:
-       cpo = cp = *++argv;
-       while(c = *cp++) if (c=='*' | c=='?' | c=='[') goto compl;
-       av[ap++] = copy(cpo);
-       if (--argc>=2) goto loop;
-       goto donow;
-
-compl:
-       if(*--cp == '/') {
-               *cp = '\0';
-               if((dirf=open(cp==cpo? "/" : cpo, 0))<0)
-                       goto oper;
-               *cp++ = '/';
-               goto compl1;
-       }
-       if(cp != cpo) goto compl;
-       if((dirf=open(".",0)) >= 0) goto compl1;
-oper:
-       write(1, "No directory\n", 13);
-       return;
-compl1:
-       j = ap;
-l2:
-       while (read(dirf, &inode, 2)>0) {
-               read(dirf, fb, 8);
-               if (inode==0) goto l2;
-               if (match(fb, cp)) {
-                       c = *cp;
-                       *cp = '\0';
-                       av[ap++] = cat(cpo, fb);
-                       *cp = c;
-               }
-       }
-       close(dirf);
-       i = j;
-       while(i<ap-1) {
-               j = i;
-               while(++j<ap) {
-                       if (compar(av[i],av[j])) {
-                               c = av[i];
-                               av[i] = av[j];
-                               av[j] = c;
-                       }
-               }
-               i++;
-       }
-       if (--argc>=2) goto loop;
-donow:
-       if (ap<=1) {
-               write(1, "No match\n", 9);
-               return;
-       }
-       av[ap] = 0;
-       execv(av[0], av);
-       i = cat("/bin/", av[0]);
-       execv(i, av);
-       i = cat("/usr", i);
-       execv(i, av);
-       if (stat(i, sb) == 0) {
-               *av = i;
-               *--av = "/bin/sh";
-               execv(av[0], av);
-       }
-       write(1, "No command\n", 11);
-}
-
-match(s, p)
-char *s, *p; {
-       if (*s=='.' & *p!='.') return(0);
-       return(amatch(s, p));
-}
-
-amatch(s, p)
-char *s, *p;
-{
-       int c, cc, ok, lc, scc;
-
-       scc = *s;
-       lc = 077777;
-       switch (c = *p) {
-
-       case '[':
-               ok = 0;
-               while (cc = *++p) {
-                       switch (cc) {
-
-                       case ']':
-                               if (ok)
-                                       return(amatch(++s, ++p));
-                               else
-                                       return(0);
-
-                       case '-':
-                               ok =| lc <= scc & scc <= (cc=p[1]);
-                       }
-                       if (scc==(lc=cc)) ok++;
-               }
-               return(0);
-
-       case '?':
-       caseq:
-               if(scc) return(amatch(++s, ++p));
-               return(0);
-       case '*':
-               return(umatch(s, ++p));
-       case 0:
-               return(!scc);
-       }
-       if (c==scc) goto caseq;
-       return(0);
-}
-
-umatch(s, p)
-char *s, *p;
-{
-       if(*p==0) return(1);
-       while(*s)
-               if (amatch(s++,p)) return(1);
-       return(0);
-}
-
-compar(s1,s2)
-char *s1, *s2;
-{
-       int c1,c2;
-
-loop:
-       if ((c1 = *s1++)==0) return(0);
-       if ((c2 = *s2++)==0) return(1);
-       if (c1==c2) goto loop;
-       return(c1>c2);
-}
-
-copy(s1)
-char *s1;
-{
-       char *ts;
-
-       ts = string;
-       while(*string++ = *s1++);
-       return(ts);
-}
-
-cat(s1, s2)
-char *s1, *s2;
-{
-       char *ts;
-
-       ts = string;
-       while(*string++ = *s1++);
-       string--;
-       while(*string++ = *s2++);
-       return(ts);
-}
-seq;
-       return(0);
-}
-
-umatch(s, p)
-char *s, *p;
-{
-       if(*p==0) return(1);
-       while(*
\ No newline at end of file
diff --git a/cmd/if.c b/cmd/if.c
deleted file mode 100644 (file)
index 0ce05f3..0000000
--- a/cmd/if.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* if command */
-
-int    ap;
-int    ac;
-char   **av;
-
-main(argc, argv)
-char *argv[];
-{
-       int np, i, c;
-       char *nargv[50], *ncom, *na, *nxtarg();
-
-       ac = argc;
-       av = argv;
-       if (ac<2) return;
-       ap = 1;
-       if (exp()) {
-               np = 0;
-               while (na=nxtarg())
-                       nargv[np++] = na;
-               nargv[np] = 0;
-               if (np==0) return;
-               execv(nargv[0], nargv, np);
-               i = 0;
-               ncom = "/usr/bin/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
-               while(c=nargv[0][i])  {
-                       ncom[9+i++] = c;
-               }
-               ncom[9+i] = '\0';
-               execv(ncom+4, nargv, np);
-               execv(ncom, nargv, np);
-               write(1, "no command\n", 11);
-               seek(0, 0, 2);
-       }
-}
-
-char *nxtarg() {
-
-       if (ap>ac) return(0*ap++);
-       return(av[ap++]);
-}
-
-exp(s) {
-       int p1;
-
-       p1 = e1();
-       if (eq(nxtarg(), "-o")) return(p1 | exp());
-       ap--;
-       return(p1);
-}
-
-e1() {
-       int p1;
-
-       p1 = e2();
-       if (eq(nxtarg(), "-a")) return (p1 & e1());
-       ap--;
-       return(p1);
-}
-
-e2() {
-       if (eq(nxtarg(), "!"))
-               return(!e3());
-       ap--;
-       return(e3());
-}
-
-e3() {
-       int p1;
-       char *a;
-
-       if ((a=nxtarg())==0) goto err;
-       if(eq(a, "(")) {
-               p1 = exp();
-               if(!eq(nxtarg(), ")")) goto err;
-               return(p1);
-       }
-
-       if(eq(a, "-r"))
-               return(tio(nxtarg(), 0));
-
-       if(eq(a, "-w"))
-               return(tio(nxtarg(), 1));
-
-       if(eq(a, "-c"))
-               return(tcreat(nxtarg()));
-
-       p1 = nxtarg();
-       if (p1==0) goto err;
-       if(eq(p1, "="))
-               return(eq(a, nxtarg()));
-
-       if(eq(p1, "!="))
-               return(!eq(a, nxtarg()));
-err:
-       write(1, "if error\n", 9);
-       exit();
-}
-
-tio(a, f) {
-
-       a = open(a, f);
-       if (a>=0) {
-               close(a);
-               return(1);
-       }
-       return(0);
-}
-
-tcreat(a) {
-       return(1);
-}
-
-eq(a, b)
-char *a, *b;
-{
-       int i;
-
-       i = 0;
-l:
-       if(a[i] != b[i])
-               return(0);
-       if(a[i++] == '\0')
-               return(1);
-       goto l;
-}
-targ(), 0));
-
-       if(eq(a, "-w"))
-               return(tio(nxtarg(), 1));
-
-       if(eq(a, "-c"))
-               return(tcreat(nxtarg()));
-
-       p1 = nxtarg();
-       if (p1==0) goto err;
-       if(eq(p1, "="))
-               return(eq(a, nxtarg()));
-
-       if(eq(p1, "!="))
-               return(!eq(a, nxtarg()));
-err:
-       write(1, "if error\n", 9);
-       exit();
-}
-
-tio(a, f) {
-
-       a = open(a, f);
-       if (a>=0) {
-               close(a);
-               return(1);
-       }
-       return(0);
-}
-
-tcreat(a) {
-       return(1);
-}
-
-eq(a, b)
-char *a, *b;
-{
-       int i;
-
-       i = 0;
-l:
-       if(a[i] != b[i])
diff --git a/cmd/init.s b/cmd/init.s
deleted file mode 100644 (file)
index 6c74930..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/ init -- process control initialization
-
-
-
-       sys     intr; 0
-       sys     quit; 0
-       sys     38. / get console switches
-       cmp     r0,$173030
-       bne     1f
-help:
-       clr     r0
-       sys     close
-       mov     $1,r0
-       sys     close
-       sys     open; ctty; 0
-       sys     open; ctty; 1
-       sys     exec; shell; shellp
-       br      help
-1:
-       sys     mount; rk1; usr
-       sys     mount; rk2; ssys
-       sys     mount; rk3; crp
-       mov     $'0,r1
-1:
-       movb    r1,tapx+8
-       sys     chmod; tapx; 17
-       inc     r1
-       cmp     r1,$'8
-       blo     1b
-       sys     creat; utmp; 16
-       sys     close
-       sys     unlink; dpdlock
-       sys     fork
-               br daemon
-       sys     fork
-               br dirass
-       sys     fork
-               br dds
-       movb    $'x,zero+8.
-       jsr     pc,wtmprec
-       mov     $itab,r1
-       br      1f
-
-daemon:
-       sys     exec; etcdpd; etcdpdp
-       sys     exit
-
-dirass:
-       sys     chdir; usrmel
-       sys     exec; melda; meldap
-       sys     exit
-
-dds:
-       sys     exec; usrdd; usrddp
-       sys     exit
-
-/ create shell processes
-
-1:
-       mov     (r1)+,r0
-       beq     pwait
-       movb    r0,ttyx+8
-       jsr     pc,dfork
-       mov     r0,(r1)+
-       br      1b
-
-/ wait for process to die
-
-pwait:
-       sys     wait
-       mov     $itab,r1
-
-/ search for process id
-
-2:
-       tst     (r1)+
-       beq     pwait
-       cmp     r0,(r1)+
-       bne     2b
-
-/ take name out of utmp
-
-       sub     $4,r1
-       mov     r1,-(sp)
-       mov     (r1),r1
-       sub     $'0,r1
-       cmp     r1,$'a-'0
-       blo     2f
-       sub     $'a-'0-10.,r1   / map a-z into 10. on
-2:
-       asl     r1
-       asl     r1
-       asl     r1
-       asl     r1
-       mov     r1,0f
-       mov     $zero,r1
-2:
-       clr     (r1)+
-       cmp     r1,$zero+16.
-       blo     2b
-       sys     open; utmp; 1
-       bes     2f
-       mov     r0,r1
-       sys     seek; 0:..; 0
-       mov     r1,r0
-       sys     write; zero; 16.
-       mov     r1,r0
-       sys     close
-
-/ re-create user process
-
-2:
-       mov     (sp)+,r1
-       mov     (r1)+,r0
-       movb    r0,ttyx+8
-       movb    r0,zero+8.
-       jsr     pc,wtmprec
-       jsr     pc,dfork
-       mov     r0,(r1)+
-       br      pwait
-
-dfork:
-       sys     fork
-               br 1f
-       bes     dfork
-       rts     pc
-1:
-       sys     quit; 0
-       sys     intr; 0
-       sys     chown; ttyx; 0
-       sys     chmod; ttyx; 15
-       sys     open; ttyx; 0
-       bes     help1
-       sys     open; ttyx; 1
-       bes     help1
-       sys     exec; getty; gettyp
-       sys     exit                    / HELP!
-
-help1:
-       jmp     help
-
-wtmprec:
-       mov     r1,-(sp)
-       sys     time
-       mov     r0,zero+10.
-       mov     r1,zero+12.
-       sys     open; wtmp; 1
-       bes     2f
-       mov     r0,r2
-       sys     seek; 0; 2
-       mov     r2,r0
-       sys     write; zero; 16.
-       mov     r2,r0
-       sys     close
-2:
-       mov     (sp)+,r1
-       rts     pc
-
-etcdpdp:
-       etcdpd; 0
-meldap:
-       melda; 0
-usrddp:
-       usrdd; 0
-usrdd: </usr/demo/dds\0>
-melda: </usr/mel/da\0>
-usrmel:        </usr/mel\0>
-rk1:   </dev/rk1\0>
-rk2:   </dev/rk2\0>
-rk3:   </dev/rk3\0>
-usr:   </usr\0>
-ssys:  </sys\0>
-crp:   </crp\0>
-ctty:  </dev/tty\0>
-shell: </bin/sh\0>
-shellm:        <-\0>
-dpdlock:
-       </usr/dpd/lock\0>
-etcdpd:
-       </etc/dpd\0>
-tapx:  </dev/tapx\0>
-utmp:  </tmp/utmp\0>
-wtmp:  </tmp/wtmp\0>
-ttyx:  </dev/ttyx\0>
-getty: </etc/getty\0>
-       .even
-
-shellp:        shellm
-       0
-gettyp:        getty
-       0
-itab:
-       '0; ..
-       '1; ..
-       '2; ..
-       '3; ..
-       '4; ..
-       '5; ..
-       '6; ..
-       '7; ..
-       '8; ..
-       'a; ..
-       'b; ..
-        0
-
-       .bss
-offset:        .=.+2
-zero:  .=.+8.; .=.+6; .=.+2.
-
-srmel: </usr/mel\0>
-rk1:   </dev/rk1\0>
-rk2:   </dev/rk2\0
\ No newline at end of file
diff --git a/cmd/ld1.s b/cmd/ld1.s
deleted file mode 100644 (file)
index bafdf3c..0000000
--- a/cmd/ld1.s
+++ /dev/null
@@ -1,475 +0,0 @@
-/ ld1 -- link editor
-
-orig:
-       sys     intr; sintr
-       mov     (sp)+,r0
-       dec     r0
-       bgt     1f
-       sys     exit
-1:
-       mov     r0,argc
-       mov     sp,argp
-1:
-       jsr     r5,nxtarg
-               br pass2
-       jsr     r5,load1
-       br      1b
-
-pass2:
-       sys     creat; l.out; 017
-       bec     1f
-       clr     filnam
-       jsr     r5,mesg; outfile
-       sys     exit
-1:
-       mov     r0,fout
-       mov     txtsiz,r1
-       mov     datsiz,r2
-       mov     r1,r3
-       add     r2,r3           / bss origin
-       clr     r4
-       mov     $symtab,r5
-1:
-       cmp     r5,esymp
-       bhis    1f
-       cmp     10(r5),$40      / undefined
-       bne     2f
-       mov     12(r5),r0       / common?
-       beq     2f              / no
-       mov     r4,12(r5)       / common origin
-       add     r3,12(r5)
-       inc     r0
-       bic     $1,r0           / even
-       add     r0,r4           / new common origin
-       mov     $47,10(r5)      / temp. common type
-2:
-       add     $14,r5
-       br      1b
-1:
-       add     r4,bsssiz
-       mov     $symtab,r5
-1:
-       cmp     r5,esymp
-       bhis    1f
-       cmp     10(r5),$43
-       blt     2f              / undef, abs or text
-       beq     3f
-       cmp     10(r5),$47      / common
-       bne     4f
-       mov     $44,10(r5)      / set bss
-       br      2f
-4:
-       add     r2,12(r5)       / bss
-       add     r4,12(r5)       / common total
-3:
-       add     r1,12(r5)       / data
-2:
-       add     $14,r5
-       br      1b
-1:
-       mov     r1,fdatorg
-       mov     r3,fbssorg
-       add     r4,fbssorg
-       mov     symsiz,locsymsiz
-       add     esymp,symsiz
-       sub     $symtab,symsiz
-       tst     sqflg
-       beq     1f
-       clr     symsiz
-1:
-       jsr     r5,oattach; otxtp; zero
-       add     $20,oattpt
-       jsr     r5,oattach; odatp; txtsiz
-       tst     relflg          / suppress relocation?
-       bne     1f
-       jsr     r5,oattach; otrelp; datsiz
-       jsr     r5,oattach; odrelp; txtsiz
-1:
-       jsr     r5,oattach; osymp; datsiz
-       tst     entptr
-       beq     1f
-       tst     exorig
-       beq     2f
-       jsr     r5,mesg; mulent         / too many entry points
-2:
-       mov     entptr,r0
-       mov     12(r0),exorig
-       inc     exorig          / 0 entry means none
-1:
-       mov     $7,-(sp)
-       mov     $magic,r1       / write magic at start
-       tst     sqflg
-       beq     1f
-       clr     symsiz
-1:
-       mov     (r1)+,r0
-       jsr     r5,putwrd; otxtp
-1:
-       mov     (r1)+,r0
-       jsr     r5,putwrd; otxtp
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       clr     txtsiz
-       clr     datsiz
-       clr     bsssiz
-       clr     *rlistp
-       mov     $rlist,rlistp
-1:
-       jsr     r5,nxtarg2
-               br 1f
-       jsr     r5,load2
-       br      1b
-1:
-       jsr     r5,flush; otxtp
-       jsr     r5,flush; odatp
-       tst     relflg
-       bne     1f
-       jsr     r5,flush; otrelp
-       jsr     r5,flush; odrelp
-1:
-       mov     $symtab,r1
-1:
-       cmp     r1,esymp
-       bhis    1f
-       cmp     10(r1),$40
-       bne     2f
-       mov     r1,r0
-       clr     filnam
-       jsr     r5,smesg; undmes
-2:
-       tst     sqflg
-       beq     3f
-       add     $14,r1
-       br      1b
-3:
-       mov     $6,r2
-2:
-       mov     (r1)+,r0
-       jsr     r5,putwrd; osymp
-       dec     r2
-       bne     2b
-       br      1b
-1:
-       jsr     r5,flush; osymp
-done:
-       sys     unlink; a.out
-       sys     link; l.out; a.out
-       bec     1f
-       clr     filnam
-       jsr     r5,mesg; movemes
-       sys     exit
-1:
-       sys     unlink; l.out
-       sys     chmod; a.out; outmod: 37
-       sys     exit
-sintr:
-       sys     unlink; l.out
-       sys     exit
-
-load1:
-       mov     txtsiz,txtorg
-       mov     datsiz,datorg
-       sub     ctxtsiz,datorg
-       mov     bsssiz,bssorg
-       sub     ctxtsiz,bssorg
-       sub     cdatsiz,bssorg
-       mov     $14,locsymsiz
-       clr     ndef
-       mov     r5,-(sp)
-       mov     esymp,-(sp)
-       mov     $local,r5
-       jsr     r5,attach; txtp; csymorg
-1:
-       jsr     r5,getsym
-       bvs     1f
-       cmp     symbol+10,$40
-       bge     2f              / external
-       tst     xtflg
-       bne     1b
-       add     $14,locsymsiz   / count locals
-       br      1b
-2:
-       jsr     r5,lookup
-       mov     (r4),r0
-       beq     2f              / not yet in table
-       cmp     10(r0),$40
-       bgt     1b              / multiply defined
-       inc     ndef            / remember def occurred
-       cmp     symbol+10,$40
-       bgt     3f
-       dec     ndef            / forget def occurred
-       cmp     12(r0),symbol+12        / extend common region?
-       bge     1b
-       br      3f
-2:
-       mov     r4,(r5)+
-       jsr     r5,enter
-       cmp     symbol+10,$40
-       ble     1b              / undefined symbol
-3:
-       jsr     r5,relsym
-       mov     (r4),r0
-       mov     symbol+10,10(r0)
-       mov     symbol+12,12(r0)
-       br      1b
-1:
-       tst     libflg          / load anyway if not library
-       beq     1f
-       tst     ndef            / load library if any definitions
-       bne     1f
-       mov     (sp)+,esymp     / rip out symbols
-2:
-       cmp     r5,$local       / see if end of entered symbols
-       blos    2f
-       clr     *-(r5)          / rip out hash entry
-       br      2b
-1:
-       tst     (sp)+
-       tst     entry
-       beq     1f
-       add     txtorg,entry
-       tst     exorig
-       beq     5f
-       jsr     r5,mesg; mulent
-5:
-       mov     entry,exorig
-1:
-       add     locsymsiz,symsiz        / total of local symbs
-       mov     rlistp,r0
-       cmp     r0,$rliste
-       blo     1f
-       jsr     r5,mesg; toomany
-       jmp     done
-1:
-       mov     reopened,r1
-       bne     1f
-       mov     *argp,r1
-       cmp     r1,$libfil
-       bne     1f
-       movb    wlib,r1         / library, just remember letter name
-1:
-       mov     r1,(r0)+
-       mov     libflg,(r0)+    / remember start of routine
-       beq     3f              / not library
-       bis     $1,reopened
-3:
-       mov     r0,rlistp
-       jsr     r5,addin
-2:
-       mov     (sp)+,r5
-       rts     r5
-
-load2:
-       mov     txtsiz,txtorg
-       mov     fdatorg,r0
-       add     datsiz,r0
-       sub     ctxtsiz,r0
-       mov     r0,datorg
-       mov     fbssorg,r0
-       add     bsssiz,r0
-       sub     ctxtsiz,r0
-       sub     cdatsiz,r0
-       mov     r0,bssorg
-       mov     r5,-(sp)
-       jsr     r5,attach; txtp; csymorg
-       mov     $local,r5
-       mov     $-1,-(sp)       / local symbol index
-       mov     filnam,r1
-2:
-       tstb    (r1)+
-       bne     2b
-2:
-       cmp     r1,filnam
-       blos    2f
-       cmpb    -(r1),$'/
-       bne     2b
-       tstb    (r1)+
-2:
-       mov     $symbol,r0
-2:
-       movb    (r1)+,(r0)+
-       bne     3f
-       tstb    -(r1)
-3:
-       cmp     r0,$symbol+8.
-       blo     2b
-       mov     $37,symbol+10
-       mov     txtorg,symbol+12
-       tst     sqflg
-       bne     1f
-       jsr     r5,wrlocsym
-1:
-       jsr     r5,getsym
-       bvs     1f
-       jsr     r5,relsym
-       inc     (sp)
-       cmp     symbol+10,$40
-       blo     5f
-       jsr     r5,lookup
-       tst     (r4)
-       bne     6f
-       jsr     r5,mesg; snotfound
-       br      1b
-6:
-       cmp     symbol+10,$40
-       bgt     2f
-       beq     4f
-5:
-       tst     xtflg
-       bne     1b              / skip locals
-       jsr     r5,wrlocsym     / write local symbol
-       br      1b
-2:
-       mov     (r4),r0
-       cmp     10(r0),symbol+10
-       bne     2f
-       cmp     12(r0),symbol+12
-       beq     4f
-2:
-       jsr     r5,smesg; multi
-4:
-       cmp     r5,$elocal
-       blo     3f
-       jsr     r5,mesg; locovflo
-       jmp     done
-3:
-       mov     (sp),(r5)+      / save local index
-       mov     (r4),(r5)+      / save symbol location
-       br      1b
-1:
-       mov     r5,locp
-       tst     (sp)+
-       jsr     r5,attach; txtp; ctxtorg
-       jsr     r5,attach; relp; ctrelorg
-       mov     txtsiz,relbas
-1:
-       jsr     r5,txtlod
-               br 1f
-       tst     relflg
-       bne     2f
-       jsr     r5,putwrd; otrelp
-2:
-       mov     r3,r0
-       jsr     r5,putwrd; otxtp
-       br      1b
-1:
-       jsr     r5,attach; txtp; cdatorg
-       jsr     r5,attach; relp; cdrelorg
-       mov     datorg,r0
-       mov     r0,relbas
-       mov     r5,locp
-       mov     (sp)+,r5
-1:
-       jsr     r5,txtlod
-               br 1f
-       tst     relflg
-       bne     2f
-       jsr     r5,putwrd; odrelp
-2:
-       mov     r3,r0
-       jsr     r5,putwrd; odatp
-       br      1b
-1:
-       jsr     r5,addin
-       rts     r5
-
-txtlod:
-       jsr     r5,getwrd; txtp
-       bvs     1f
-       tst     (r5)+
-       mov     r0,r3
-       jsr     r5,getwrd; relp
-       bvc     2f
-       jsr     r5,mesg; relerr
-       sys     exit
-2:
-       mov     r0,r2
-       bic     $1,r2
-       bic     $!17,r0
-       cmp     r0,$7
-       blos    3f
-/ external symbol reference
-       clc
-       ror     r2
-       asr     r2
-       asr     r2
-       asr     r2              / get symbol number
-       jsr     r5,lookloc      / get symbol
-       cmp     10(r4),$40
-       bgt     2f
-/ still undefined
-       sub     $symtab,r4
-       add     locsymsiz,r4
-       mov     r5,-(sp)
-       mov     r4,r5
-       clr     r4
-       dvd     $14,r4
-       als     $4,r4
-       bis     r4,r0
-       mov     (sp)+,r5
-       br      relrel
-2:
-/ symbol now defined
-       add     12(r4),r3       / symbol value
-       mov     10(r4),r2
-       sub     $41,r2
-       bic     $!1,r0
-       bne     4f
-       tst     r2
-       beq     5f              / not relative & relocatable
-       add     dotdot,r3
-       br      5f
-4:
-       tst     r2
-       bne     5f              / relative & absolute
-       sub     dotdot,r3
-5:
-       asl     r2
-       bis     r2,r0
-       br      relrel
-/ absolute, text, data, or bss symbol
-3:
-       add     *reltab(r2),r3
-relrel:
-       bit     $1,r0
-       beq     1f
-       sub     relbas,r3       / relative relocation
-1:
-       rts     r5
-
-wrlocsym:
-       mov     $symbol,r1
-       mov     $6,-(sp)
-3:
-       mov     (r1)+,r0
-       jsr     r5,putwrd; osymp / write out local symbol
-       dec     (sp)
-       bne     3b
-       tst     (sp)+
-       rts     r5
-
-dd     12(r4),r3       / symbol value
-       mov     10(r4),r2
-       sub     $41,r2
-       bic     $!1,r0
-       bne     4f
-       tst     r2
-       beq     5f              / not relative & relocatable
-       add     dotdot,r3
-       br      5f
-4:
-       tst     r2
-       bne     5f              / relative & absolute
-       sub     dotdot,r3
-5:
-       asl     r2
-       bis     r2,r0
-       br      relrel
-/ absolute, text, data, or bss symbol
-3:
-       add     *reltab(r2),r3
-relrel:
-       bit     $1,r0
-       beq     1f
-       sub     rel
\ No newline at end of file
diff --git a/cmd/ld2.s b/cmd/ld2.s
deleted file mode 100644 (file)
index 9b2768f..0000000
--- a/cmd/ld2.s
+++ /dev/null
@@ -1,560 +0,0 @@
-/ ld2 -- link editor
-
-attach:
-       mov     (r5)+,r1        / buffer
-       mov     (r5)+,r2        / file origin, size
-       mov     (r2),0f         / seek ptr
-       mov     fin,r0
-       sys     seek; 0:..; 0
-       mov     (r2),r0
-       bis     $777,r0
-       inc     r0              / start of next block
-       add     $10,r1
-       mov     r1,-(sp)
-       add     $1000,(sp)      / buf max
-       mov     r0,-(r1)        / next seek ptr
-       mov     (sp),-(r1)
-       sub     (r2)+,r0        /  left in buffer
-       sub     r0,(sp)         / next buffer word
-       mov     (sp),-(r1)
-       mov     (sp)+,0f        / buffer loc
-       cmp     (r2),r0
-       bge     1f
-       mov     (r2),r0
-1:
-       mov     r0,0f+2         / number to read
-       mov     (r2),-(r1)      / left in file
-       jsr     r5,rdchk; 0:..; ..
-       rts     r5
-
-rdchk:
-       mov     (r5)+,0f
-       mov     (r5)+,0f+2
-       mov     fin,r0
-       sys     read; 0:..; ..
-       bes     1f
-       cmp     r0,0b+2
-       bne     1f
-       rts     r5
-1:
-       jsr     r5,mesg; premeof
-       jmp     sintr
-
-getwrd:
-       mov     (r5)+,r1
-       sub     $2,(r1)+        / left in file
-       bge     1f
-       sev                     / end of file
-       rts     r5
-1:
-       mov     (r1)+,r2        / word ptr
-       cmp     r2,(r1)+        / eob ptr
-       bhis    1f              / end of buffer
-       mov     (r2)+,r0
-       mov     r2,-4(r1)
-       rts     r5
-1:
-       mov     (r1),0f
-       mov     fin,r0
-       sys     seek; 0:..; 0
-       add     $1000,(r1)+     / new seek ptr
-       mov     r1,0f
-       mov     -10(r1),r0      / left in file
-       add     $2,r0
-       cmp     r0,$1000
-       ble     1f
-       mov     $1000,r0        / read 1000 at most
-1:
-       mov     r0,0f+2
-       jsr     r5,rdchk; 0:..; ..
-       mov     (r1)+,r0
-       mov     r1,-10(r1)      / new next word
-       rts     r5
-
-oattach:
-       mov     (r5)+,r1
-       mov     (r5)+,r2
-       mov     oattpt,r0
-       add     (r2),r0
-       mov     r0,oattpt
-       mov     r0,r2
-       bic     $!777,r0
-       add     r1,r0
-       add     $6,r0
-       mov     r0,(r1)+        / next slot
-       mov     r1,r0
-       add     $1004,r0
-       mov     r0,(r1)+        / buf max
-       mov     r2,(r1)+        / seek addr
-       rts     r5
-
-putwrd:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     (r5)+,r2
-       mov     (r2)+,r1        / slot
-       cmp     r1,(r2)         / buf max
-       bhis    1f
-       mov     r0,(r1)+
-       mov     r1,-(r2)
-       br      2f
-1:
-       tst     (r2)+
-       mov     r0,-(sp)
-       jsr     r5,flush1
-       mov     (sp)+,*(r2)+
-       add     $2,-(r2)
-2:
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       rts     r5
-
-flush:
-       mov     (r5)+,r2
-       cmp     (r2)+,(r2)+
-flush1:
-       mov     (r2)+,r1
-       mov     r1,0f           / seek address
-       mov     fout,r0
-       sys     seek; 0:..; 0
-       bic     $!777,r1
-       add     r2,r1           / write address
-       mov     r1,0f
-       mov     r2,r0
-       bis     $777,-(r2)
-       inc     (r2)            / new seek addr
-       cmp     -(r2),-(r2)
-       sub     (r2),r1
-       neg     r1
-       mov     r1,0f+2         / count
-       mov     r0,(r2)         / new next slot
-       mov     fout,r0
-       sys     write; 0:..; ..
-       rts     r5
-
-lookup:
-       mov     $symbol,r1
-       mov     (r1)+,r0
-       add     (r1)+,r0
-       add     (r1)+,r0
-       add     (r1)+,r0
-       mov     r0,r1
-       clr     r0
-       dvd     $hshsiz,r0
-       mov     r1,r4
-       asl     r4
-       add     $hshtab,r4
-1:
-       mov     (r4)+,r0
-       beq     3f              / not found
-       mov     $symbol,r1
-       cmp     (r1)+,(r0)+
-       bne     2f
-       cmp     (r1)+,(r0)+
-       bne     2f
-       cmp     (r1)+,(r0)+
-       bne     2f
-       cmp     (r1)+,(r0)+
-       bne     2f
-3:
-       tst     -(r4)
-       rts     r5
-2:
-       cmp     r4,$2*hshsiz+hshtab
-       blo     1b
-       mov     $hshtab,r4
-       br      1b
-
-enter:
-       mov     esymp,r0
-       add     $14,r0
-       cmp     r0,0f
-       blo     1f
-       add     $500.,r0
-       mov     r0,0f
-       sys     break; 0:symtab
-1:
-       mov     esymp,r0
-       mov     r0,(r4)
-       mov     $symbol,r1
-       mov     $6,-(sp)
-1:
-       mov     (r1)+,(r0)+
-       dec     (sp)
-       bne     1b
-       mov     r0,esymp
-       tst     (sp)+
-       rts     r5
-
-smesg:
-       mov     r1,-(sp)
-       mov     r0,-(sp)
-       jsr     pc,1f
-       tst     filnam
-       beq     2f
-       mov     $1,r0
-       sys     write; qsemi; 1
-2:
-       mov     (sp)+,r1
-       mov     $8.,-(sp)
-3:
-       movb    (r1)+,ch
-       beq     4f
-       mov     $1,r0
-       sys     write; ch; 1
-4:
-       dec     (sp)
-       bne     3b
-       tst     (sp)+
-       mov     (sp)+,r1
-       br      2f
-
-mesg:
-       jsr     pc,1f
-       mov     $1,r0
-2:
-       sys     write; qnl; 1
-       rts     r5
-
-1:
-       mov     $17,outmod              / make a.out nonexecutable
-       mov     r1,-(sp)
-       mov     (r5)+,r1
-1:
-       movb    (r1)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       mov     filnam,r1
-       beq     9f
-1:
-       movb    (r1)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-9:
-       mov     (sp)+,r1
-       rts     pc
-
-getsym:
-       mov     $6,-(sp)
-       mov     $symbol,r4
-1:
-       jsr     r5,getwrd; txtp
-       bvs     2f
-       mov     r0,(r4)+
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       rts     r5
-2:
-       tst     (sp)+
-       sev
-       rts     r5
-
-nxtarg2:
-       mov     rlistp,r1
-       add     $4,rlistp
-       mov     (r1)+,r0
-       beq     1f              / end of args
-       cmp     r0,$177         / see if system library
-       bhi     2f
-       cmp     r0,$1           / see if archive
-       beq     3f
-       movb    r0,wlib
-       mov     $libfil,r0
-2:
-       jsr     r5,aopen
-               br nxtarg2
-3:
-       mov     (r1),libflg
-       beq     2f
-       sub     $20,(r1)
-       mov     (r1),0f
-       mov     fin,r0
-       sys     seek; 0:..; 0
-2:
-       mov     fin,r0
-       sys     read; arcmag; 40
-       bes     bform1
-       cmp     r0,$20
-       blt     bform1
-       mov     $arcmag,r4
-       tst     (r1)+
-       beq     filstrt
-       cmp     r0,$40
-       bne     bform1
-       br      libstrt
-1:
-       rts     r5
-
-bform1:
-       jmp     bform
-
-nxtarg:
-       add     libnxt,libflg   / see if library
-       beq     advarg          / no
-       mov     libflg,0f
-       mov     fin,r0
-       sys     seek; 0:..; 0
-       mov     fin,r0
-       sys     read; arcmag+2; 40      / get arc header, seg hdr
-       mov     $arcmag+2,r4
-       add     $20,libflg
-       cmp     r0,$40
-       beq     libstrt         / not end of libr
-advarg:
-       dec     argc
-       bge     1f
-       rts     r5
-1:
-       mov     argp,r1
-       tst     (r1)+
-       mov     r1,argp
-       cmpb    *(r1),$'-
-       bne     opnarg
-       jsr     r5,specarg
-               br advarg
-opnarg:
-       clr     libflg
-       clr     libnxt
-       mov     *argp,r0
-       clr     reopened
-       jsr     r5,aopen
-               br advarg
-       mov     fin,r0
-       sys     read; arcmag; 42 / read arc header if any, file hdr
-       bes     bform
-       mov     r0,r3
-       mov     $arcmag,r4
-       add     r4,r3
-       cmp     r3,$arcmag+20
-       blo     bform
-       cmp     (r4),arcmagic
-       bne     filstrt
-       cmp     r3,$arcmag+42
-       blo     bform
-       tst     (r4)+
-       mov     $22,libflg
-libstrt:
-       mov     16(r4),r0       / next library start
-       inc     r0
-       bic     $1,r0
-       mov     r0,libnxt
-       clr     14(r4)          / end of name
-       mov     r4,filnam       / archive entry name
-       add     $20,r4          / point to file start
-filstrt:
-       cmp     (r4)+,magic     / see if object file
-       bne     bform
-       mov     $ctxtorg,r1
-       mov     libflg,r2       / text origin in file
-       add     $20,r2          / skip header
-       mov     (r4)+,r0
-       mov     r2,(r1)+        / text origin
-       mov     r0,(r1)+        / text size
-       add     r0,r2
-       mov     (r4)+,r0
-       mov     r2,(r1)+        / data origin
-       mov     r0,(r1)+        / data size
-       add     r0,r2
-       mov     (r4)+,(r1)+     / bss size
-       mov     r2,(r1)+        / text reloc origin
-       mov     ctxtsiz,(r1)    / text reloc size
-       add     (r1)+,r2
-       mov     r2,(r1)+        / data reloc origin
-       mov     cdatsiz,(r1)    / data size
-       add     (r1)+,r2
-       mov     (r4)+,r0
-       mov     r2,(r1)+        / symbol table origin
-       mov     r0,(r1)+        / symbol table size
-       mov     (r4)+,r0        / stack size
-       cmp     r0,stksiz
-       blo     1f
-       mov     r0,stksiz
-1:
-       mov     (r4)+,entry     / entry
-       tst     (r4)+           / relocation suppressed?
-       beq     1f
-       jsr     r5,mesg; norel
-       rts     r5
-1:
-       tst     (r5)+
-       rts     r5
-
-bform:
-       jsr     r5,mesg; format
-       jmp     sintr
-
-specarg:
-       mov     (r1),r0
-       movb    1(r0),r0
-       cmpb    r0,$'u
-       beq     use
-       cmpb    r0,$'l
-       beq     libarg
-       cmpb    r0,$'x
-       beq     xtsym
-       cmpb    r0,$'e
-       beq     entarg
-       cmpb    r0,$'r
-       beq     savrel
-       cmpb    r0,$'s
-       beq     squash
-       rts     r5
-
-squash:
-       inc     sqflg
-       inc     xtflg
-       rts     r5
-
-savrel:
-       clr     relflg
-       rts     r5
-
-xtsym:
-       inc     xtflg
-       rts     r5
-
-libarg:
-       movb    $'a,wlib
-       mov     (r1),r1
-       movb    2(r1),r0
-       beq     1f
-       movb    r0,wlib
-1:
-       mov     $libfil,*argp
-       tst     (r5)+
-       rts     r5
-
-entarg:
-       clr     r4
-       jsr     r5,use
-       mov     (r4),entptr
-       rts     r5
-
-use:
-       dec     argc
-       blt     2f
-       add     $2,argp
-       mov     *argp,r0
-       mov     $symbol,r1
-       mov     $8.,-(sp)
-1:
-       movb    (r0)+,(r1)+
-       beq     1f
-       dec     (sp)
-       bgt     1b
-1:
-       dec     (sp)
-       ble     1f
-       clrb    (r1)+
-       br      1b
-1:
-       tst     (sp)+
-       mov     $40,(r1)+
-       clr     (r1)+
-       jsr     r5,lookup
-       tst     (r4)
-       bne     2f
-       jsr     r5,enter
-2:
-       rts     r5
-
-relsym:
-       mov     symbol+10,r0
-       bic     $!37,r0
-       beq     1f
-       cmp     r0,$5
-       bhis    1f
-       asl     r0
-       add     *reltab-2(r0),symbol+12
-1:
-       rts     r5
-
-lookloc:
-       mov     $local,r4
-1:
-       cmp     r4,locp
-       bhis    1f
-       cmp     (r4)+,r2
-       beq     2f
-       tst     (r4)+
-       br      1b
-1:
-       jsr     r5,mesg; snotfound
-       jmp     sintr
-2:
-       mov     (r4),r4
-       rts     r5
-
-aopen:
-       clr     reopened
-       mov     r0,0f
-       mov     r0,filnam
-       mov     fin,r0
-       beq     1f
-       sys     close
-1:
-       sys     open; 0:..; 0
-       bec     1f
-       jsr     r5,mesg; fnotfound
-       rts     r5
-1:
-       mov     r0,fin
-       tst     (r5)+
-       rts     r5
-
-addin:
-       add     ctxtsiz,txtsiz
-       add     cdatsiz,datsiz
-       add     cbsssiz,bsssiz
-       rts     r5
-
-
-       mov     symbol+10,r0
-       bic     $!37,r0
-       beq     1f
-       cmp     r0,$5
-       bhis    1f
-       asl     r0
-       add     *reltab-2(r0),symbol+12
-1:
-       rts     r5
-
-lookloc:
-       mov     $local,r4
-1:
-       cmp     r4,locp
-       bhis    1f
-       cmp     (r4)+,r2
-       beq     2f
-       tst     (r4)+
-       br      1b
-1:
-       jsr     r5,mesg; snotfound
-       jmp     sintr
-2:
-       mov     (r4),r4
-       rts     r5
-
-aopen:
-       clr     reopened
-       mov     r0,0f
-       mov     r0,filnam
-       mov     fin,r0
-       beq     1f
-       sys     close
-1:
-       sys     open; 0:..; 0
-       bec     1f
-       jsr     r5,mesg; fnotfound
-       rts     r5
-1:
-       mov     r0,fin
-       tst     (r5)+
-       
\ No newline at end of file
diff --git a/cmd/ldx.s b/cmd/ldx.s
deleted file mode 100644 (file)
index 227d2b6..0000000
--- a/cmd/ldx.s
+++ /dev/null
@@ -1,172 +0,0 @@
-/ ldx -- link editor
-
-a.out:
-       <a.out\0>
-l.out:
-       <l.out\0>
-undmes:
-       <un: \0>
-movemes:
-       <Can't move output file\0>
-norel:
-       <No relocation bits: \0>
-toomany:
-       <Too many routines loaded at: \0>
-multi:
-       <Multiply defined: \0>
-locovflo:
-       <Too many symbols in: \0>
-relerr:
-       <Relocation error in: \0>
-premeof:
-       <Premature EOF on: \0>
-outfile:
-       <ld: can't create l.out\n\0>
-fnotfound:
-       <File not found: \0>
-format:
-       <Format error: \0>
-snotfound:
-       <Symbol not found: \0>
-mulent:
-       <Multiple entry point:\0>
-
-libfil:
-       </lib/lib>
-wlib:
-       <a>
-       <.a\0>
-qnl:
-       <\n>
-qsemi:
-       <;>
-
-       .even
-
-dotdot:        ..
-zero:  0
-rlistp:        rlist
-esymp: symtab
-
-reltab:
-       zero
-       txtorg
-       datorg
-       bssorg
-
-arcmagic:
-       -147.
-
-magic:
-       br      .+20
-txtsiz:        .=.+2
-datsiz:        .=.+2
-bsssiz:        .=.+2
-symsiz:        .=.+2
-stksiz:        .=.+2
-exorig:        .=.+2
-relflg:        1
-
-       .bss
-
-libflg:        .=.+2
-sqflg: .=.+2
-entptr:        .=.+2
-entry: .=.+2
-xtflg: .=.+2
-txtorg:        .=.+2
-datorg:        .=.+2
-bssorg:        .=.+2
-fdatorg: .=.+2
-fbssorg: .=.+2
-
-ctxtorg:.=.+2
-ctxtsiz:.=.+2
-cdatorg:.=.+2
-cdatsiz:.=.+2
-cbsssiz: .=.+2
-ctrelorg:.=.+2
-ctrelsiz:.=.+2
-cdrelorg:.=.+2
-cdrelsiz:.=.+2
-csymorg: .=.+2
-csymsiz: .=.+2
-
-arcmag:        .=.+42
-
-argc:  .=.+2
-argp:  .=.+2
-oattpt:        .=.+2
-locp:  .=.+2
-locsymsiz:.=.+2
-fout:  .=.+2
-fin:   .=.+2
-reopened:.=.+2
-ndef:  .=.+2
-ch:    .=.+2
-filnam:        .=.+2
-relbas:        .=.+2
-libnxt:        .=.+2
-symbol:        .=.+14
-
-txtp:  .=.+10+512.
-relp:  .=.+10+512.
-otxtp: .=.+6+512.
-odatp: .=.+6+512.
-osymp: .=.+6+512.
-otrelp:        .=.+6+512.
-odrelp:        .=.+6+512.
-
-rlist: .=.+512.
-rliste:
-
-local: .=.+1024.
-elocal:
-
-hshsiz = 1000.
-hshtab:        .=2*hshsiz+.
-
-symtab:
-esymtab = orig+16384.-300.
-
-relorg:.=.+2
-cdrelsiz:.=.+2
-csymorg: .=.+2
-csymsiz: .=.+2
-
-arcmag:        .=.+42
-
-argc:  .=.+2
-argp:  .=.+2
-oattpt:        .=.+2
-locp:  .=.+2
-locsymsiz:.=.+2
-fout:  .=.+2
-fin:   .=.+2
-reopened:.=.+2
-ndef:  .=.+2
-ch:    .=.+2
-filnam:        .=.+2
-relbas:        .=.+2
-libnxt:        .=.+2
-symbol:        .=.+14
-
-txtp:  .=.+10+512.
-relp:  .=.+10+512.
-otxtp: .=.+6+512.
-odatp: .=.+6+512.
-osymp: .=.+6+512.
-otrelp:        .=.+6+512.
-odrelp:        .=.+6+512.
-
-rlist: .=.+512.
-rliste:
-
-local: .=.+1024.
-elocal:
-
-hshsiz = 1000.
-hshtab:        .=2*hshsiz+.
-
-symtab:
-esymtab = orig+163
\ No newline at end of file
diff --git a/cmd/ln.s b/cmd/ln.s
deleted file mode 100644 (file)
index ed44eb7..0000000
--- a/cmd/ln.s
+++ /dev/null
@@ -1,55 +0,0 @@
-/  link command
-
-ln:
-       mov     sp,r5
-       cmp     (r5)+,$2
-       bhis    1f
-       sys     exit
-1:
-       beq     1f
-       tst     (r5)+
-       mov     (r5)+,0f
-       mov     (r5),0f+2
-       br      2f
-1:
-       tst     (r5)+
-       mov     (r5),0f
-       mov     (r5),r4
-1:
-       tstb    (r4)+
-       bne     1b
-1:
-       cmpb    -(r4),$'/
-       beq     1f
-       cmp     (r5),r4
-       bne     1b
-       br      err
-1:
-       inc     r4
-       mov     r4,0f+2
-2:
-       mov     0f,2f
-       sys     stat; 2:..; stbuf
-       bes     err
-       bit     $40000,stbuf+2
-       bne     err
-       sys     link; 0:..; ..
-       bes     err
-       sys     exit
-
-err:
-       mov     $1,r0
-       sys write; quest; 2
-       sys     exit
-
-quest:
-       <?\n>
-
-.bss
-stbuf: .=.+40.
-
-X
-
-reltm2:
-       .byte 0, 0, 0, 0, 0, 0
-       .byte 0, M,
\ No newline at end of file
diff --git a/cmd/login.s b/cmd/login.s
deleted file mode 100644 (file)
index 1cb388c..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-/  login --  enter new user
-
-.globl ttyn
-.globl crypt
-.globl fopen
-.globl getc
-.globl mesg
-
-       sys     quit; 0
-       sys     intr; 0
-       jsr     pc,ttyn
-       movb    r0,ttyx+8.
-       sub     $'0,r0
-       cmp     r0,$'a-'0
-       blo     1f
-       sub     $'a-'0-10.,r0   / map a-z into 10. on
-1:
-       asl     r0
-       asl     r0
-       asl     r0
-       asl     r0
-       mov     r0,offset
-       mov     (sp)+,r5
-       tst     (sp)+
-       dec     r5
-       ble     login
-       mov     (sp)+,r4
-       mov     $uname,r1
-2:
-       movb    (r4)+,(r1)+
-       bne     2b
-       dec     r5
-       ble     login
-       mov     (sp)+,r4
-       mov     $passwd,r1
-2:
-       movb    (r4)+,(r1)+
-       bne     2b
-login:
-       clrb    uname+8.
-       mov     $passwdf,r0
-       jsr     r5,fopen; pbuf
-       bec     1f
-       jsr     r5,mesg; <Can't open password file\n\0>; .even
-       sys     exit
-1:
-       jsr     pc,guname
-1:
-       jsr     r5,compar; uname
-               br .+4
-       br      2f
-3:
-       jsr     r5,getc; pbuf
-       bes     sorry
-       cmp     r0,$'\n
-       bne     3b
-       br      1b
-sorry:
-       jsr     r5,mesg; <Login incorrect\n\0>; .even
-       mov     pbuf,r0
-       sys     close
-       clr     uname
-       clr     passwd
-       br      login
-2:
-       jsr     r5,getc; pbuf
-       cmp     r0,$':
-       beq     2f
-       mov     r0,-(sp)
-       jsr     pc,gpasswd
-       cmpb    (r0)+,(sp)+
-       bne     sorry
-       mov     r0,0f
-       jsr     r5,compar; 0:..
-               br sorry
-2:
-       clr     r1
-2:
-       jsr     r5,getc; pbuf
-       cmp     r0,$':
-       beq     2f
-       mpy     $10.,r1
-       sub     $'0,r0
-       add     r0,r1
-       br      2b
-2:
-       mov     r1,0f
-       sys     chown; ttyx; 0:..
-       mov     r1,uid
-1:
-       jsr     r5,getc; pbuf
-       cmp     r0,$':
-       bne     1b                      / skip ident field
-       mov     $dirbuf,r1
-1:
-       jsr     r5,getc; pbuf
-       cmpb    r0,$':
-       beq     1f
-       movb    r0,(r1)+
-       br      1b
-1:
-       clrb    (r1)
-       sys     chdir; dirbuf
-       bec     1f
-       jsr     r5,mesg; <No directory\n\0>; .even
-       br      sorry
-1:
-       mov     $uname+8.,r1
-1:
-       tstb    -(r1)
-       bne     1f
-       movb    $' ,(r1)
-       br      1b
-1:
-       cmpb    ttyx+8.,$'x
-       beq     1f
-       sys     open; utmp; 1
-       bes     1f
-       mov     r0,r2
-       sys     seek; offset:..; 0
-       movb    ttyx+8.,uname+8.
-       sys     time
-       mov     r0,uname+10.
-       mov     r1,uname+12.
-       mov     r2,r0
-       sys     write; uname; 16.
-       mov     r2,r0
-       sys     close
-1:
-       cmpb    ttyx+8.,$'x
-       beq     1f
-       sys     open; wtmp; 1
-       bes     1f
-       mov     r0,r1
-       sys     seek; 0; 2
-       sys     write; uname; 16.
-       mov     r1,r0
-       sys     close
-1:
-       jsr     r5,getc; pbuf
-       cmp     r0,$'\n
-       beq     1f
-       mov     $shell,r1
-2:
-       movb    r0,(r1)+
-       jsr     r5,getc; pbuf
-       cmp     r0,$'\n
-       bne     2b
-       clrb    (r1)
-1:
-       mov     pbuf,r0
-       sys     close
-       mov     $motd,r0
-       jsr     r5,fopen; pbuf
-       bes     1f
-2:
-       jsr     r5,getc; pbuf
-       bes     1f
-       mov     r0,uname
-       mov     $1,r0
-       sys     write; uname; 1
-       br      2b
-1:
-       mov     pbuf,r0
-       sys     close
-       sys     stat; mailf; pbuf
-       bes     1f
-       tst     pbuf+6
-       beq     1f
-       jsr     r5,mesg; <You have mail\n\0>; .even
-1:
-       mov     uid,r0
-       sys     setuid
-       sys     exec; shell; shellp
-       jsr     r5,mesg; <No Shell\n\0>; .even
-       sys     exit
-
-gpasswd:
-       mov     $passwd,r1
-       tstb    (r1)
-       bne     3f
-       clr     r0
-       sys     gtty; ttyb
-       bic     $10,ttyb+4              / turn off echo
-       clr     r0
-       sys     stty; ttyb
-       jsr     r5,mesg; <Password: \0>; .even
-2:
-       jsr     pc,tgetc
-       movb    r0,(r1)+
-       beq     1f
-       cmp     r1,$passwd+9.
-       blo     2b
-       dec     r1
-       br      2b
-1:
-       bis     $10,ttyb+4              / turn on echo
-       clr     r0
-       sys     stty; ttyb
-       jsr     r5,mesg; <\n\0>; .even
-3:
-       mov     $passwd,r0
-       jsr     pc,crypt
-       clrb    8(r0)
-       rts     pc
-
-guname:
-       mov     $uname,r1
-       tstb    (r1)
-       bne     1f
-       clr     (r1)+
-       clr     (r1)+
-       clr     (r1)+
-       clr     (r1)+
-       mov     $uname,r1
-       jsr     r5,mesg; <Name: \0>; .even
-2:
-       jsr     pc,tgetc
-       movb    r0,(r1)+
-       beq     1f
-       cmp     r1,$uname+9.
-       blo     2b
-       dec     r1
-       br      2b
-1:
-       rts     pc
-
-compar:
-       mov     (r5)+,r4
-1:
-       jsr     r5,getc; pbuf
-       bes     2f
-       cmpb    r0,(r4)+
-       beq     1b
-       cmp     r0,$':
-       bne     1f
-       tstb    -(r4)
-       bne     1f
-       tst     (r5)+
-1:
-       rts     r5
-2:
-       tst     (sp)+
-       jmp     sorry
-
-tgetc:
-       clr     r0
-       sys     read; ch; 1
-       tst     r0
-       bne     1f
-       sys     exit
-1:
-       mov     ch,r0
-       cmp     r0,$'\n
-       bne     1f
-       clr     r0
-1:
-       rts     pc
-
-shellp:
-       mshell
-       0
-utmp:  </tmp/utmp\0>
-wtmp:  </tmp/wtmp\0>
-shell: </bin/sh\0>; .=shell+32.
-mshell:        <-\0>
-motd:  </etc/motd\0>
-mailf: <mailbox\0>
-passwdf:</etc/passwd\0>
-ttyx:  </dev/ttyx\0>
-.even
-.bss
-uname: .=.+16.
-passwd:        .=.+8.
-dirbuf:        .=.+32.
-shbuf: .=.+32.
-ttyb:  .=.+6
-uid:   .=.+2
-ch:    .=.+2
-pbuf:  .=.+518.
-
-b
-       cmp     r0,$':
-       bne     1f
-       tstb    -(r4)
-       bne     1f
-       tst     (r5)+
-1:
-       rts     r5
-2:
-       tst     (sp)+
-       jmp     sorry
-
-tgetc:
-       clr     r0
-       sys     read; ch; 1
-       tst     r0
-       bne     1f
-       sys     exit
diff --git a/cmd/ls.s b/cmd/ls.s
deleted file mode 100644 (file)
index 1051ba2..0000000
--- a/cmd/ls.s
+++ /dev/null
@@ -1,633 +0,0 @@
-/ ls -- list file or directory
-
-.globl flush
-.globl fopen
-.globl getw
-.globl         getc
-.globl putc
-.globl ctime
-.globl end
-
-       sys     break; end+512.
-       mov     $1,obuf
-       mov     sp,r5
-       mov     (r5)+,count
-       tst     (r5)+
-       dec     count
-       mov     count,ocount
-       bgt     loop
-       mov     $dotp,r5
-loop:
-       mov     (r5)+,r4
-       cmpb    (r4)+,$'-
-       bne     1f
-       dec     ocount
-3:
-       movb    (r4)+,r0
-       beq     eloop
-       cmp     r0,$'l
-       bne     4f
-       inc     longf
-       br      3b
-4:
-       cmpb    r0,$'t
-       bne     4f
-       mov     $14.,sortoff
-       br      3b
-4:
-       cmpb    r0,$'a
-       bne     4f
-       inc     allflg
-       br      3b
-4:
-       cmpb    r0,$'s
-       bne     4f
-       incb    longf+1
-       br      3b
-4:
-       cmpb    r0,$'d
-       bne     3b
-       inc     dirflg
-       br      3b
-1:
-       dec     r4
-       jsr     pc,do
-eloop:
-       dec     count
-       bgt     loop
-       tst     dnp
-       bne     1f
-       mov     $dotp,r5
-       br      loop
-1:
-       jsr     r5,flush; obuf
-       sys     exit
-
-do:
-       clr     tblocks
-       mov     $end,r1
-       mov     $filnam,r3
-       mov     r4,dnp
-       clr     isadir
-       tst     dirflg
-       bne     nondir
-       sys     stat; dnp: 0; statb
-       bec     1f
-       jsr     r5,questf; < nonexistent\n\0>; .even
-       rts     pc
-1:
-       bit     $40000,statb+2  /test directory
-       beq     nondir
-       inc     isadir
-       mov     r4,r0
-       jsr     r5,fopen; dbuf
-       bcc     1f
-       jsr     r5,questf; < unreadable\n\0>; .even
-       rts     pc
-1:
-       movb    (r4)+,(r3)+
-       bne     1b
-       dec     r3
-       cmpb    -1(r3),$'/
-       beq     1f
-       movb    $'/,(r3)+
-1:
-       jsr     r5,getw; dbuf
-       bcs     pass2
-       mov     $4,-(sp)
-       tst     r0
-       bne     2f
-3:
-       jsr     r5,getw; dbuf
-       dec     (sp)
-       bne     3b
-       tst     (sp)+
-       br      1b
-2:
-       mov     r3,r2
-2:
-       jsr     r5,getw; dbuf
-       mov     r0,(r1)+
-       movb    r0,(r2)+
-       swab    r0
-       movb    r0,(r2)+
-       dec     (sp)
-       bne     2b
-       tst     (sp)+
-       clrb    (r2)+
-       tst     allflg
-       bne     2f
-       cmpb    (r3),$'.
-       bne     2f
-       sub     $8.,r1
-       br      1b
-2:
-       jsr     r5,gstat
-       br      1b
-nondir:
-       mov     r3,r2
-1:
-       movb    (r4)+,(r2)+
-       bne     1b
-1:
-       cmp     r2,r3
-       blos    1f
-       cmpb    -(r2),$'/
-       bne     1b
-       inc     r2
-1:
-       mov     $8.,-(sp)
-1:
-       movb    (r2)+,(r1)+
-       bne     2f
-       dec     r2
-2:
-       dec     (sp)
-       bne     1b
-       jsr     r5,gstat
-       tst     (sp)+
-
-pass2:
-       mov     dbuf,r0
-       sys     close
-       mov     $end,r2
-       cmp     r1,r2
-       bne     1f
-       rts     pc
-1:
-       mov     r5,-(sp)
-       mov     r1,-(sp)
-       add     sortoff,r2
-1:
-       mov     r2,(r1)+
-       add     $20.,r2
-       cmp     r2,(sp)
-       blo     1b
-       mov     (sp),r2
-       tst     -(r1)
-1:
-       mov     r2,r3
-2:
-       tst     (r3)+
-       cmp     r3,r1
-       bhi     2f
-       mov     (r2),r4
-       mov     (r3),r5
-       tst     sortoff
-       beq     4f
-       cmp     (r4)+,(r5)+
-       blo     3f
-       bhi     2b
-       cmp     (r4)+,(r5)+
-       blo     3f
-       br      2b
-4:
-4:
-       cmpb    (r4)+,(r5)+
-       bhi     3f
-       blo     2b
-       dec     r0
-       br      4b
-3:
-       mov     (r2),-(sp)
-       mov     (r3),(r2)
-       mov     (sp)+,(r3)
-       br      2b
-2:
-       tst     (r2)+
-       cmp     r2,r1
-       blo     1b
-1:
-       mov     (sp)+,r2
-       mov     (sp)+,r5
-
-pass3:
-       cmp     ocount,$1
-       ble     1f
-       tst     isadir
-       beq     2f
-       mov     dnp,0f
-       jsr     r5,pstring; 0:..
-       jsr     r5,pstring; colon
-1:
-       tst     longf
-       beq     1f
-       jsr     r5,pstring; totmes
-       mov     tblocks,r0
-       jsr     r5,decimal; 4
-       jsr     r5,pstring; nl
-2:
-       tstb    longf
-       beq     1f
-       mov     $passwd,r0
-       jsr     r5,fopen; iobuf
-       bes     1f
-       mov     $uidbuf,r3
-3:
-2:
-       jsr     r5,getc; iobuf
-       bes     3f
-       movb    r0,(r3)+
-       cmpb    r0,$':
-       bne     2b
-2:
-       jsr     r5,getc; iobuf
-       cmpb    r0,$':
-       bne     2b
-2:
-       jsr     r5,getc; iobuf
-       cmpb    r0,$':
-       beq     2f
-       movb    r0,(r3)+
-       br      2b
-2:
-       movb    $'\n,(r3)+
-       cmp     r3,$euidbuf
-       bhis    3f
-2:
-       jsr     r5,getc; iobuf
-       cmpb    r0,$'\n
-       bne     2b
-       br      3b
-3:
-       mov     r3,euids
-       sys     close
-1:
-       cmp     r2,r1
-       bhi     1f
-       mov     (r2)+,r3
-       sub     sortoff,r3
-       jsr     r5,pentry
-       mov     $8.,-(sp)
-2:
-       movb    (r3)+,r0
-       beq     2f
-       jsr     r5,putc; obuf
-       dec     (sp)
-       bne     2b
-2:
-       tst     (sp)+
-       jsr     r5,pstring; nl
-       br      1b
-1:
-       cmp     ocount,$1
-       ble     1f
-       tst     isadir
-       beq     1f
-       jsr     r5,pstring; nl
-1:
-       rts     pc
-
-pentry:
-       mov     r2,-(sp)
-       tstb    longf
-       bne     listl
-       tstb    longf+1
-       bne     2f
-       mov     (sp)+,r2
-       rts     r5
-2:
-       mov     12.(r3),r0
-       jsr     r5,calcb
-       jsr     r5,decimal; 3
-       jsr     r5,pstring; space
-       mov     (sp)+,r2
-       rts     r5
-pstring:
-       mov     r5,-(sp)
-       mov     (r5),r5
-1:
-       movb    (r5)+,r0
-       beq     1f
-       jsr     r5,putc; obuf
-       br      1b
-1:
-       mov     (sp)+,r5
-       tst     (r5)+
-       rts     r5
-
-questf:
-       mov     r4,0f
-       jsr     r5,pstring; 0:..
-       mov     r5,0f
-       jsr     r5,pstring; 0:..
-1:
-       tstb    (r5)+
-       bne     1b
-       inc     r5
-       bic     $1,r5
-       rts     r5
-listl:
-       mov     18.(r3),r0      / inode
-       jsr     r5,decimal; 4
-       jsr     r5,pstring; space
-       mov     r3,r4
-       add     $8.,r4          / get to flags
-       bit     $10000,(r4)  /large
-       beq     2f
-       jsr     r5,mode; 'l
-       br      3f
-2:
-       jsr     r5,mode; 's
-3:
-       bit     $40000,(r4) /directory
-       beq     2f
-       jsr     r5,mode; 'd
-       br      3f
-2:
-       bit     $40,(r4)  /set uid
-       beq     2f
-       jsr     r5,mode; 'u
-       br      3f
-2:
-       bit     $20,(r4)   /executable
-       beq     2f
-       jsr     r5,mode; 'x
-       br      3f
-2:
-       jsr     r5,mode; '-
-3:
-       bit     $10,(r4)  /read owner
-       beq     2f
-       jsr     r5,mode; 'r
-       br      3f
-2:
-       jsr     r5, mode; '-
-3:
-       bit     $4,(r4)  /write owner
-       beq     2f
-       jsr     r5,mode; 'w
-       br      3f
-2:
-       jsr     r5,mode; '-
-3:
-       bit     $2,(r4)  /read non-owner
-       beq     2f
-       jsr     r5,mode; 'r
-       br      3f
-2:
-       jsr     r5,mode; '-
-3:
-       bit     $1,(r4)+  /write non-owner
-       beq     2f
-       jsr     r5,mode; 'w
-       br      3f
-2:
-       jsr     r5,mode; '-
-3:
-       jsr     r5,pstring; space
-       movb    (r4)+,r0
-       jsr     r5,decimal; 2
-       movb    (r4)+,r2
-       jsr     pc,puid
-       mov     (r4)+,r0
-       jsr     r5,decimal; 5
-       jsr     r5,pstring; space
-       mov     r1,-(sp)
-       mov     (r4)+,r0
-       mov     (r4)+,r1
-       sub     $16.,sp
-       mov     sp,r2
-       jsr     pc,ctime
-       mov     sp,r2
-       mov     $15.,-(sp)
-1:
-       movb    (r2)+,r0
-       jsr     r5,putc; obuf
-       dec     (sp)
-       bne     1b
-       add     $18.,sp
-       mov     (sp)+,r1
-       jsr     r5,pstring; space
-       mov     (sp)+,r2
-       rts     r5
-
-puid:
-       mov     r1,-(sp)
-       mov     $uidbuf,r1
-1:
-       cmp     r1,euids
-       bhis    1f
-       mov     r1,0f
-2:
-       tstb    (r1)+
-       beq     3f
-       cmpb    -1(r1),$':
-       bne     2b
-       clrb    -1(r1)
-3:
-       clr     -(sp)
-3:
-       movb    (r1)+,r0
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     3f
-       mov     r1,-(sp)
-       mov     2(sp),r1
-       mpy     $10.,r1
-       add     r0,r1
-       mov     r1,2(sp)
-       mov     (sp)+,r1
-       br      3b
-3:
-       mov     (sp)+,r0
-       cmp     r0,r2
-       bne     1b
-       jsr     r5,pstring; space
-       jsr     r5,pstring; 0:..
-       mov     0b,r1
-       mov     $6,-(sp)
-3:
-       tstb    (r1)+
-       beq     3f
-       dec     (sp)
-       br      3b
-3:
-       jsr     r5,pstring; space
-       dec     (sp)
-       bgt     3b
-       tst     (sp)+
-       mov     (sp)+,r1
-       rts     pc
-1:
-       jsr     r5,pstring; space
-       mov     r2,r0
-       jsr     r5,decimal; 3
-       jsr     r5,pstring; space3
-       mov     (sp)+,r1
-       rts     pc
-
-mode:
-       mov     (r5)+,r0
-       jsr     r5,putc; obuf
-       rts     r5
-
-
-gstat:
-       mov     r1,-(sp)
-       add     $512.,r1
-       cmp     r1,0f
-       blo     1f
-       mov     r1,0f
-       sys     break; 0: end+512.
-1:
-       mov     (sp)+,r1
-       tst     longf
-       bne     2f
-       tst     sortoff
-       beq     1f
-2:
-       sys     stat; filnam; statb
-       bec     2f
-       mov     r4,-(sp)
-       mov     $filnam,r4
-       jsr     r5,questf; < unstatable\n\0>; .even
-       mov     (sp)+,r4
-       add     $12.,r1
-       rts     r5
-2:
-       mov     $statb+2,r0
-       mov     (r0)+,(r1)+     /flags
-       mov     (r0)+,(r1)+     /nlinks, uid
-       mov     r0,-(sp)
-       mov     (r0),r0
-       jsr     r5,calcb
-       add     r0,tblocks
-       mov     (sp)+,r0
-       mov     (r0)+,(r1)+     /size
-       add     $20.,r0         /dska, ctim
-       mov     (r0)+,(r1)+     /mtim
-       mov     (r0)+,(r1)+
-       mov     statb,(r1)+     /inode
-       rts     r5
-1:
-       add     $12.,r1
-       rts     r5
-
-decimal:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     $6,r2
-       mov     $numbuf+6,r3
-1:
-       mov     r0,r1
-       clr     r0
-       dvd     $10.,r0
-       add     $'0,r1
-       movb    r1,-(r3)
-       sob     r2,1b
-1:
-       cmp     r3,$numbuf+5
-       beq     1f
-       cmpb    (r3),$'0
-       bne     1f
-       movb    $' ,(r3)+
-       br      1b
-1:
-       mov     $numbuf+6,r1
-       sub     (r5),r1
-       mov     (r5)+,-(sp)
-1:
-       movb    (r1)+,r0
-       jsr     r5,putc; obuf
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       rts     r5
-
-calcb:
-       add     $511.,r0
-       clrb    r0
-       swab    r0
-       asr     r0
-       cmp     r0,$8
-       blo     1f
-       inc     r0
-1:
-1:
-       rts     r5
-
-
-dotp:  dot
-euids: uidbuf
-
-dot:   <.\0>
-nl:    <\n\0>
-totmes:        <total \0>
-space3:        <  >
-space: < \0>
-passwd:        </etc/passwd\0>
-colon: <:\n\0>
-       .even
-
-.bss
-
-count: .=.+2
-ocount:        .=.+2
-longf: .=.+2
-sortoff: .=.+2
-allflg:        .=.+2
-dirflg:        .=.+2
-isadir:        .=.+2
-filnam:        .=.+32.
-statb: .=.+34.
-dbuf:  .=.+518.
-obuf:  .=.+518.
-numbuf:        .=.+6
-tblocks: .=.+2
-uidbuf:        .=.+1024.
-euidbuf:
-iobuf: .=.+518.
-
-(sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       rts     r5
-
-calcb:
-       add     $511.,r0
-       clrb    r0
-       swab    r0
-       asr     r0
-       cmp     r0,$8
-       blo     1f
-       inc     r0
-1:
-1:
-       rts     r5
-
-
-dotp:  dot
-euids: uidbuf
-
-dot:   <.\0>
-nl:    <\n\0>
-totmes:        <total \0>
-space3:        <  >
-space: < \0>
-passwd:        </etc/passwd\0>
-colon: <:\n\0>
-       .even
-
-.bss
-
-count: .=.+2
-ocount:        .=.+2
-longf: .=.+2
-sortoff: .=.+2
-allflg:        .=.+2
-dirflg:        .=.+2
-isadir:        .=.+2
-filnam:        .=.+32.
-statb: .=.+34.
-dbuf:  .=.+518.
-obuf:  .=.+518.
-numbuf:        .=.+6
-tblocks: .=.+2
-uidbuf:        .=.+1024.
-euidbuf:
-iobuf: .=.+518.
\ No newline at end of file
diff --git a/lib/bsw.s b/lib/bsw.s
deleted file mode 100644 (file)
index 9e6e0ca..0000000
--- a/lib/bsw.s
+++ /dev/null
@@ -1,223 +0,0 @@
-/ crt -- c runtime routines
-
-.globl retrn
-.globl bswitch
-.globl _getchar
-.globl _putchar
-.globl _flush
-.globl _fin
-.globl _fout
-
-.globl _main
-.globl getc
-.globl putc
-.globl flush
-
-start:
-       mov     $mq,r4
-       mov     sp,r0
-       mov     (r0),-(sp)
-       tst     (r0)+
-       mov     r0,2(sp)
-       jsr     pc,*_main
-       clr     r0
-       sys     exit
-
-retrn:
-       mov     r5,sp
-       mov     (sp)+,r5
-       rts     pc
-
-_getchar:.+2
-1:
-       jsr     r5,getc; _fin
-       bcs     1f
-       tst     r0
-       beq     1b
-       rts     pc
-1:
-       clr     r0
-       rts     pc
-
-_putchar:.+2
-       mov     2(sp),r0
-       tst     _fout
-       bne     1f
-       mov     $1,_fout
-1:
-       jsr     r5,putc; _fout
-       movb    3(sp),r0
-       beq     1f
-       jsr     r5,putc; _fout
-1:
-       cmp     _fout,$1
-       bne     1f
-       jsr     r5,flush; _fout
-1:
-       mov     2(sp),r0
-       rts     pc
-
-_flush:
-       .+2
-       jsr     r5,flush; _fout
-       rts     pc
-
-bswitch:
-       mov     *(sp),r1
-       mov     r1,base
-       mov     (r1),r2         / low
-       mov     (r1)+,r3        / hi
-       mov     $1,-(sp)        / n
-       tst     (r1)+
-       bne     1f
-       4                       / n = 0
-1:
-       tst     2(r1)
-       beq     1f
-       cmp     (r1),r2
-       bhis    2f
-       mov     (r1),r2
-2:
-       cmp     (r1)+,r3
-       blo     2f
-       mov     -2(r1),r3
-2:
-       tst     (r1)+
-       inc     (sp)
-       br      1b
-1:
-       sub     r2,r3           / spread
-       asl     (sp)
-       inc     r3
-       cmp     r3,(sp)
-       blo     initd           / if spread < 2*ncase direct
-
-initb:
-       clr     (sp)            / flag
-       mov     base,r2
-       mov     r2,r3
-       add     $4,r3
-1:
-       cmp     r3,r1
-       bhis    1f
-       cmp     (r2)+,(r3)+
-       blos    2f
-       mov     -(r2),-(sp)
-       mov     -(r3),(r2)+
-       mov     (sp)+,(r3)+
-       mov     (r2),-(sp)
-       mov     (r3),(r2)
-       mov     (sp)+,(r3)
-       inc     (sp)
-2:
-       cmp     (r2)+,(r3)+
-       br      1b
-1:
-       tst     (sp)
-       bne     initb
-       cmp     (sp)+,(r1)+
-       mov     r1,-(sp)
-1:
-       mov     -(r1),2(r1)
-       cmp     r1,base
-       bhi     1b
-       mov     (sp)+,(r1)
-       mov     $binary+4,r3
-       br      init
-
-initd:
-       mov     (sp)+,r3
-       mov     r3,twon
-       mov     r3,twona
-       mov     r2,-(sp)                / low
-       mov     r3,-(sp)                / 2*n
-1:
-       mov     base,r3
-2:
-       cmp     (r3)+,r2
-       beq     2f
-       tst     (r3)+
-       cmp     r3,r1
-       blo     2b
-       mov     (r1),-(sp)              / no match, default
-       br      3f
-2:
-       mov     (r3),-(sp)              / match
-3:
-       inc     r2
-       dec     twon
-       bne     1b
-       add     $4,r1
-       add     $2,twona
-1:
-       mov     (sp)+,-(r1)
-       dec     twona
-       bne     1b
-       mov     $direct+4,r3
-
-init:
-       mov     (sp)+,r2
-       mov     -(r3),-(r2)
-       mov     -(r3),-(r2)
-       jmp     (r2)
-
-direct:
-       jsr     pc,*$1f
-
-
-/      lowval; nval
-/      l1; l2; ...; ln
-/      ld
-
-1:
-       mov     *(sp)+,r1
-       sub     (r1)+,r0        / low limit
-       cmp     r0,(r1)+        / n cases
-       blo     1f
-       mov     -(r1),r0        / default
-1:
-       asl     r0
-       add     r0,r1
-       jmp     *(r1)+
-
-binary:
-       jsr     pc,*$1f
-
-/      end
-/      v1;l1; v2;l2; ...; vn;ln
-/end:  ld
-
-1:
-       mov     *(sp)+,r1       / low
-       mov     (r1)+,r2        / high
-       mov     (r2),-(sp)      / default
-       br      1f
-
-llo:
-       mov     r3,r2
-       br      1f
-lhi:
-       mov     r3,r1
-       add     $4,r1
-1:
-       mov     r2,r3
-       sub     r1,r3
-       beq     1f
-       asr     r3
-       bic     $3,r3
-       add     r1,r3
-       cmp     r0,(r3)
-       bhi     lhi
-       blo     llo
-       tst     (sp)+
-       jmp     *2(r3)
-1:
-       rts     pc
-
-.bss
-base:  .=.+2
-twon:  .=.+2
-twona: .=.+2
-_fin:  .=.+518.
-_fout: .=.+518.
-
diff --git a/lib/chdir.s b/lib/chdir.s
deleted file mode 100644 (file)
index 8d8e91e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/ C library -- chdir
-
-/ error = chdir(string);
-
-       .globl  _chdir
-
-.data
-_chdir:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       clr     r0
-       sys     chdir; 0:..
-       adc     r0
-       rts     pc
-
diff --git a/lib/chmod.s b/lib/chmod.s
deleted file mode 100644 (file)
index eb3f2e7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/ C library -- chmod
-
-/ error = chmod(string, mode);
-
-       .globl  _chmod
-
-.data
-_chmod:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       clr     r0
-       sys     chmod; 0:..; ..
-       adc     r0
-       rts     pc
-
diff --git a/lib/chown.s b/lib/chown.s
deleted file mode 100644 (file)
index c8c71c7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/ C library -- chown
-
-/ error = chown(string, owner);
-
-       .globl  _chown
-
-.data
-_chown:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       clr     r0
-       sys     chown; 0:..; ..
-       adc     r0
-       rts     pc
-
diff --git a/lib/close.s b/lib/close.s
deleted file mode 100644 (file)
index a5463fa..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/ C library -- close
-
-/error =  close(file);
-
-       .globl  _close
-
-.data
-_close:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       clr     r1
-       sys     close
-       adc     r1
-       mov     r1,r0
-       rts     pc
-
diff --git a/lib/creat.s b/lib/creat.s
deleted file mode 100644 (file)
index 36fa040..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C library -- creat
-
-/ file = creat(string, mode);
-/
-/ file == -1 if error
-
-       .globl  _creat
-
-.data
-_creat:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       sys     creat; 0:..; ..
-       bec     1f
-       mov     $-1,r0
-1:
-       rts     pc
-
diff --git a/lib/crt0.s b/lib/crt0.s
deleted file mode 100644 (file)
index c049e36..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C runtime startoff
-
-.globl retrn
-
-.globl _main
-
-start:
-       mov     $mq,r4
-       mov     sp,r0
-       mov     (r0),-(sp)
-       tst     (r0)+
-       mov     r0,2(sp)
-       jsr     pc,*_main
-       clr     r0
-       sys     exit
-
-retrn:
-       mov     r5,sp
-       mov     (sp)+,r5
-       rts     pc
-
diff --git a/lib/ctime.s b/lib/ctime.s
deleted file mode 100644 (file)
index dd5d125..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ C library -- ctime
-
-/ ctime(v1, v2);
-/ v1 is input time [2]
-/ v2 is char[16] ascii time
-/ format is 0123456789012345
-/           Mmm dd hh:mm:sse
-/
-
-.globl _ctime
-.globl ctime
-
-.data
-_ctime:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     (r0)+,-(sp)
-       mov     (r0)+,mq
-       mov     (sp)+,ac
-       mov     4(sp),r0
-       clrb    15.(r0)
-       jsr     pc,ctime
-       rts     pc
-
diff --git a/lib/execl.s b/lib/execl.s
deleted file mode 100644 (file)
index 8aafd44..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- execl
-
-/ execl(file, arg1, arg2, ... , 0);
-/
-/
-       .globl  _execl
-
-.data
-_execl:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     sp,r0
-       add     $4,r0
-       mov     r0,0f+2
-       sys     exec; 0:..; ..
-       rts     pc
-
diff --git a/lib/execv.s b/lib/execv.s
deleted file mode 100644 (file)
index 0a48fd4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- execv
-
-/ execv(file, argv);
-/
-/ where argv is a vector argv[0] ... argv[x], 0
-/ last vector element must be 0
-/
-       .globl  _execv
-
-.data
-_execv:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       sys     exec; 0:..; ..
-       rts     pc
-
diff --git a/lib/exit.s b/lib/exit.s
deleted file mode 100644 (file)
index 4c146e4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/ C library -- exit
-
-/ exit(code)
-/ code is return in r0 to system
-
-.globl _exit
-
-.data
-_exit:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       sys     exit
-
diff --git a/lib/fork.s b/lib/fork.s
deleted file mode 100644 (file)
index 51a76f0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- fork
-
-/ pid = fork();
-/
-/ pid == 0 in child process; pid == -1 means error return
-
-       .globl  _fork
-
-.data
-_fork:
-       1f
-.text
-1:
-       sys     fork
-               br 1f
-       bes     2f
-       rts     pc
-2:
-       mov     $-1,r0
-       rts     pc
-1:
-       clr     r0
-       rts     pc
-
diff --git a/lib/fstat.s b/lib/fstat.s
deleted file mode 100644 (file)
index 0fc2f97..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/ C library -- fstat
-
-/ error = fstat(file, statbuf);
-
-/ int statbuf[17] or
-/ char statbuf[34]
-/ as appropriate
-
-       .globl  _fstat
-
-.data
-_fstat:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     4(sp),0f
-       sys     fstat; 0:..
-       bec     1f
-       mov     $1,r0
-       rts     pc
-1:
-       clr     r0
-       rts     pc
-
diff --git a/lib/getchr.s b/lib/getchr.s
deleted file mode 100644 (file)
index 2cb4588..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- getchar
-
-.globl _getchar
-.globl _fin
-
-.globl getc
-
-.data
-_getchar:
-       1f
-.text
-1:
-       jsr     r5,getc; _fin
-       bcs     1f
-       tst     r0
-       beq     1b
-       rts     pc
-1:
-       clr     r0
-       rts     pc
-
-.bss
-_fin:  .=.+518.
-
diff --git a/lib/getuid.s b/lib/getuid.s
deleted file mode 100644 (file)
index 278e9e4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C library -- getuid
-
-/ uid = getuid();
-/
-/ uid == -1 if error
-
-       .globl  _getuid
-
-.data
-_getuid:
-       1f
-.text
-1:
-       sys     getuid
-       bec     1f
-       mov     $-1,r0
-       rts     pc
-1:
-       bic     $!377,r0
-       rts     pc
-
diff --git a/lib/gtty.s b/lib/gtty.s
deleted file mode 100644 (file)
index 6a9d4c5..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- gtty
-
-/ error = gtty(filep, ttyvec);
-
-/ filep is descriptor of open tty
-/ ttyvec[0, 1, 2] correspond to args of gtty
-
-.globl _gtty
-
-.data
-_gtty:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     4(sp),0f
-       sys     gtty; 0:..
-       bes     1f
-       clr     r0
-       rts     pc
-1:
-       mov     $1,r0
-       rts     r0
-
diff --git a/lib/intr.s b/lib/intr.s
deleted file mode 100644 (file)
index e39ad5b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/ C library -- intr
-
-/ intr(0); /* exit on interrupt */
-/ intr(anything_odd); /* ignore interrupts */
-/ intr(label); /* goto label on interrupts */
-
-       .globl  _intr
-
-.data
-_intr:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       beq     1f
-       bit     $1,r0
-       beq     2f
-1:
-       bic     $1,r0
-       mov     r0,0f
-       sys     intr; 0:..
-       rts     pc
-2:
-       mov     r5,9f
-       mov     r0,9f+2
-       sys     intr; 1f
-       rts     pc
-
-/ here on interrupts
-
-1:
-       mov     9f,r5
-       jmp     *9f+2
-
-.bss
-9:
-       .=.+4
-
diff --git a/lib/link.s b/lib/link.s
deleted file mode 100644 (file)
index 8116ee9..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- link
-
-/ error = link(old-file, new-file);
-/
-
-       .globl  _link
-
-.data
-_link:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       clr     r0
-       sys     link; 0:..; ..
-       adc     r0
-       rts     pc
-
diff --git a/lib/makdir.s b/lib/makdir.s
deleted file mode 100644 (file)
index c925954..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/ C library -- makdir
-
-/ error = makdir(string);
-
-       .globl  _makdir
-
-.data
-_makdir:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       clr     r0
-       sys     makdir; 0:..
-       adc     r0
-       rts     pc
-
diff --git a/lib/open.s b/lib/open.s
deleted file mode 100644 (file)
index 8f829ec..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C library -- open
-
-/ file = open(string, mode)
-/
-/ file == -1 means error
-
-       .globl  _open
-
-.data
-_open:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       sys     open; 0:..; ..
-       bec     1f
-       mov     $-1,r0
-1:
-       rts     pc
-
diff --git a/lib/printf.c b/lib/printf.c
deleted file mode 100644 (file)
index aecf96e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-printn(n,b) {
-       extern putchar;
-       auto a;
-
-       if(a=n/b) /* assignment, not test for equality */
-               printn(a, b); /* recursive */
-       putchar(n%b + '0');
-}
-
-printf(fmt,x1,x2,x3,x4,x5,x6,x7,x8,x9)
-       char fmt[];
-       {
-       extern printn, putchar;
-       char s[];
-       auto adx[], x, c;
-
-       adx = &x1; /* argument pointer */
-loop:
-       while((c = *fmt++) != '%') {
-               if(c == '\0')
-                       return;
-               putchar(c);
-       }
-       x = *adx++;
-       switch (c = *fmt++) {
-
-       case 'd': /* decimal */
-       case 'o': /* octal */
-               if(x < 0) {
-                       x = -x;
-                       if(x<0) {       /* is - infinity */
-                               if(c=='o')
-                                       printf("100000");
-                               else
-                                       printf("-32768");
-                               goto loop;
-                       }
-                       putchar('-');
-               }
-               printn(x, c=='o'?8:10);
-               goto loop;
-
-       case 'c': /* char */
-               putchar(x);
-               goto loop;
-
-       case 's': /* string */
-               s = x;
-               while(c = *s++)
-                       putchar(c);
-               goto loop;
-       }
-       putchar('%');
-       fmt--;
-       adx--;
-       goto loop;
-}
-
diff --git a/lib/printf.s b/lib/printf.s
deleted file mode 100644 (file)
index d15b150..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-.globl _printn
-.data; _printn:1f
-.text; 1:mov r5,-(sp); mov sp,r5
-tst    -(sp)
-mov    4(r5),(r4)
-mov    6(r5),div
-mov    (r4),r0
-mov    r0,-2(r5)
-bne    l2
-jmp    l1
-l2:mov 6(r5),-(sp)
-mov    -2(r5),-(sp)
-jsr    pc,*_printn
-cmp    (sp)+,(sp)+
-l1:mov 4(r5),(r4)
-mov    6(r5),div
-mov    ac,r0
-mov    r0,-(sp)
-add    $60,(sp)
-jsr    pc,*_putchar
-tst    (sp)+
-jmp    retrn
-.globl _printf
-.data; _printf:1f
-.text; 1:mov r5,-(sp); mov sp,r5
-add    $-10,sp
-mov    r5,r0
-add    $6,r0
-mov    r0,-4(r5)
-.data; l3: 1f; .text; 1:
-l4:mov 4(r5),r0
-inc    4(r5)
-movb   (r0),r0
-mov    r0,-10(r5)
-cmp    r0,$45
-bne    l6
-jmp    l5
-l6:tst -10(r5)
-beq    l8
-jmp    l7
-l8:jmp retrn
-l7:mov -10(r5),-(sp)
-jsr    pc,*_putchar
-tst    (sp)+
-jmp    l4
-l5:mov -4(r5),r0
-add    $2,-4(r5)
-mov    (r0),-6(r5)
-mov    4(r5),r0
-inc    4(r5)
-movb   (r0),r0
-mov    r0,-10(r5)
-jsr    pc,bswitch; l9
-l10:l11:tst    -6(r5)
-blt    l13
-jmp    l12
-l13:mov        -6(r5),r0
-neg    r0
-mov    r0,-6(r5)
-tst    -6(r5)
-blt    l15
-jmp    l14
-l15:cmp        -10(r5),$157
-beq    l17
-jmp    l16
-l17:.data; l18:
-.byte 61,60,60,60,60,60,0
-.even;.text
-mov    $l18,-(sp)
-jsr    pc,*_printf
-tst    (sp)+
-jmp    l19
-l16:.data; l20:
-.byte 55,63,62,67,66,70,0
-.even;.text
-mov    $l20,-(sp)
-jsr    pc,*_printf
-tst    (sp)+
-l19:jmp        *l3
-l14:mov        $55,-(sp)
-jsr    pc,*_putchar
-tst    (sp)+
-l12:cmp        -10(r5),$157
-bne    l21
-mov    $10,-(sp)
-br     l22
-l21:mov        $12,-(sp)
-l22:mov        -6(r5),-(sp)
-jsr    pc,*_printn
-cmp    (sp)+,(sp)+
-jmp    *l3
-l23:mov        -6(r5),-(sp)
-jsr    pc,*_putchar
-tst    (sp)+
-jmp    *l3
-l24:mov        -6(r5),-2(r5)
-l25:mov        -2(r5),r0
-inc    -2(r5)
-movb   (r0),r0
-mov    r0,-10(r5)
-bne    l27
-jmp    l26
-l27:mov        -10(r5),-(sp)
-jsr    pc,*_putchar
-tst    (sp)+
-jmp    l25
-l26:jmp        *l3
-l28:.data
-l9:163; l24
-143; l23
-157; l11
-144; l10
-l28; 0
-.text
-mov    $45,-(sp)
-jsr    pc,*_putchar
-tst    (sp)+
-dec    4(r5)
-mov    -4(r5),r0
-sub    $2,-4(r5)
-jmp    *l3
-jmp    retrn
diff --git a/lib/putchr.s b/lib/putchr.s
deleted file mode 100644 (file)
index 627a8de..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/ C library -- putchar
-
-/ char = putchar(char)
-
-/ buffer output if fout is not 1
-
-.globl _putchar
-.globl _fout
-.globl _flush
-
-.globl putc
-.globl flush
-
-.data
-_putchar:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       tst     _fout
-       bne     1f
-       mov     $1,_fout
-1:
-       jsr     r5,putc; _fout
-       movb    3(sp),r0
-       beq     1f
-       jsr     r5,putc; _fout
-1:
-       cmp     _fout,$1
-       bne     1f
-       jsr     r5,flush; _fout
-1:
-       mov     2(sp),r0
-       rts     pc
-
-.data
-_flush:
-       1f
-.text
-1:
-       jsr     r5,flush; _fout
-       rts     pc
-
-.bss
-_fout: .=.+518.
-
diff --git a/lib/read.s b/lib/read.s
deleted file mode 100644 (file)
index d19129f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- read
-
-/ nread = read(file, buffer, count);
-/
-/ nread ==0 means eof; nread == -1 means error
-
-       .globl  _read
-
-.data
-_read:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     4(sp),0f
-       mov     6(sp),0f+2
-       sys     read; 0:..; ..
-       bec     1f
-       mov     $-1,r0
-1:
-       rts     pc
-
diff --git a/lib/seek.s b/lib/seek.s
deleted file mode 100644 (file)
index 17a126f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- seek
-
-/ error = seek(file, offset, ptr);
-
-       .globl  _seek
-
-.data
-_seek:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     4(sp),0f
-       mov     6(sp),0f+2
-       sys     seek; 0:..; ..
-       bec     1f
-       mov     $1,r0
-       rts     r0
-1:
-       clr     r0
-       rts     pc
-
-
diff --git a/lib/setuid.s b/lib/setuid.s
deleted file mode 100644 (file)
index c781cfa..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/ C library -- setuid
-
-/ error = setuid(uid);
-
-       .globl  _setuid
-
-.data
-_setuid:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       sys     setuid
-       bec     1f
-       mov     $1,r0
-       rts     pc
-1:
-       clr     r0
-       rts     pc
-
diff --git a/lib/stat.s b/lib/stat.s
deleted file mode 100644 (file)
index 28e8d5c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/ C library -- stat
-
-/ error = stat(string, statbuf);
-
-/ int statbuf[17] or
-/ char statbuf[34]
-/ as appropriate
-
-       .globl  _stat
-
-.data
-_stat:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       mov     4(sp),0f+2
-       sys     stat; 0:..; ..
-       bec     1f
-       mov     $1,r0
-       rts     pc
-1:
-       clr     r0
-       rts     pc
-
diff --git a/lib/stty.s b/lib/stty.s
deleted file mode 100644 (file)
index a3ba332..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- stty
-
-/ error = stty(filep, ttyvec);
-
-/ filep is descriptor of open tty
-/ ttyvec[0, 1, 2] correspond to args of stty
-
-.globl _stty
-
-.data
-_stty:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     4(sp),0f
-       sys     stty; 0:..
-       bes     1f
-       clr     r0
-       rts     pc
-1:
-       mov     $1,r0
-       rts     pc
-
diff --git a/lib/switch.s b/lib/switch.s
deleted file mode 100644 (file)
index 8dbdd81..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/ C library -- switch
-
-.globl bswitch
-
-bswitch:
-       mov     *(sp)+,r1
-1:
-       cmp     (r1)+,r0
-       beq     1f
-       tst     (r1)+
-       bne     1b
-2:
-       mov     -4(r1),pc
-1:
-       mov     (r1)+,r0
-       beq     2b
-       mov     r0,pc
-
diff --git a/lib/time.s b/lib/time.s
deleted file mode 100644 (file)
index ce77465..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- time
-
-/ tvec = time(tvec);
-/
-/ tvec[0], tvec[1] contain the time
-
-       .globl  _time
-
-.data
-_time:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       sys     time
-       mov     ac,(r0)
-       mov     mq,2(r0)
-       rts     pc
-
diff --git a/lib/unlink.s b/lib/unlink.s
deleted file mode 100644 (file)
index 3e0be93..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/ C library -- unlink
-
-/ error = unlink(string);
-/
-
-       .globl  _unlink
-
-.data
-_unlink:
-       1f
-.text
-1:
-       mov     2(sp),0f
-       clr     r0
-       sys     unlink; 0:..
-       adc     r0
-       rts     pc
-
diff --git a/lib/wait.s b/lib/wait.s
deleted file mode 100644 (file)
index 66ecc31..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/ C library -- wait
-
-/ pid = wait();
-/   or,
-/ pid = wait(&status);
-/
-/ pid == -1 if error
-/ status idicates fate of process, if given
-
-       .globl  _wait
-
-.data
-_wait:
-       1f
-.text
-1:
-       clr     mq
-       sys     wait
-       bec     1f
-       mov     $-1,r0
-       rts     pc
-1:
-       cmp     *(sp),tstins    / arg count
-       bne     1f
-       mov     mq,*2(sp)       / status return
-1:
-       rts     pc
-
-tstins:        tst     (sp)+           / stack pop for 1 arg
-
diff --git a/lib/write.s b/lib/write.s
deleted file mode 100644 (file)
index 24f8b38..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- write
-
-/ nwritten = write(file, buffer, count);
-/
-/ nwritten == -1 means error
-
-       .globl  _write
-
-.data
-_write:
-       1f
-.text
-1:
-       mov     2(sp),r0
-       mov     4(sp),0f
-       mov     6(sp),0f+2
-       sys     write; 0:..; ..
-       bec     1f
-       mov     $-1,r0
-1:
-       rts     pc
-
diff --git a/man/man0/aa b/man/man0/aa
new file mode 100644 (file)
index 0000000..05ebc63
--- /dev/null
@@ -0,0 +1,4 @@
+.na
+.hc \ 6
+.in 16
+.fo ''- % -''
diff --git a/man/man0/basinf b/man/man0/basinf
new file mode 100644 (file)
index 0000000..461f45c
--- /dev/null
@@ -0,0 +1,389 @@
+.hc \ 6
+.na
+.fi
+.fo ''- % -''
+.bp
+.bl 2
+.ce
+HOW TO GET STARTED
+
+This section provides the basic information
+you need to get started on UNIX:
+how to log in and log out,
+how to communicate through your terminal,
+and how to run a program.
+
+.ul
+Logging in
+
+You must call  UNIX from an appropriate terminal.
+UNIX supports ASCII terminals typified by the TTY 37,
+the GE Terminet 300, the Memorex 1240, and various
+graphical terminals on the one hand, and IBM 2741-type
+terminals on the other.
+
+To use UNIX,
+you must have
+a valid UNIX user name,
+which may be obtained, together with the telephone number, from the system administrators.
+
+The same telephone number
+serves terminals operating at all the standard speeds.
+After a data connection is established,
+the login procedure depends on what kind of terminal
+you are using.
+
+.in 5
+.ul
+TTY 37 terminal
+
+UNIX will type out "login: "; you respond with
+your user name.
+From the TTY 37 terminal, and any other which has the "new-line"
+function (combined carriage return and linefeed), terminate each line you type with the
+"new line" key (not\b\b\b___ the "return" key).
+
+.ul
+300-baud terminals
+
+Such terminals include the GE Terminet 300, most display terminals,
+Execuport, TI, and certain
+Anderson-Jacobson terminals.
+These terminals generally have a speed
+switch which should be set at "300" (or "30" for
+30 characters per second)
+and a half/full duplex switch which should be set at
+full-duplex.
+(Note that this switch will often have to be changed
+since MH-TSS requires half-duplex).
+When a connection with UNIX is established, a few garbage
+characters are typed (the login message at the wrong speed).
+Depress the "break" key;
+this is a speed-independent signal to UNIX that a 300-baud
+terminal is in use.
+UNIX will type "login: " at the correct speed; you type your
+user name, followed by the "return" key.
+Henceforth, the "return", "new line", or "linefeed" keys
+will give exactly the same results.
+Each line must be terminated with one of these keys; no one
+is listening to you until the return is received.
+
+.ul
+Selectric terminals
+
+From an IBM 2741 or the Anderson-Jacobson Selectric terminal, no message will appear.
+After the data connection is established,
+press the "return" key.
+UNIX should type "login: " as described above.
+If the greeting does not appear after a few seconds,
+unlock the keyboard by switching the terminal
+to local and back to remote,
+and type "return".
+If necessary,
+hang up and try again; something has gone wrong.
+
+.in 0
+For all these terminals, it is important
+that you type your name in lower case if possible; if you type
+upper case letters, UNIX
+will assume that your terminal cannot generate lower-case
+letters and will translate all subsequent upper-case
+letters to lower case.
+
+The evidence that you have successfully
+logged in is that a UNIX program, the Shell,
+will type a "%" to you.
+(The Shell is described below under
+"How to run a program".
+
+For more information, consult
+getty(VII), which discusses the login sequence in more
+detail, and dc(IV), which discusses typewriter I/O.
+
+.ul
+Logging out
+
+There are three ways to log out:
+
+.in 5
+You can simply hang up the phone.
+Hanging up is safe if you are at command level,
+that is, if the Shell has just typed its prompt
+signal "%".
+It is also safe if you are in interactive system
+programs, for example the editor.
+It is unsafe if you are executing
+a non-interactive program, or one of your own programs,
+which either does not read the typewriter or ignores
+the end-of-file indications which will result
+from hanging up.
+The reason is that UNIX, unlike most systems, does
+not terminate a program simply because
+it has been hung-up upon.
+
+You can log out by typing an end-of-file indication
+(EOT character, control "d") to the Shell.
+The Shell will terminate and the "login: " message
+will appear again.
+
+You can also log in directly as another user
+by giving a login command
+(login (I)).
+
+.in 0
+.ul
+How to communicate through your terminal
+
+When you type to UNIX, a gnome deep in the system
+is gathering your characters and saving them in a secret
+place.
+The
+characters will not be given to a program
+until you type a return, as described above
+in
+.ul
+Logging in.
+
+UNIX typewriter I/O is full-duplex (except for Selectric
+terminals).
+It has full read-ahead, which means that you can
+type at any time,
+even while a program is
+typing at you.
+Of course, if you type during output, the output will
+have the input characters interspersed.
+However, what\ 6ever you type will be saved
+up and interpreted in correct sequence.
+
+There is a limit to the amount of read-ahead,
+but it is generous and not likely to be exceeded unless
+the system is in trouble.
+When the read-ahead limit is exceeded, the system
+stops echoing input characters,
+and starts echoing "#" no matter what you typed.
+The last character which was echoed correctly will be
+received correctly by the program to which you were talking;
+subsequent characters have been thrown away.
+
+On a typewriter input line, the character "@"
+kills all the characters typed before it, so typing mistakes
+can be repaired on a single line.
+Also, the character "#" erases the last character typed.
+Successive uses of "#" erase characters back to, but
+not beyond, the beginning of the line.
+"@" and "#" can be transmitted to a program
+by preceding them with "\\".
+(So, to erase "\\", you need two "#"s).
+
+The ASCII "delete" (a.k.a. "rubout") character is not passed to programs
+but instead generates
+an
+.ul
+interrupt signal.
+This signal
+generally causes whatever program
+you are running to terminate.
+It is typically used to stop a long printout that
+you don't want.
+However, programs can arrange either to ignore
+this signal altogether,
+or to be notified when it happens (instead
+of being terminated).
+The editor, for example, catches interrupts and
+stops what it is doing,
+instead of terminating, so that an interrupt can
+be used to halt an editor printout without
+losing the file being edited.
+
+The quit\b\b\b\b____ signal is generated
+by typing the ASCII FS character.
+It not only causes a running program to terminate
+but also generates a file with the core image
+of the terminated process.
+Quit is useful
+for debugging.
+
+Besides adapting to the speed of the terminal,
+UNIX tries to be intelligent about whether
+you have a terminal with the "new line" function
+or whether it must be simulated with carriage-return
+and line-feed.
+In the latter case, all input carriage returns
+are turned to new-line characters (the standard
+line delimiter)
+and both a carriage return and a line feed
+are echoed to the terminal.
+If you get into the wrong mode, the stty command
+(I) will rescue you.
+
+Tab characters are used freely in UNIX source programs.
+If your terminal does not have the tab function,
+you can arrange to have them turned into spaces
+during output, and echoed as spaces
+during input.
+The system assumes
+that tabs are set every eight columns.
+Again, the stty command (I)
+will set or reset this mode.
+Also, there is a file which, if printed on TTY 37
+or TermiNet 300 terminals, will set the tab stops
+correctly (tabs(VII)).
+
+Section dc(IV) discusses typewriter I/O more fully.
+Section kl(IV) discusses the console typewriter.
+
+.ul
+How to run a program; The Shell
+
+When you have successfully logged into UNIX, a program
+called the Shell is listening to your terminal.
+The Shell reads typed-in lines, splits them up
+into a command name and arguments, and executes the command.
+A command is simply an executable program.
+The Shell looks first in your current directory
+(see next section)
+for a program with the given name,
+and if none is there, then in a system directory.
+There is nothing special about system-provided
+commands except that they are kept in a directory
+where the Shell can find them.
+
+The command name is always the first word on an input line;
+it and its arguments are separated from one another by
+spaces.
+
+When a program terminates, the Shell will ordinarily regain control and type 
+a "%" at you to indicate that it is ready for another command.
+
+The Shell has many other capabilities, which are described in detail in section
+sh(I).
+
+.ul
+The current directory
+
+UNIX has a file system arranged in a hierarchy of directories.
+When the system administrator gave you a user name,
+he also created a directory for you (ordinarily
+with the same name as your user name).
+When you log in, any file
+name you type is by default
+in this directory.
+Since you are the owner of this directory, you have
+full permissions to read, write, alter, or destroy
+its contents.
+Permissions to have your will with other directories
+and files will have been granted or denied to you
+by their owners.
+As a matter of observed fact, few UNIX users
+protect their files from destruction,
+let alone perusal, by other users.
+
+To change the
+current directory (but not the set of permissions you
+were endowed with at login) use chdir(I).
+
+.ul
+Path names
+
+To reference files not in the current directory, you must
+use a path name.
+
+Full path names begin with "/", the name of the root directory of the
+whole file system.
+After the slash comes the name of each directory containing the next
+sub-directory (followed by a "/") until finally the
+file name is reached.
+E.g.: "/usr/lem/filex" refers to file "filex" in directory "lem"; "lem"
+is itself a sub-directory of "usr"; "usr" springs directly from the root
+directory.
+
+If your current directory has subdirectories,
+the path names of files therein begin with
+the name of the subdirectory (no prefixed "/").
+
+Without important exception,
+a path name may be used anywhere a file name is
+required.
+
+Important commands which modify the contents of files
+are cp(I), mv(I), and rm(I),
+which respectively copy, move (i.e. rename) and remove files.
+To find out the status of files or directories, use ls(I) and stat(I).
+See mkdir(I) for making directories; rmdir(I) for destroying them.
+
+For a fuller discussion of the file system, see MM-71-1273-4.
+It may also be useful to glance through
+section II of this manual, which discusses
+system calls, even if you don't intend
+to deal with the system at the assembly-language level.
+
+.ul
+Writing a program
+
+To enter the text of a source program into a UNIX file, use ed(I).
+The three principal languages in UNIX are
+assembly language (see as(I)), Fortran (see fc(I)),
+and C (see cc(I)).
+After the program text has been entered through 
+the editor
+and written on a file, you can give the file
+to the appropriate language processor as an argument.
+The output of the language processor
+will be left on a file in the current directory named "a.out".
+(If the output is precious, use mv to move it to a less
+exposed name soon.)
+If you wrote in assembly language, you will probably
+need to load the program with library subroutines; see
+ld(I).  The other two language processors call
+the loader automatically.
+
+When you have finally gone through this entire process
+without provoking any diagnostics, the resulting program
+can be run by giving its name to the Shell
+in response to the "%" prompt.
+
+The next command you will need is db(I).
+As a debugger, db is better than average for
+assembly-language programs,
+marginally useful for C programs
+(when completed, cdb(I) will be a boon),
+and virtually useless for Fortran.
+
+Your programs can receive arguments from the command line
+just as system programs do.  For assembly language programs,
+see exec(II).
+
+.ul
+Text processing
+
+Almost all text is entered through the editor.
+The commands most often used to write text on a terminal are:
+cat(I), pr(I), roff(I), or nroff(I).
+
+The cat command simply dumps ASCII text
+on the terminal, with no processing at all.
+The pr command paginates the text and supplies headings.
+The nroff command is an elaborate text formatting program,
+and requires careful forethought
+in entering both the text and the formatting commands
+into the input file.
+The roff command is a somewhat less elaborate formatting
+program, and requires somewhat less forethought.
+
+.ul
+Surprises
+
+Certain commands provide inter-user communication.
+Even if you do not plan to use them, it would be
+well to learn something about them, because someone else may
+aim them at you.
+
+To communicate with another user currently logged in,
+write(I) is used.  To leave a message the presence of which will be
+announced to another user when he next logs in, mail(I)
+is used. 
+The write-ups in the manual also suggest how to respond to
+the two commands if you are a target.
+
+When you log in, a message-of-the-day may greet you
+before the first "%".
diff --git a/man/man0/headrc b/man/man0/headrc
new file mode 100644 (file)
index 0000000..b994fbc
--- /dev/null
@@ -0,0 +1,6 @@
+2s/.*/&&/
+s/'[^']*'//
+s/'.he //
+s/''/'/p
+w
+q
diff --git a/man/man0/index b/man/man0/index
new file mode 100644 (file)
index 0000000..3952ebd
--- /dev/null
@@ -0,0 +1,746 @@
+         20boot(VIII): reboot  11/20 system
+                      dp(IV):  201 Dataphone
+                               20boot(VIII): reboot 11/20 system
+      greek(VII): extended TTY  37 typebox map
+                      dn(IV):  801 ACU
+                           tm  9-track magtape
+                               :(I): place label
+                               a.out(V): assembler and loader output
+             chmod(I): change  access mode of files
+          crypt(III): encrypt  according to a keyword
+                     wtmp(V):  accounting files
+  acct(VIII): get connect-time  accounting
+                               acct(VIII): get connect-time accounting
+                  dn(IV): 801  ACU
+                  getty(VII):  adapt to typewriter
+             chk(VIII): check  all file systems
+         salloc(III): storage  allocator
+           dup(II): duplicate  an open file
+                yacc(VI): yet  another compiler-compiler
+        mail(I): send mail to  another user
+           write(I): write to  another user
+                       ar(I):  archive (combine) files
+                  archive(V):  archive file
+                               archive(V): archive file
+                   atan(III):  arctangent
+                   glob(VII):  argument expander
+       echo(I): print command  arguments
+                               ar(I): archive (combine) files
+                sort(I): sort  ASCII file
+           atof(III): convert  ASCII to floating
+           atoi(III): convert  ASCII to integer
+                               ascii(VII): map of ASCII
+           ascii(VII): map of  ASCII
+   ctime(III): convert time to  ASCII
+          convert floating to  ASCII...ftoa(III):
+ itoa(III): convert integer to  ASCII
+                               as(I): assembler
+                    a.out(V):  assembler and loader output
+                       as(I):  assembler
+                    sync(II):  assure synchronization
+                               atan(III): arctangent
+                               atof(III): convert ASCII to floating
+                               atoi(III): convert ASCII to integer
+              bc(VI): compile  B program
+          log(III): logarithm  base e
+                               bas(I): BASIC dialect
+                      bas(I):  BASIC dialect
+                               bc(VI): compile B program
+          dli(VIII): load DEC  binary paper tapes
+    remove symbols, relocation  bits...strip(I):
+                               bj(VI): blackjack
+                      bj(VI):  blackjack
+                 bproc(VIII):  boot procedure
+                               boot(II): reboot the system
+                               bproc(VIII): boot procedure
+                    split(I):  break a file into pieces
+                               break(II): set program break
+       break(II): set program  break
+      istat(VIII): file status  by i-number
+                      cdb(I):  C debugger
+               cc(I): compile  C program
+                  dc(I): desk  calculator
+                    cemt(II):  catch EMT traps
+                     fpe(II):  catch floating exception errors
+                  ilgins(II):  catch illegal instruction trap
+                    intr(II):  catch or inhibit interrupts
+                               cat(I): concatenate (or print) files
+                               cc(I): compile C program
+                               cdb(I): C debugger
+                               cemt(II): catch EMT traps
+                    chmod(I):  change access mode of files
+                   chmod(II):  change mode of file
+                    chown(I):  change owner of files
+                   chown(II):  change owner of file
+                    chdir(I):  change working directory
+                   chdir(II):  change working directory
+  pipe(II): open inter process  channel
+         ddsput(III): display  character on Picturephone
+             putc(III): write  character or word
+               getc(III): get  character
+                               chdir(I): change working directory
+                               chdir(II): change working directory
+                   chk(VIII):  check all file systems
+                 check(VIII):  check consistency of file system
+                    system...  check(VIII): check consistency of file
+                               chk(VIII): check all file systems
+                               chmod(I): change access mode of files
+                               chmod(II): change mode of file
+                               chown(I): change owner of files
+                               chown(II): change owner of file
+                  clri(VIII):  clear file's i-node
+                   close(II):  close open file
+                               close(II): close open file
+                               clri(VIII): clear file's i-node
+                               cmp(I): compare file contents
+               ar(I): archive  (combine) files
+               echo(I): print  command arguments
+                       sh(I):  command interpreter
+                 exit(I): end  command sequence
+                     goto(I):  command transfer
+           if(I): conditional  command
+                  gerts(III):  communicate with GCOS
+                      tss(I):  communicate with MH-TSS (GCOS)
+                      cmp(I):  compare file contents
+          compar(III): string  compare for sort
+                    proof(I):  compare text files
+                               compar(III): string compare for sort
+                      bc(VI):  compile B program
+                       cc(I):  compile C program
+                       fc(I):  compile Fortran program
+                      sno(I):  compile Snobol program
+                      tmg(I):  compile tmgl program
+        yacc(VI): yet another  compiler-compiler
+                  hypot(III):  compute hypotenuse
+                      cat(I):  concatenate (or print) files
+                       if(I):  conditional command
+              acct(VIII): get  connect-time accounting
+           check(VIII): check  consistency of file system
+            csw(II): read the  console switches
+                      kl(IV):  console typewriter
+                  ls(I): list  contents of directory
+         cmp(I): compare file  contents
+      ecvt(III): edited output  conversion
+                   atof(III):  convert ASCII to floating
+                   atoi(III):  convert ASCII to integer
+                   ftoa(III):  convert floating to ASCII
+                   ftoo(III):  convert floating to octal
+                   itoa(III):  convert integer to ASCII
+                  ctime(III):  convert time to ASCII
+                       cp(I):  copy file
+                     core(V):  core image file
+                     mem(IV):  core memory
+                               core(V): core image file
+              sin(III): sine,  cosine
+     wc(I): get (English) word  count
+                               cp(I): copy file
+                  makdir(II):  create directory
+                    mkdir(I):  create directory
+                   creat(II):  create file
+                    fork(II):  create new process
+                               creat(II): create file
+                               cref(I): cross reference table
+                     cref(I):  cross reference table
+                               crypt(I): encrypt, decrypt a file
+                               crypt(III): encrypt according to a keyword
+                               csw(II): read the console switches
+                               ctime(III): convert time to ASCII
+     dpd(VII): spawn dataphone  daemon
+           salv(VIII): repair  damaged file system
+              dpd(VII): spawn  dataphone daemon
+                  dp(IV): 201  Dataphone
+                 date(I): get  date and time of day
+               mdate(II): set  date modified of file
+                               date(I): get date and time of day
+ date(I): get date and time of  day
+                               db(I): symbolic debugger
+                               dcheck(VIII): verify directory hierarchy
+                               dc(I): desk calculator
+                               dc(IV): remote typewriter
+              Picturephone...  ddsput(III): display character on
+                    cdb(I): C  debugger
+              db(I): symbolic  debugger
+              dli(VIII): load  DEC binary paper tapes
+           crypt(I): encrypt,  decrypt a file
+                      tap(V):  DECtape and magtape format
+               rew(I): rewind  DECtape
+       save, restore files on  DECtape...tap(I):
+                      tc(IV):  DECtape
+                   sleep(II):  delay execution
+                      dsw(I):  delete files interactively
+             rmdir(I): remove  (delete) directory
+                rm(I): remove  (delete) file
+           unlink(II): remove  (delete) file
+           mesg(I): permit or  deny messages
+        switch(III): transfer  depending on value
+                       dc(I):  desk calculator
+                    kill(II):  destroy process
+                               df(I): find free disk space
+                bas(I): BASIC  dialect
+                directory(V):  directory format
+         dcheck(VIII): verify  directory hierarchy
+                               directory(V): directory format
+      chdir(I): change working  directory
+     chdir(II): change working  directory
+       ls(I): list contents of  directory
+           makdir(II): create  directory
+             mkdir(I): create  directory
+     rmdir(I): remove (delete)  directory
+             df(I): find free  disk space
+                  du(I): find  disk usage
+                   rf(IV): RF  disk
+                   rk(IV): RK  disk
+                  umount(II):  dismount file system
+                 ddsput(III):  display character on Picturephone
+         vt(IV): storage-tube  display
+                               dli(VIII): load DEC binary paper tapes
+                               dn(IV): 801 ACU
+                               dpd(VII): spawn dataphone daemon
+                               dp(IV): 201 Dataphone
+                               dsw(I): delete files interactively
+                               du(I): find disk usage
+                 od(I): octal  dump of file
+                               dup(II): duplicate an open file
+                     dup(II):  duplicate an open file
+                uniq(I): find  duplicate lines in a file
+                               echo(I): print command arguments
+                               ecvt(III): edited output conversion
+                               ed(I): text editor
+                   ecvt(III):  edited output conversion
+                  ld(I): link  editor (loader)
+                  ed(I): text  editor
+          fed(I): form letter  editor
+              cemt(II): catch  EMT traps
+                  crypt(III):  encrypt according to a keyword
+                    crypt(I):  encrypt, decrypt a file
+                     exit(I):  end command sequence
+                   wc(I): get  (English) word count
+      catch floating exception  errors...fpe(II):
+     typo(I): find typographic  errors
+       fpe(II): catch floating  exception errors
+                               exec(II): execute program file
+                 size(I): get  executable program size
+                    exec(II):  execute program file
+               times(II): get  execution times
+          exit(II): terminate  execution
+             sleep(II): delay  execution
+                               exit(I): end command sequence
+                               exit(II): terminate execution
+          glob(VII): argument  expander
+                               exp(III): exponential function
+                    exp(III):  exponential function
+                  greek(VII):  extended TTY 37 typebox map
+      log(III): logarithm base  e
+                   factor(I):  factor a number
+                               factor(I): factor a number
+                               fc(I): compile Fortran program
+                               fed(I): form letter editor
+              cmp(I): compare  file contents
+            split(I): break a  file into pieces
+                opr(I): print  file off-line
+               type(I): print  file page-by-page
+          ov(I): page overlay  file print
+                 istat(VIII):  file status by i-number
+                 stat(I): get  file status
+                stat(II): get  file status
+              file system(V):  file system format
+         chk(VIII): check all  file systems
+                               file system(V): file system format
+         check consistency of  file system...check(VIII):
+             mount(II): mount  file system
+  mount(VIII): mount removable  file system
+    salv(VIII): repair damaged  file system
+         umount(II): dismount  file system
+                 pr(I): print  file with headings
+            clri(VIII): clear  file's i-node
+               dsw(I): delete  files interactively
+        tap(I): save, restore  files on DECtape
+         mt(I): save, restore  files on magtape
+      ar(I): archive (combine)  files
+       concatenate (or print)  files...cat(I):
+        change access mode of  files...chmod(I):
+     chown(I): change owner of  files
+       proof(I): compare text  files
+     reloc(I): relocate object  files
+          wtmp(V): accounting  files
+          archive(V): archive  file
+     chmod(II): change mode of  file
+    chown(II): change owner of  file
+        close(II): close open  file
+          core(V): core image  file
+                  cp(I): copy  file
+            creat(II): create  file
+  crypt(I): encrypt, decrypt a  file
+    dup(II): duplicate an open  file
+     exec(II): execute program  file
+     fstat(II): status of open  file
+            link(II): link to  file
+               ln(I): link to  file
+         set date modified of  file...mdate(II):
+        mv(I): move or rename  file
+         od(I): octal dump of  file
+               open(II): open  file
+          passwd(V): password  file
+               read(II): read  file
+       rm(I): remove (delete)  file
+          sort(I): sort ASCII  file
+                  sum(I): sum  file
+     find duplicate lines in a  file...uniq(I):
+   unlink(II): remove (delete)  file
+             write(II): write  file
+                       du(I):  find disk usage
+                     uniq(I):  find duplicate lines in a file
+                       df(I):  find free disk space
+                   hyphen(I):  find hyphenated words
+                      tty(I):  find name of terminal
+                   ttyn(III):  find teletype name
+                     typo(I):  find typographic errors
+                       un(I):  find undefined symbols
+               fpe(II): catch  floating exception errors
+           ftoa(III): convert  floating to ASCII
+           ftoo(III): convert  floating to octal
+   atof(III): convert ASCII to  floating
+                               fork(II): create new process
+                      fed(I):  form letter editor
+           forml(I): generate  form letters
+            form(I): generate  form letter
+                    nroff(I):  format text for printing
+                     roff(I):  format text for printing
+       directory(V): directory  format
+   file system(V): file system  format
+   tap(V): DECtape and magtape  format
+                               form(I): generate form letter
+                               forml(I): generate form letters
+               fc(I): compile  Fortran program
+                               fpe(II): catch floating exception errors
+                  df(I): find  free disk space
+                               fstat(II): status of open file
+                               ftoa(III): convert floating to ASCII
+                               ftoo(III): convert floating to octal
+        exp(III): exponential  function
+       communicate with MH-TSS  (GCOS)...tss(I):
+  gerts(III): communicate with  GCOS
+                    forml(I):  generate form letters
+                     form(I):  generate form letter
+                       vs(I):  generate voice synthesizer phonemes
+         pseudo random number  generator...rand(III):
+                               gerts(III): communicate with GCOS
+                   getc(III):  get character
+                  acct(VIII):  get connect-time accounting
+                     date(I):  get date and time of day
+                       wc(I):  get (English) word count
+                     size(I):  get executable program size
+                   times(II):  get execution times
+                     stat(I):  get file status
+                    stat(II):  get file status
+                    ps(VIII):  get process status
+                     time(I):  get time information
+                    time(II):  get time of year
+                    gtty(II):  get typewriter mode
+                  getuid(II):  get user ID
+                               getc(III): get character
+                               getty(VII): adapt to typewriter
+                               getuid(II): get user ID
+                               glob(VII): argument expander
+                               goto(I): command transfer
+                               greek(VII): extended TTY 37 typebox map
+                               gtty(II): get typewriter mode
+       pr(I): print file with  headings
+             verify directory  hierarchy...dcheck(VIII):
+              hyphen(I): find  hyphenated words
+                               hyphen(I): find hyphenated words
+          hypot(III): compute  hypotenuse
+                               hypot(III): compute hypotenuse
+      clri(VIII): clear file's  i-node
+   istat(VIII): file status by  i-number
+         getuid(II): get user  ID
+         setuid(II): set user  ID
+                               if(I): conditional command
+                               ilgins(II): catch illegal instruction trap
+            ilgins(II): catch  illegal instruction trap
+                core(V): core  image file
+ uniq(I): find duplicate lines  in a file
+            ptx(VI): permuted  index
+            time(I): get time  information
+       utmp(V): logged-in user  information
+           intr(II): catch or  inhibit interrupts
+                    quit(II):  inhibit quits
+                   init(VII):  initializer process
+                               init(VII): initializer process
+     ilgins(II): catch illegal  instruction trap
+           itoa(III): convert  integer to ASCII
+   atoi(III): convert ASCII to  integer
+               pipe(II): open  inter process channel
+         dsw(I): delete files  interactively
+               sh(I): command  interpreter
+    intr(II): catch or inhibit  interrupts
+       split(I): break a file  into pieces
+                               intr(II): catch or inhibit interrupts
+                               istat(VIII): file status by i-number
+                               itoa(III): convert integer to ASCII
+       encrypt according to a  keyword...crypt(III):
+                               kill(II): destroy process
+                               kill(VIII): terminate a process
+                               kl(IV): console typewriter
+                  :(I): place  label
+                               ld(I): link editor (loader)
+                 fed(I): form  letter editor
+       forml(I): generate form  letters
+       form(I): generate form  letter
+       uniq(I): find duplicate  lines in a file
+                       ld(I):  link editor (loader)
+                    link(II):  link to file
+                       ln(I):  link to file
+                               link(II): link to file
+                       ls(I):  list contents of directory
+        nlist(III): read name  list
+                               ln(I): link to file
+                   dli(VIII):  load DEC binary paper tapes
+       a.out(V): assembler and  loader output
+           ld(I): link editor  (loader)
+                    login(I):  log on to system
+                    log(III):  logarithm base e
+                     utmp(V):  logged-in user information
+                               log(III): logarithm base e
+               passwd(I): set  login password
+                               login(I): log on to system
+                nice(II): set  low-priority status
+                               ls(I): list contents of directory
+                               m6(I): macroprocessor
+                       m6(I):  macroprocessor
+          tap(V): DECtape and  magtape format
+ mt(I): save, restore files on  magtape
+                   tm 9-track  magtape
+                mail(I): send  mail to another user
+                               mail(I): send mail to another user
+                               makdir(II): create directory
+                               man(I): run off manual section
+              man(I): run off  manual section
+                  ascii(VII):  map of ASCII
+       extended TTY 37 typebox  map...greek(VII):
+                               mdate(II): set date modified of file
+                               mem(IV): core memory
+                mem(IV): core  memory
+                               mesg(I): permit or deny messages
+                               mesg(III): print string on typewriter
+       mesg(I): permit or deny  messages
+      tss(I): communicate with  MH-TSS (GCOS)
+                    msh(VII):  mini Shell
+                               mkdir(I): create directory
+       chmod(I): change access  mode of files
+            chmod(II): change  mode of file
+                stty(II): set  mode of typewriter
+       stty(I): set typewriter  modes
+      gtty(II): get typewriter  mode
+          mdate(II): set date  modified of file
+                   mount(II):  mount file system
+                 mount(VIII):  mount removable file system
+                               mount(II): mount file system
+                               mount(VIII): mount removable file system
+                       mv(I):  move or rename file
+                    seek(II):  move read or write pointer
+                               msh(VII): mini Shell
+                               mt(I): save, restore files on magtape
+                               mv(I): move or rename file
+             nlist(III): read  name list
+                 tty(I): find  name of terminal
+                 nm(I): print  namelist
+      ttyn(III): find teletype  name
+             fork(II): create  new process
+                               nice(II): set low-priority status
+                               nlist(III): read name list
+                               nm(I): print namelist
+                               nroff(I): format text for printing
+      rand(III): pseudo random  number generator
+      pow(III): take powers of  numbers
+          factor(I): factor a  number
+           reloc(I): relocate  object files
+                       od(I):  octal dump of file
+          convert floating to  octal...ftoo(III):
+                               od(I): octal dump of file
+                  man(I): run  off manual section
+           opr(I): print file  off-line
+             close(II): close  open file
+        dup(II): duplicate an  open file
+         fstat(II): status of  open file
+                    open(II):  open file
+                    pipe(II):  open inter process channel
+                               open(II): open file
+                               opr(I): print file off-line
+          cat(I): concatenate  (or print) files
+            ecvt(III): edited  output conversion
+         assembler and loader  output...a.out(V):
+                  ov(I): page  overlay file print
+                               ov(I): page overlay file print
+             chown(I): change  owner of files
+            chown(II): change  owner of file
+                       ov(I):  page overlay file print
+          type(I): print file  page-by-page
+    dli(VIII): load DEC binary  paper tapes
+              pc(IV): punched  paper tape
+                               passwd(I): set login password
+                               passwd(V): password file
+                   passwd(V):  password file
+         passwd(I): set login  password
+                               pc(IV): punched paper tape
+                     mesg(I):  permit or deny messages
+                     ptx(VI):  permuted index
+    generate voice synthesizer  phonemes...vs(I):
+   vsp(VII): voice synthesizer  phonemes
+         display character on  Picturephone...ddsput(III):
+   split(I): break a file into  pieces
+                               pipe(II): open inter process channel
+                        :(I):  place label
+  seek(II): move read or write  pointer
+               pow(III): take  powers of numbers
+                               pow(III): take powers of numbers
+                               pr(I): print file with headings
+                     echo(I):  print command arguments
+                      opr(I):  print file off-line
+                     type(I):  print file page-by-page
+                       pr(I):  print file with headings
+                       nm(I):  print namelist
+                   mesg(III):  print string on typewriter
+                  ptime(III):  print time
+       cat(I): concatenate (or  print) files
+     nroff(I): format text for  printing
+      roff(I): format text for  printing
+      ov(I): page overlay file  print
+            bproc(VIII): boot  procedure
+         pipe(II): open inter  process channel
+                ps(VIII): get  process status
+            rele(II): release  processor
+         fork(II): create new  process
+       init(VII): initializer  process
+            kill(II): destroy  process
+       kill(VIII): terminate a  process
+           wait(II): wait for  process
+               break(II): set  program break
+            exec(II): execute  program file
+       size(I): get executable  program size
+            bc(VI): compile B  program
+             cc(I): compile C  program
+       fc(I): compile Fortran  program
+       sno(I): compile Snobol  program
+         tmg(I): compile tmgl  program
+                               proof(I): compare text files
+                   rand(III):  pseudo random number generator
+                               ps(VIII): get process status
+                               ptime(III): print time
+                               ptx(VI): permuted index
+                      pc(IV):  punched paper tape
+                               putc(III): write character or word
+                               qsort(III): quicker sort
+                  qsort(III):  quicker sort
+                               quit(II): inhibit quits
+            quit(II): inhibit  quits
+                               rand(III): pseudo random number generator
+            rand(III): pseudo  random number generator
+                    read(II):  read file
+                  nlist(III):  read name list
+               seek(II): move  read or write pointer
+                     csw(II):  read the console switches
+                               read(II): read file
+                20boot(VIII):  reboot 11/20 system
+                    boot(II):  reboot the system
+               cref(I): cross  reference table
+                    rele(II):  release processor
+                               rele(II): release processor
+                    reloc(I):  relocate object files
+     strip(I): remove symbols,  relocation bits
+                               reloc(I): relocate object files
+                      dc(IV):  remote typewriter
+           mount(VIII): mount  removable file system
+                    rmdir(I):  remove (delete) directory
+                       rm(I):  remove (delete) file
+                  unlink(II):  remove (delete) file
+                    strip(I):  remove symbols, relocation bits
+               mv(I): move or  rename file
+                  salv(VIII):  repair damaged file system
+                tap(I): save,  restore files on DECtape
+                 mt(I): save,  restore files on magtape
+                               rew(I): rewind DECtape
+                      rew(I):  rewind DECtape
+                      rf(IV):  RF disk
+                               rf(IV): RF disk
+                      rk(IV):  RK disk
+                               rk(IV): RK disk
+                               rmdir(I): remove (delete) directory
+                               rm(I): remove (delete) file
+                               roff(I): format text for printing
+            sqrt(III): square  root
+                      man(I):  run off manual section
+                               salloc(III): storage allocator
+                               salv(VIII): repair damaged file system
+                      tap(I):  save, restore files on DECtape
+                       mt(I):  save, restore files on magtape
+       man(I): run off manual  section
+                               seek(II): move read or write pointer
+                     mail(I):  send mail to another user
+                    speak(I):  send words to voice synthesizer
+         exit(I): end command  sequence
+                   mdate(II):  set date modified of file
+                   passwd(I):  set login password
+                    nice(II):  set low-priority status
+                    stty(II):  set mode of typewriter
+                   break(II):  set program break
+                   stime(II):  set system time
+                   tabs(VII):  set tab stops on typewriter
+                     stty(I):  set typewriter modes
+                  setuid(II):  set user ID
+                               setuid(II): set user ID
+               msh(VII): mini  Shell
+                               sh(I): command interpreter
+                    sin(III):  sine, cosine
+                               sin(III): sine, cosine
+                               size(I): get executable program size
+       get executable program  size...size(I):
+                               sleep(II): delay execution
+              sno(I): compile  Snobol program
+                               sno(I): compile Snobol program
+                     sort(I):  sort ASCII file
+                               sort(I): sort ASCII file
+           string compare for  sort...compar(III):
+          qsort(III): quicker  sort
+        df(I): find free disk  space
+                    dpd(VII):  spawn dataphone daemon
+                               speak(I): send words to voice synthesizer
+                               split(I): break a file into pieces
+                               sqrt(III): square root
+                   sqrt(III):  square root
+                               stat(I): get file status
+                               stat(II): get file status
+            istat(VIII): file  status by i-number
+                   fstat(II):  status of open file
+    nice(II): set low-priority  status
+        ps(VIII): get process  status
+            stat(I): get file  status
+           stat(II): get file  status
+                               stime(II): set system time
+           tabs(VII): set tab  stops on typewriter
+                 salloc(III):  storage allocator
+                      vt(IV):  storage-tube display
+                 compar(III):  string compare for sort
+             mesg(III): print  string on typewriter
+                               strip(I): remove symbols, relocation bits
+                               stty(I): set typewriter modes
+                               stty(II): set mode of typewriter
+                      sum(I):  sum file
+                               sum(I): sum file
+     csw(II): read the console  switches
+                               switch(III): transfer depending on value
+                       db(I):  symbolic debugger
+             strip(I): remove  symbols, relocation bits
+        un(I): find undefined  symbols
+             sync(II): assure  synchronization
+                               sync(II): assure synchronization
+        vs(I): generate voice  synthesizer phonemes
+              vsp(VII): voice  synthesizer phonemes
+ speak(I): send words to voice  synthesizer
+         file system(V): file  system format
+               stime(II): set  system time
+     chk(VIII): check all file  systems
+                         file  system(V): file system format
+    20boot(VIII): reboot 11/20  system
+         boot(II): reboot the  system
+     check consistency of file  system...check(VIII):
+          login(I): log on to  system
+        mount(II): mount file  system
+         mount removable file  system...mount(VIII):
+          repair damaged file  system...salv(VIII):
+     umount(II): dismount file  system
+        who(I): who is on the  system
+               tabs(VII): set  tab stops on typewriter
+      cref(I): cross reference  table
+                               tabs(VII): set tab stops on typewriter
+                    pow(III):  take powers of numbers
+        load DEC binary paper  tapes...dli(VIII):
+        pc(IV): punched paper  tape
+                               tap(I): save, restore files on DECtape
+                               tap(V): DECtape and magtape format
+                               tc(IV): DECtape
+              ttyn(III): find  teletype name
+         tty(I): find name of  terminal
+                  kill(VIII):  terminate a process
+                    exit(II):  terminate execution
+                       ed(I):  text editor
+            proof(I): compare  text files
+             nroff(I): format  text for printing
+              roff(I): format  text for printing
+                 time(I): get  time information
+        date(I): get date and  time of day
+                time(II): get  time of year
+          ctime(III): convert  time to ASCII
+                               time(I): get time information
+                               time(II): get time of year
+                               times(II): get execution times
+      times(II): get execution  times
+            ptime(III): print  time
+        stime(II): set system  time
+                               tm 9-track magtape
+                               tmg(I): compile tmgl program
+              tmg(I): compile  tmgl program
+                 switch(III):  transfer depending on value
+             goto(I): command  transfer
+          cemt(II): catch EMT  traps
+     catch illegal instruction  trap...ilgins(II):
+                               tss(I): communicate with MH-TSS (GCOS)
+         greek(VII): extended  TTY 37 typebox map
+                               tty(I): find name of terminal
+                               ttyn(III): find teletype name
+   greek(VII): extended TTY 37  typebox map
+                               type(I): print file page-by-page
+                 stty(I): set  typewriter modes
+                gtty(II): get  typewriter mode
+               dc(IV): remote  typewriter
+         getty(VII): adapt to  typewriter
+              kl(IV): console  typewriter
+    mesg(III): print string on  typewriter
+        stty(II): set mode of  typewriter
+   tabs(VII): set tab stops on  typewriter
+                typo(I): find  typographic errors
+                               typo(I): find typographic errors
+                               umount(II): dismount file system
+                  un(I): find  undefined symbols
+                               un(I): find undefined symbols
+                               uniq(I): find duplicate lines in a file
+                               unlink(II): remove (delete) file
+             du(I): find disk  usage
+              getuid(II): get  user ID
+              setuid(II): set  user ID
+           utmp(V): logged-in  user information
+ mail(I): send mail to another  user
+    write(I): write to another  user
+                               utmp(V): logged-in user information
+        transfer depending on  value...switch(III):
+                dcheck(VIII):  verify directory hierarchy
+              vs(I): generate  voice synthesizer phonemes
+                    vsp(VII):  voice synthesizer phonemes
+       speak(I): send words to  voice synthesizer
+                               vs(I): generate voice synthesizer phonemes
+                               vsp(VII): voice synthesizer phonemes
+                               vt(IV): storage-tube display
+                    wait(II):  wait for process
+                               wait(II): wait for process
+                               wc(I): get (English) word count
+                      who(I):  who is on the system
+                               who(I): who is on the system
+       gerts(III): communicate  with GCOS
+            pr(I): print file  with headings
+          tss(I): communicate  with MH-TSS (GCOS)
+         wc(I): get (English)  word count
+               speak(I): send  words to voice synthesizer
+    hyphen(I): find hyphenated  words
+ putc(III): write character or  word
+             chdir(I): change  working directory
+            chdir(II): change  working directory
+                   putc(III):  write character or word
+                   write(II):  write file
+       seek(II): move read or  write pointer
+                    write(I):  write to another user
+                               write(I): write to another user
+                               write(II): write file
+                               wtmp(V): accounting files
+                               yacc(VI): yet another compiler-compiler
+        time(II): get time of  year
+                    yacc(VI):  yet another compiler-compiler
diff --git a/man/man0/intro b/man/man0/intro
new file mode 100644 (file)
index 0000000..06ad6a8
--- /dev/null
@@ -0,0 +1,280 @@
+.na
+.bl  15
+.tr |
+.in 0
+.ce
+UNIX PROGRAMMER'S MANUAL
+
+.ce
+Third Edition
+
+
+
+.ce 3
+K. Thompson
+
+D. M. Ritchie
+
+
+
+
+.ce
+February, 1973
+.sp 15
+.ce 7
+Copyright \e8c\e9 1972
+Bell Telephone Laboratories, Inc.
+
+No part of this document may be reproduced,
+or distributed outside the Laboratories, without
+the written permission of Bell Telephone Laboratories.
+.bp
+.fo ''- % -''
+.ro
+.bl 2
+.ce 2
+PREFACE
+to the Third Edition
+
+
+In the months since the last appearance of this manual,
+many changes have occurred
+both in the system itself and in the way it is
+used.
+
+Perhaps most obviously,
+there have been additions, deletions, and modifications
+to the system and its software.
+It is these changes, of course, that
+caused the appearance of this revised manual.
+
+Second, the number of people spending
+an appreciable amount
+of time writing UNIX software has increased.
+Credit is due
+to L.|L.|Cherry, M.|D.|McIlroy, L.|E.|McMahon, R.|Morris,
+J.|F.|Ossanna,
+and E.|N.|Pinson
+for their contributions.
+
+Finally, the number of UNIX installations
+has grown to 16, with more expected.
+None of these has exactly the same complement
+of hardware or software.
+Therefore, at any particular installation,
+it is quite possible that this manual will
+give inappropriate information.
+.a
+
+In particular,
+.ul 3
+any system which uses a PDP-11/20
+processor will not include all the software described
+herein, nor will the software behave the same way.
+The second, or even the first, edition
+of this manual is likely to be more
+appropriate.
+
+Besides additions, deletions, and
+modifications to the writeups in each section,
+this manual differs from its predecessors
+in two ways:
+all the commands used for system maintenance
+and not intended for normal users have been moved
+to a new section VIII;
+and there is a new "How to Get Started"
+chapter that gives some elementary facts
+and many pointers to other sections.
+.bp
+.bl 2
+.ce
+INTRODUCTION TO THIS MANUAL
+
+
+This manual gives descriptions of the publicly available
+features of UNIX.
+It provides neither a general
+overview (see "The UNIX Time-sharing System" for that)
+nor details of the implementation of the system (which
+remain to be disclosed).
+
+Within the area it surveys, this manual attempts
+to be as complete and timely as possible.
+A conscious
+decision was made to describe each program
+in exactly the state it was in at the time
+its manual section
+was prepared.
+In particular, the
+desire to describe something as it should be, not as it is,
+was resisted.
+Inevitably, this means that
+many sections will soon be out of date.
+(The rate of
+change of the system is so great that a dismayingly
+large number of early sections
+had to be modified while the rest were being written.
+The unbounded effort required to stay up-to-date
+is best indicated by the fact that several of the programs
+described were written specifically to aid in preparation
+of this manual!)
+
+This manual is divided into
+eight sections:
+
+   I.    Commands
+   II.   System calls
+   III.  Subroutines
+   IV.   Special files
+   V.    File formats
+   VI.   User-maintained programs
+   VII.  Miscellaneous
+   VIII. Maintenance
+
+Commands are programs intended to be invoked directly by
+the user, in contradistinction to subroutines, which are
+intended to be called by the user's programs.
+Commands generally reside in directory /bin\b\b\b\b____ (for
+bin\b\b\b___ary programs).  This directory is searched automatically
+by the command line interpreter.  Some programs
+classified as commands are located elsewhere; this
+fact is indicated in the appropriate sections.
+
+System calls are entries into the UNIX supervisor.
+In assembly language, they are coded with the use
+of the opcode "sys", a synonym for the
+trap\b\b\b\b____ instruction.
+
+A small assortment
+of subroutines is available;
+they are described in section III.
+The binary form of most of them is kept in
+the system library /usr/lib/liba.a.
+
+The special files section IV discusses the characteristics of
+each system "file" which actually refers to an I/O device.
+Unlike previous editions, the names in this
+section refer to the DEC device names for the
+hardware,
+instead of the neames of
+the special files themselves.
+
+The file formats section V documents the structure of particular
+kinds of files; for example, the form of the output of the loader and
+assembler is given.  Excluded are files used by only one command,
+for example the assembler's intermediate files.
+
+User-maintained programs (section VI) are not considered part
+of the UNIX system, and the principal reason for
+listing them is to indicate their existence without
+necessarily giving a complete description.
+The author should be consulted for information.
+
+The miscellaneous section (VII) gathers odds and ends.
+
+Section VIII discusses commands which are not intended
+for use by the ordinary user,
+in some cases because they disclose information
+in which he is presumably not interested,
+and in others because they perform
+privileged functions.
+
+
+Each section consists of a number of independent
+entries of a page or so each.
+The name of the entry is in the upper corners of its pages,
+its preparation date in the upper middle.
+Entries within each section are
+alphabetized.
+The page numbers of each entry start at 1.
+(The earlier hope for frequent, partial
+updates of the manual is clearly in vain, but
+in any event it is not feasible to
+maintain consecutive page numbering in a document
+like this.)
+
+All entries have a common format.
+.sp
+.in 5
+The name\b\b\b\b____ section repeats the entry name and gives
+a very short description of its purpose.
+
+The synopsis\b\b\b\b\b\b\b\b________ summarizes the use of the
+program being described.
+A few conventions are used, particularly in the
+Commands section:
+
+.in 8
+Underlined words are considered literals, and
+are typed just as they appear.
+
+Square brackets ([]) around an argument
+indicate that the argument is optional.
+When an argument is given as "name", it always
+refers to a file name.
+
+Ellipses "..." are used to show that the previous argument-prototype
+may be repeated.
+
+A final convention is used by the commands themselves.
+An argument beginning with a minus sign "-"
+is often taken to mean some sort of flag argument
+even if it appears in a position where a file name
+could appear.  Therefore, it is unwise to have files
+whose names begin with "-".
+
+.in 5
+The description\b\b\b\b\b\b\b\b\b\b\b___________ section discusses in detail the subject at hand.
+
+The files\b\b\b\b\b_____ section gives the names of files which are
+built into the program.
+
+A see\b\b\b___ also\b\b\b\b____ section gives pointers to related information.
+
+A diagnostics\b\b\b\b\b\b\b\b\b\b\b___________
+section discusses
+the diagnostics that may be produced.
+This section tends to be as terse
+as the diagnostics themselves.
+
+The bugs\b\b\b\b____ section gives
+known bugs and sometimes deficiencies.
+Occasionally also the suggested fix is
+described.
+
+.in 0
+Previous edition of this manual had
+an owner\b\b\b\b\b_____ section, which has been dropped from this
+edition because the "owners" of many routines became
+fairly hard to pin down.
+The major contributors to UNIX,
+(cast in order of appearance)
+together with their login names and most notable contributions,
+are
+
+   ken    K. Thompson          (UNIX, many commands)
+   dmr    D. M. Ritchie                (many commands, as, ld, C)
+   jfo    J. F. Ossanna                (roff, nroff)
+   doug   M. D. McIlroy                (tmg, m6)
+   rhm    R. Morris            (dc, much of library)
+   lem    L. E. McMahon                (cref)
+   llc    L. L. Cherry         (form, fed, salloc)
+   csr    C. S. Roberts                (tss)
+   enp    E. N. Pinson         (proof)
+
+At the beginning of this document is a table of contents,
+organized by section and alphabetically within each section.
+There is also a permuted index derived from the table of contents.
+Within each index entry, the title
+of the writeup to which
+it refers is followed by the appropriate section number in parentheses.
+This fact is important because there is considerable
+name duplication among the sections,
+arising principally from commands which
+exist only to exercise a particular system call.
+
+
+This manual was prepared using the UNIX text
+editor ed\b\b__ and the formatting program roff\b\b\b\b____.
+
+The assistance of R. Morris is gratefully acknowledged.
diff --git a/man/man0/toc b/man/man0/toc
new file mode 100644 (file)
index 0000000..e1556e6
--- /dev/null
@@ -0,0 +1,257 @@
+.bp
+.tr |
+.bl 1
+.nf
+.ta 30
+.tc .
+.ce
+TABLE OF CONTENTS
+
+I.  COMMANDS
+
+.xx
+:       place label
+ar      archive (combine) files
+as      assembler
+bas     BASIC dialect
+cat     concatenate (or print) files
+cc      compile C program
+cdb     C debugger
+chdir   change working directory
+chmod   change access mode of files
+chown   change owner of files
+cmp     compare file contents
+cp      copy file
+cref    cross reference table
+crypt   encrypt, decrypt a file
+date    get date and time of day
+db      symbolic debugger
+dc      desk calculator
+df      find free disk space
+dsw     delete files interactively
+du      find disk usage
+echo    print command arguments
+ed      text editor
+exit    end command sequence
+factor          factor a number
+fc      compile Fortran program
+fed     form letter editor
+form    generate form letter
+forml   generate form letters
+goto    command transfer
+hyphen          find hyphenated words
+if      conditional command
+ld      link editor (loader)
+ln      link to file
+login   log on to system
+ls      list contents of directory
+m6      macroprocessor
+mail    send mail to another user
+man     run off manual section
+mesg    permit or deny messages
+mkdir   create directory
+mt      save, restore files on magtape
+mv      move or rename file
+nm      print namelist
+nroff   format text for printing
+od      octal dump of file
+opr     print file off-line
+ov      page overlay file print
+passwd          set login password
+pr      print file with headings
+proof   compare text files
+reloc   relocate object files
+rew     rewind DECtape
+rm      remove (delete) file
+rmdir   remove (delete) directory
+roff    format text for printing
+sh      command interpreter
+size    get executable program size
+sno     compile Snobol program
+sort    sort ASCII file
+speak   send words to voice synthesizer
+split   break a file into pieces
+stat    get file status
+strip   remove symbols, relocation bits
+stty    set typewriter modes
+sum     sum file
+tap     save, restore files on DECtape
+time    get time information
+tmg     compile tmgl program
+tss     communicate with MH-TSS (GCOS)
+tty     find name of terminal
+type    print file page-by-page
+typo    find typographic errors
+un      find undefined symbols
+uniq    find duplicate lines in a file
+vs      generate voice synthesizer phonemes
+wc      get (English) word count
+who     who is on the system
+write   write to another user
+
+
+II.  SYSTEM CALLS
+
+.xx
+boot    reboot the system
+break   set program break
+cemt    catch EMT traps
+chdir   change working directory
+chmod   change mode of file
+chown   change owner of file
+close   close open file
+creat   create file
+csw     read the console switches
+dup     duplicate an open file
+exec    execute program file
+exit    terminate execution
+fork    create new process
+fpe     catch floating exception errors
+fstat   status of open file
+getuid          get user ID
+gtty    get typewriter mode
+ilgins          catch illegal instruction trap
+intr    catch or inhibit interrupts
+kill    destroy process
+link    link to file
+makdir          create directory
+mdate   set date modified of file
+mount   mount file system
+nice    set low-priority status
+open    open file
+pipe    open inter process channel
+quit    inhibit quits
+read    read file
+rele    release processor
+seek    move read or write pointer
+setuid          set user ID
+sleep   delay execution
+stat    get file status
+stime   set system time
+stty    set mode of typewriter
+sync    assure synchronization
+time    get time of year
+times   get execution times
+umount          dismount file system
+unlink          remove (delete) file
+wait    wait for process
+write   write file
+
+
+III.  SUBROUTINES
+
+.xx
+atan    arctangent
+atof    convert ASCII to floating
+atoi    convert ASCII to integer
+compar          string compare for sort
+crypt   encrypt according to a keyword
+ctime   convert time to ASCII
+ddsput          display character on Picturephone
+ecvt    edited output conversion
+exp     exponential function
+ftoa    convert floating to ASCII
+ftoo    convert floating to octal
+gerts   communicate with GCOS
+getc    get character
+hypot   compute hypotenuse
+itoa    convert integer to ASCII
+log     logarithm base e
+mesg    print string on typewriter
+nlist   read name list
+pow     take powers of numbers
+ptime   print time
+putc    write character or word
+qsort   quicker sort
+rand    pseudo random number generator
+salloc          storage allocator
+sin     sine, cosine
+sqrt    square root
+switch          transfer depending on value
+ttyn    find teletype name
+
+
+IV.  SPECIAL FILES
+
+.xx
+dc      remote typewriter
+dn      801 ACU
+dp      201 Dataphone
+kl      console typewriter
+mem     core memory
+pc      punched paper tape
+rf      RF disk
+rk      RK disk
+tc      DECtape
+tm      9-track magtape
+vt      storage-tube display
+
+
+V.  FILE FORMATS
+
+.xx
+a.out   assembler and loader output
+archive         archive file
+core    core image file
+directory       directory format
+file system     file system format
+passwd          password file
+tap     DECtape and magtape format
+utmp    logged-in user information
+wtmp    accounting files
+
+
+VI.  USER MAINTAINED PROGRAMS
+
+.xx
+bc      compile B program
+bj      blackjack
+ptx     permuted index
+yacc    yet another compiler-compiler
+
+
+VII.  MISCELLANEOUS
+
+.xx
+ascii   map of ASCII
+dpd     spawn dataphone daemon
+getty   adapt to typewriter
+glob    argument expander
+greek   extended TTY 37 typebox map
+init    initializer process
+msh     mini Shell
+tabs    set tab stops on typewriter
+vsp     voice synthesizer phonemes
+
+
+VIII. SYSTEM MAINTAINANCE
+
+.xx
+20boot          reboot 11/20 system
+acct    get connect-time accounting
+bproc   boot procedure
+check   check consistency of file system
+chk     check all file systems
+clri    clear file's i-node
+dcheck          verify directory hierarchy
+dli     load DEC binary paper tapes
+istat   file status by i-number
+kill    terminate a process
+mount   mount removable file system
+ps      get process status
+salv    repair damaged file system
+su      become super-user
+swtmp   truncate accounting files
+tm      get system time information
+umount          dismount removable file system
+.xx
+.bp
+.bl 1
+.ce
+INDEX
+
+
+.nf
+.tc
+.ta 9 17 25 33 41 49 57
+.nx index
diff --git a/man/man0/tocrc b/man/man0/tocrc
new file mode 100644 (file)
index 0000000..1163fe5
--- /dev/null
@@ -0,0 +1,17 @@
+ed toc
+/\.xx/;//s/     /(I): /
+/\.xx/;//s/     /(II): /
+/\.xx/;//s/     /(III): /
+/\.xx/;//s/     /(IV): /
+/\.xx/;//s/     /(V): /
+/\.xx/;//s/     /(VI): /
+/\.xx/;//s/     /(VII): /
+/\.xx/;//s/     /(VIII): /
+g/\.xx/.-4,.d
+g/^\./d
+g/^$/d
+$d
+w xtoc
+q
+ptx xtoc index
+rm xtoc
diff --git a/man/man0/xx b/man/man0/xx
new file mode 100644 (file)
index 0000000..2c4180a
--- /dev/null
@@ -0,0 +1,22 @@
+.pa 1
+.he 'X'Y'X'
+.ti 0
+NAME           X
+.sp
+.ti 0
+SYNOPSIS       X
+.sp
+.ti 0
+DESCRIPTION    X
+.sp
+.ti 0
+FILES          X
+.sp
+.ti 0
+SEE ALSO       X
+.sp
+.ti 0
+DIAGNOSTICS    X
+.sp
+.ti 0
+BUGS           X
diff --git a/man/man1/:.1 b/man/man1/:.1
new file mode 100644 (file)
index 0000000..e4a1e3b
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he ': (I)'3/15/72': (I)'
+.ti 0
+NAME           :  --  place a label
+.sp
+.ti 0
+SYNOPSIS       :\b_ [ label ]
+.sp
+.ti 0
+DESCRIPTION    :\b_
+does nothing.  Its only function is to place
+a label for the goto\b\b\b\b____ command.  :\b_ is a command
+so the Shell doesn't have to be fixed to ignore lines with
+:'s.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       goto(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/ar.1 b/man/man1/ar.1
new file mode 100644 (file)
index 0000000..9e882a2
--- /dev/null
@@ -0,0 +1,83 @@
+.pa 1
+.he 'AR (I)'3/15/72'AR (I)'
+.ti 0
+NAME           ar -- archive
+.sp
+.ti 0
+SYNOPSIS       ar\b\b__ key afile name\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    ar\b\b__
+maintains groups of files
+combined into a single archive file.
+Its main use
+is to create and update library files as used by the loader.
+It can be used, though, for any similar purpose.
+.sp
+key\b\b\b___ is one character from the set drtux\b\b\b\b\b_____,
+optionally concatenated with v\b_.
+afile\b\b\b\b\b_____ is the archive file.
+The names\b\b\b\b\b_____ are constituent files in the archive file.
+The meanings of the key\b\b\b___ characters are:
+.sp
+d\b_ means delete the named files from the archive file.
+.sp
+r\b_ means replace the named files in the archive file.
+If the archive file does not exist, r\b_ will create it.
+If the named files are not in the archive file, they are appended.
+.sp
+t\b_ prints a table of contents of the archive file.
+If no names are given, all files in the archive are tabled.
+If names are given, only those files are tabled.
+.sp
+u\b_ is similar to r\b_ except that only those
+files that have been modified are replaced.
+If no names are given, all files in the archive that
+have been modified will be replaced by the modified version.
+.sp
+x\b_ will extract the named files.
+If no names are given, all files in the archive are
+extracted.
+In neither case does x\b_ alter the archive file.
+.sp
+v\b_ means verbose.
+Under the verbose option,
+ar\b\b__ gives a file-by-file
+description of the making of a
+new archive file from the old archive and the constituent files.
+The following abbreviations
+are used:
+.sp
+   c\b_ copy
+   a\b_ append
+   d\b_ delete
+   r\b_ replace
+   x\b_ extract
+.sp
+.ti 0
+FILES          /tmp/vtm?        temporary
+.sp
+.ti 0
+SEE ALSO       ld(I), archive(V)
+.sp
+.ti 0
+DIAGNOSTICS    "Bad usage",
+"afile -- not in archive format",
+"cannot open temp file",
+"name -- cannot open",
+"name -- phase error",
+"name -- cannot create",
+"no archive file",
+"cannot create archive file",
+"name -- not found".
+.sp
+.ti 0
+BUGS           Option
+vt\b\b__ should be implemented as a table with more information.
+.sp
+There should be a way to specify the placement
+of a new file in an archive.
+Currently, it is placed at the end.
+
+"ar x" changes the modified-date of the current
+directory to a random number.
diff --git a/man/man1/as.1 b/man/man1/as.1
new file mode 100644 (file)
index 0000000..0755075
--- /dev/null
@@ -0,0 +1,89 @@
+.pa 1
+.he 'AS (I)'1/15/73'AS (I)'
+.ti 0
+NAME           as -- assembler
+.sp
+.ti 0
+SYNOPSIS       as\b\b__ [ -\b_ ] name\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    as\b\b__
+assembles the concatenation of name\d1\u, ....
+If the optional first argument
+-\b_ is used,
+all undefined symbols in the assembly
+are treated as global.
+
+The output of the assembly is left on the file "a.out".
+It is executable if no errors occurred
+during the assembly.
+
+.ti 0
+FILES          /etc/as2        pass 2 of the assembler
+.br
+/tmp/atm1?     temporary
+.br
+/tmp/atm2?     temporary
+.br
+/tmp/atm3?     temporary
+.br
+a.out          object
+.sp
+.ti 0
+SEE ALSO       ld(I),
+nm(I),
+un(I),
+db(I),
+a.out(V),
+"UNIX Assembler Manual".
+.sp
+.ti 0
+DIAGNOSTICS    When
+an input file cannot be read, its name
+followed by a question mark is typed and assembly
+ceases.
+When syntactic or semantic errors occur, a single-character diagnostic is typed out
+together with the line number and the file name in which it
+occurred.  Errors in pass 1 cause cancellation of pass 2.
+The possible errors are:
+.sp
+.in +6
+.ti -6
+)  parentheses error
+.ti -6
+]  parentheses error
+.ti -6
+<  String not terminated properly
+.ti -6
+*  Indirection ("*\b_") used illegally
+.ti -6
+.li
+.  Illegal assignment to "."
+.ti -6
+A  error in A\b_ddress
+.ti -6
+B  B\b_ranch instruction is odd or too remote
+.ti -6
+E  error in E\b_xpression
+.ti -6
+F  error in local ("F\b_" or "b") type symbol
+.ti -6
+G  G\b_arbage (unknown) character
+.ti -6
+I  End of file inside an If\b\b__
+.ti -6
+M  M\b_ultiply defined symbol as label
+.ti -6
+O  O\b_dd-- word quantity assembled at odd address
+.ti -6
+P  P\b_hase error-- "." different in pass 1 and 2
+.ti -6
+R  R\b_elocation error
+.ti -6
+U  U\b_ndefined symbol
+.ti -6
+X  syntaX\b_ error
+.in -6
+.sp
+.ti 0
+BUGS           Symbol table overflow is not checked.
diff --git a/man/man1/bas.1 b/man/man1/bas.1
new file mode 100644 (file)
index 0000000..2bdaa5b
--- /dev/null
@@ -0,0 +1,312 @@
+.pa 1
+.he 'BAS (I)'1/15/73'BAS (I)'
+.ti 0
+NAME           bas -- basic
+.sp
+.ti 0
+SYNOPSIS       bas\b\b\b___ [ file ]
+.sp
+.ti 0
+DESCRIPTION    bas\b\b\b___
+is a dialect of basic [1].
+If a file argument is provided,
+the file is used for input before the console
+is read.
+.sp
+bas\b\b\b___ accepts lines of the form:
+.sp
+   statement
+   integer statement
+.sp
+Integer numbered statements
+(known as internal statements)
+are stored for later execution.
+They are stored in sorted ascending order.
+Non-numbered statements are immediately executed.
+The result of an immediate expression statement
+(that does not have '=' as its highest operator) is printed.
+.sp
+Statements have the following syntax:
+.sp
+.in +6
+.ti -3
+expression
+.br
+The expression is executed for its side
+effects (assignment or function call)
+or for printing as described above.
+.sp
+.ti -3
+done\b\b\b\b____
+.br
+Return to system level.
+.sp
+.ti -3
+draw\b\b\b\b____ expression expression expression
+.br
+A line is drawn on the Tektronix 611 display (/dev/vt0) from
+the current display position
+to the XY co-ordinates specified by the
+first two expressions.
+(The scale is zero to one in both X and Y directions)
+If the third expression
+is zero, the line is invisible.
+The current display position is set to the end point.
+.sp
+.ti -3
+display\b\b\b\b\b\b\b_______ list
+.br
+The list of expressions and strings is
+concatenated and displayed (i.e. printed) on the 611 starting
+at the current display position.
+The current display position is not changed.
+.sp
+.ti -3
+erase\b\b\b\b\b_____
+.br
+The 611 screen is erased.
+.sp
+.ti -3
+for\b\b\b___ name =\b_\b= expression expression statement
+.ti -3
+for\b\b\b___ name =\b_ expression expression
+.br
+.li
+...
+.ti -3
+next\b\b\b\b____
+.br
+The for\b\b\b___ statement
+repetitively executes a
+statement (first form)
+or a group of statements (second form)
+under control of a named variable.
+The variable takes on the value of
+the first expression,
+then is incremented by one on each loop,
+not to exceed the value of
+the second expression.
+.sp
+.ti -3
+goto\b\b\b\b____ expression
+.br
+The expression is evaluated, truncated to an integer
+and execution goes to the corresponding integer numbered statment.
+If executed from immediate mode,
+the internal statements are compiled first.
+.sp
+.ti -3
+if\b\b__ expression statement
+.br
+The statement is executed if the expression evaluates
+to non-zero.
+.sp
+.ti -3
+list\b\b\b\b____ [expression [expression]]
+.br
+list\b\b\b\b____ is used to print out the stored internal statements.
+If no arguments are given, all internal statements are printed.
+If one argument is given, only that
+internal statement is listed.
+If two arguments are given, all internal statements
+inclusively between the arguments are printed.
+.sp
+.ti -3
+print\b\b\b\b\b_____ list
+.br
+The list of expressions and strings are concatenated and
+printed.
+(A string is delimited by " characters.)
+.sp
+.ti -3
+return\b\b\b\b\b\b______ [expression]
+.br
+The expression is evaluated and the result is passed
+back as the value of a function call.
+If no expression is given, zero is returned.
+.sp
+.ti -3
+run\b\b\b___
+.br
+The internal statements are compiled.
+The symbol table is re-initialized.
+The random number generator is re-set.
+Control is passed to the lowest numbered internal
+statement.
+.sp
+.ti -6
+Expressions have the following syntax:
+.sp
+.ti -3
+name
+.br
+A name is used to specify a variable.
+Names are composed of a letter ('a' - 'z')
+followed by letters and digits.
+The first four characters of a name are significant.
+.sp
+.ti -3
+number
+.br
+A number is used to represent a constant value.
+A number is composed of digits, at most one decimal point ('.')
+and possibly a scale factor of the form
+e\b_ digits or e-\b\b__ digits.
+.sp
+.ti -3
+(\b_ expression )\b_
+.br
+Parentheses are used to alter normal order of evaluation.
+.sp
+.ti -3
+expression operator expression
+.br
+Common functions of two arguments are abbreviated
+by the two arguments separated by an operator denoting the function.
+A complete list of operators is given below.
+.sp
+.ti -3
+expression (\b_ [expression [,\b_ expression ...]] )\b_
+.br
+Functions of an arbitrary number of arguments
+can be called by an expression followed by the arguments
+in parentheses separated by commas.
+The expression evaluates to the
+line number of the entry of the function in the
+internally stored statements.
+This causes the internal statements to be compiled.
+If the expression evaluates negative,
+a builtin function is called.
+The list of builtin functions appears below.
+.sp
+.ti -3
+name [\b_ expression [,\b_ expression ...] ]\b_
+.br
+Each expression is truncated to an integer
+and used as a specifier for the name.
+The result is syntactically identical to a name.
+a[1,2] is the same as a[1][2].
+The truncated expressions are restricted to 
+values between 0 and 32767.
+.sp
+.ti -6
+The following is the list of operators:
+.sp
+.ti -3
+=
+.br
+= is the assignment operator.
+The left operand must be a name or an array element.
+The result is the right operand.
+Assignment binds right to left,
+all other operators bind left to right.
+.sp
+.ti -3
+& |
+.br
+&\b_ (logical and)
+has result zero if either of its arguments are zero.
+It has result one if both its arguments are non-zero.
+|\b_ (logical or)
+has result zero if both of its arguments are zero.
+It has result one if either of its arguments are non-zero.
+.sp
+.ti -3
+< <= > >= == <>
+.br
+The relational operators
+(< less than, <= less than or equal,
+> greater than,
+>= greater than or equal,
+== equal to,
+<> not equal to)
+return one if their arguments are in the specified
+relation.
+They return zero otherwise.
+Relational operators at the same level extend as follows:
+a>b>c is the same as a>b&b>c.
+.sp
+.ti -3
++ -
+.br
+Add and subtract.
+.sp
+.ti -3
+* /
+.br
+Multiply and divide.
+.sp
+.ti -3
+^
+.br
+Exponentiation.
+.sp
+.ti -6
+The following is a list of builtin functions:
+.sp
+.ti -3
+arg
+.br
+Arg(i) is the value of the i\b_th
+actual parameter on the current level
+of function call.
+.sp
+.ti -3
+exp
+.br
+Exp(x) is the exponential function of x.
+.sp
+.ti -3
+log
+.br
+Log(x) is the logarithm base e of x.
+.sp
+.ti -3
+sin
+.br
+Sin(x) is the sine of x (radians).
+.sp
+.ti -3
+cos
+.br
+Cos(x) is the cosine of x (radians).
+.sp
+.ti -3
+atn
+.br
+Atn(x) is the arctangent of x.
+.sp
+.ti -3
+rnd
+.br
+Rnd() is a uniformly distributed random
+number between zero and one.
+.sp
+.ti -3
+expr
+.br
+Expr() is the only form of program input.
+A line is read from the input and
+evaluated as an expression.
+The resultant value is returned.
+.sp
+.ti -3
+int
+.br
+Int(x) returns x truncated to an integer.
+.in -6
+.sp
+.ti 0
+FILES          /tmp/btm?       temporary
+.sp
+.ti 0
+SEE ALSO       [1] DEC-11-AJPB-D
+.sp
+.ti 0
+DIAGNOSTICS    Syntax
+errors cause the incorrect line to be typed
+with an underscore where the parse failed.
+All other diagnostics are self explanatory.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/cat.1 b/man/man1/cat.1
new file mode 100644 (file)
index 0000000..f366ec7
--- /dev/null
@@ -0,0 +1,44 @@
+.pa 1
+.he 'CAT (I)'1/15/73'CAT (I)'
+.ti 0
+NAME           cat -- concatenate and print
+.sp
+.ti 0
+SYNOPSIS       cat\b\b\b___ file\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    cat\b\b\b___
+reads each file in sequence
+and writes it on the standard output.
+Thus:
+.sp
+.ti +3
+cat\b\b\b___ file\b\b\b\b____
+.sp
+is about the easiest way to print a file.
+Also:
+.sp
+.ti +3
+cat\b\b\b___ file1\b\b\b\b\b_____ file2\b\b\b\b\b_____ >file3\b\b\b\b\b\b______
+.sp
+is about the easiest way to concatenate
+files.
+.sp
+If no input file is given cat\b\b\b___ reads from the standard
+input file.
+.sp
+If the argument "-" is encountered, cat reads from
+the standard input file.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       pr(I), cp(I)
+.sp
+.ti 0
+DIAGNOSTICS    none;
+if a file cannot be found it is ignored.
+.sp
+.ti 0
+BUGS           cat x y >x  and  cat x y >y  cause strange results.
diff --git a/man/man1/cc.1 b/man/man1/cc.1
new file mode 100644 (file)
index 0000000..348a79e
--- /dev/null
@@ -0,0 +1,52 @@
+.pa 1
+.he 'CC (I)'3/15/72'CC (I)'
+.ti 0
+NAME           cc -- C compiler
+.sp
+.ti 0
+SYNOPSIS       cc\b\b__ [ -c\b\b__ ] sfile\d1\u.c\b\b__ ... ofile\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    cc\b\b__
+is the UNIX C compiler.
+It accepts three types of arguments:
+
+Arguments whose names end with ".c" are assumed to be
+C source programs; they are compiled, and
+the object program is left on the file sfile\d1\u.o (i.e.
+the file whose name is that of the source with ".o" substituted
+for ".c").
+
+Other arguments (except for "-c") are assumed
+to be either loader flag arguments, or C-compatible
+object programs, typically produced by an earlier cc\b\b__ run,
+or perhaps libraries of C-compatible routines.
+These programs, together with the results of any
+compilations specified, are loaded (in the order
+given) to produce an executable program with name
+a.out\b\b\b\b\b_____.
+
+The "-c" argument suppresses the loading phase, as does
+any syntax error in any of the routines being compiled.
+
+.ti 0
+FILES          file.c                  input file
+.nf
+file.o                 object file
+a.out                  loaded output
+/tmp/ctm?              temporary
+/lib/c[01]             compiler
+/lib/crt0.o            runtime startoff
+/lib/libc.a            builtin functions, etc.
+/lib/liba.a            system library
+.fi
+.sp
+.ti 0
+SEE ALSO       C reference manual (in preparation), cdb(I)
+.sp
+.ti 0
+DIAGNOSTICS    Diagnostics
+are intended to be self-explanatory.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/cdb.1 b/man/man1/cdb.1
new file mode 100644 (file)
index 0000000..7a32353
--- /dev/null
@@ -0,0 +1,41 @@
+.pa 1
+.he 'CDB (I)'1/15/73'CDB (I)'
+.ti 0
+NAME           cdb -- C debugger
+.sp
+.ti 0
+SYNOPSIS       cdb\b\b\b___ [ core [ a.out ] ]
+.sp
+.ti 0
+DESCRIPTION    cdb\b\b\b___
+is a debugging program for use with C programs.
+It is by no means completed,
+and this section is essentially only a placeholder
+for the actual description.
+
+Cdb resembles db\b\b__ in many respects, except that
+all integers are decimal.
+
+Even the present cdb\b\b\b___ has one useful feature:
+the command 
+
+       $
+
+will give a stack
+trace
+of the core image of a terminated C program.
+The calls are listed in the order made;
+the actual arguments to each routine are given
+in octal.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       cc(I), db(I), C Reference Manual
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/chdir.1 b/man/man1/chdir.1
new file mode 100644 (file)
index 0000000..a831350
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'CHDIR (I)'3/15/72'CHDIR (I)'
+.ti 0
+NAME           chdir -- change working directory
+.sp
+.ti 0
+SYNOPSIS       chdir\b\b\b\b\b_____ directory
+.sp
+.ti 0
+DESCRIPTION    directory\b\b\b\b\b\b\b\b\b_________
+becomes the new working directory.
+.sp
+Because a new process is created to execute each command,
+chdir\b\b\b\b\b_____ would be ineffective if it were written as a
+normal command.  It is therefore recognized and executed
+by the Shell.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sh(I)
+.sp
+.ti 0
+DIAGNOSTICS    "Bad directory" if the directory cannot
+be changed to.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/chmod.1 b/man/man1/chmod.1
new file mode 100644 (file)
index 0000000..c67cfca
--- /dev/null
@@ -0,0 +1,40 @@
+.pa 1
+.he 'CHMOD (I)'3/15/72'CHMOD (I)'
+.ti 0
+NAME           chmod -- change mode
+.sp
+.ti 0
+SYNOPSIS       chmod\b\b\b\b\b_____ octal file\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    The octal mode
+replaces the mode of each of the files.
+The mode is constructed from the OR of the
+following modes:
+.sp
+.ti +3
+01 write for non-owner
+.ti +3
+02 read for non-owner
+.ti +3
+04 write for owner
+.ti +3
+10 read for owner
+.ti +3
+20 executable
+.ti +3
+40 set-UID
+.sp
+Only the owner of a file may change its mode.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       stat(I), ls(I)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/chown.1 b/man/man1/chown.1
new file mode 100644 (file)
index 0000000..9262195
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'CHOWN (I)'3/15/72'CHOWN (I)'
+.ti 0
+NAME           chown -- change owner
+.sp
+.ti 0
+SYNOPSIS       chown\b\b\b\b\b_____ owner file\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    owner\b\b\b\b\b_____
+becomes the new owner of the files.
+The owner may be either a decimal UID or
+a login name found in the password file.
+.sp
+Only the owner of a file is allowed to change the owner.
+It is illegal to change the owner of a file with the set-user-ID
+mode.
+.sp
+.ti 0
+FILES          /etc/passwd
+.sp
+.ti 0
+SEE ALSO       stat(I)
+.sp
+.ti 0
+DIAGNOSTICS    "Who?" if owner cannot be found,
+"file?" if file cannot be found.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/cmp.1 b/man/man1/cmp.1
new file mode 100644 (file)
index 0000000..05113c0
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'CMP (I)'1/15/73'CMP (I)'
+.ti 0
+NAME           cmp -- compare two files
+.sp
+.ti 0
+SYNOPSIS       cmp\b\b\b___ file\e91\e8 file\e92\e8
+.sp
+.ti 0
+DESCRIPTION    The two files are
+compared for identical contents.
+Discrepancies are noted
+by giving the offset and the differing words,
+all in octal.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       proof(I)
+.sp
+.ti 0
+DIAGNOSTICS    Messages
+are given for inability to open either argument, premature
+EOF on either argument, and incorrect usage.
+.sp
+.ti 0
+BUGS           If
+the shorter of the two files is of odd length,
+cmp acts as if a null byte had been appended to it.
diff --git a/man/man1/cp.1 b/man/man1/cp.1
new file mode 100644 (file)
index 0000000..b1f61d9
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'CP (I)'1/24/73'CP (I)'
+.ti 0
+NAME           cp -- copy
+.sp
+.ti 0
+SYNOPSIS       cp\b\b__ file\e91\e8 file\e92\e8
+.sp
+.ti 0
+DESCRIPTION    The
+first file is copied onto the second.
+The mode and owner of the target file
+are preserved if it already
+existed; the mode of the source file
+is used otherwise.
+.sp
+If file\e92\e8 is a directory, then the target 
+file is a file in that directory with the file-name
+of file\e91\e8.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       cat(I), pr(I), mv(I)
+.sp
+.ti 0
+DIAGNOSTICS    Error returns are
+checked at every system call, and
+appropriate diagnostics are produced.
+.sp
+.ti 0
+BUGS           Copying
+a file onto itself destroys its contents.
diff --git a/man/man1/cref.1 b/man/man1/cref.1
new file mode 100644 (file)
index 0000000..ffa705b
--- /dev/null
@@ -0,0 +1,119 @@
+.pa 1
+.he 'CREF (I)'2/5/1973'CREF (I)'
+.fi
+.in16
+.ti 0
+NAME           cref  --  make cross reference listing
+.sp
+.fi
+.in16
+.ti 0
+SYNOPSIS       cref\b\b\b\b____ [ -soi\b\b\b\b____ ] name1 ...
+.sp
+.fi
+.in16
+.ti 0
+DESCRIPTION    CREF makes a cross reference listing
+of files in assembler format (see AS(I)).  The files
+named as arguments in the command
+line are searched for symbols (defined as a succession
+of alphabetics, numerics, '.', or '_', beginning with
+an alphabetic, '.', or '_').
+.sp
+The output report is in four columns:
+.nf
+.sp
+(1)    (2)     (3)     (4)
+symbol file    see     text as it appears in file
+               below
+.sp
+.fi
+The third column contains the line number in the file
+by default; the -s\b\b__ option
+will cause the most recent name symbol to appear there
+instead.
+.sp
+CREF uses either an ignore\b\b\b\b\b\b______ file or an only\b\b\b\b____ file.
+If the -i\b\b__ option is given, it will take the next
+file name to be an ignore\b\b\b\b\b\b______ file; if the -o\b\b__ option
+is given, the next file name will be taken as an only\b\b\b\b____ file.
+Ignore\b\b\b\b\b\b______ and only\b\b\b\b____
+files should be lists of symbols separated by new lines.
+If an ignore\b\b\b\b\b\b______ file is given, all the symbols in the file
+will be ignored in columns (1) and (3) of the output.
+If an only\b\b\b\b____ file is given, only symbols appearing in the
+file will appear in column (1), but column (3)
+will still contain the most recent name encountered.
+Only one of the options -i\b\b__ or
+-o\b\b__ may be used.
+The default setting
+is -i\b\b__;
+all symbols predefined in the assembler are ignored, except
+system call names, which are collected.
+.sp
+.fi
+.in16
+.ti 0
+FILES          Files t.0, t.1, t.2, t.3 are
+created (i.e. DESTROYED) in the working
+directory of anyone
+using cref\b\b\b\b____. This nuisance will be repaired soon.
+The output is left in file s.out\b\b\b\b\b_____ in the working directory.
+.sp
+/usr/lem/s.tab is the default ignore\b\b\b\b\b\b______ file.
+.sp
+.fi
+.in16
+.ti 0
+SEE ALSO       as(I)
+.sp
+.fi
+.in16
+.ti 0
+DIAGNOSTICS    "line too long" -- input line >131 characters
+.nf
+.sp
+"symbol too long" -- symbol >20 characters
+.sp
+"too many symbols" -- >10 symbols in line
+.sp
+"cannot open t.?" -- bug; see LEM
+.sp
+"cannot fork; examine t.out" -- can't start sort\b\b\b\b____
+.in 20
+.fi
+process; intermediate results are on files t.0\b\b\b___,
+t.1\b\b\b___,t.2\b\b\b___,t.3\b\b\b___.  These may be sorted independently
+and the results concatenated by the user.
+.sp
+.in 16
+"cannot sort" -- odd response from sort\b\b\b\b____; examine
+.in 20
+intermediate results, as above.
+.sp
+.in16
+.nf
+"impossible situation" -- system bug
+.sp
+"cannot open" file -- one of the input names
+.in 20
+.fi
+cannot be opened for reading.
+.in16
+.nf
+.sp
+.fi
+.in16
+.ti 0
+BUGS           The destruction of
+unsuspecting users' files should soon be fixed.
+A limitation that may eventually go away is the
+restriction to assembler language format. There
+should be options for FORTRAN, English, etc., lexical
+analysis.
+.sp
+File names longer than eight characters cause misalignment in
+the output if tabs are set at every eighth column.
+
+It should
+write on the standard output, not s.out.
diff --git a/man/man1/crypt.1 b/man/man1/crypt.1
new file mode 100644 (file)
index 0000000..1f366e1
--- /dev/null
@@ -0,0 +1,41 @@
+.pa 1
+.he 'CRYPT (I)'10/23/71'CRYPT (I)'
+.ti 0
+NAME           crypt -- encode/decode
+.sp
+.ti 0
+SYNOPSIS       crypt\b\b\b\b\b_____ [ password ]
+.sp
+.ti 0
+DESCRIPTION    crypt\b\b\b\b\b_____
+is an exact implementation of Boris Hagelin's
+cryptographic machine called the M-209 by the U. S. Army [1].
+
+crypt\b\b\b\b\b_____ reads from the standard input file and writes
+on the standard output.
+For a given password, the encryption
+process is idempotent;
+that is,
+
+       crypt znorkle <clear >cypher
+       crypt znorkle <cypher
+
+will print the clear.
+
+crypt\b\b\b\b\b_____ is suitable
+for use as a filter:
+
+       pr <"crypt bandersnatch"<cypher
+
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       [1] U. S. Patent 2,089,603.
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/date.1 b/man/man1/date.1
new file mode 100644 (file)
index 0000000..2ec8af0
--- /dev/null
@@ -0,0 +1,33 @@
+.pa 1
+.he 'DATE (I)'3/15/72'DATE (I)'
+.ti 0
+NAME           date -- print and set the date
+.sp
+.ti 0
+SYNOPSIS       date\b\b\b\b____ [ mmddhhmm ]
+.sp
+.ti 0
+DESCRIPTION    If no argument is given, the current date is printed
+to the second.
+If an argument is given, the current date is set.
+mm\b\b__ is the month number;
+dd\b\b__ is the day number in the month;
+hh\b\b__ is the hour number (24 hour system);
+mm\b\b__ is the minute number.
+For example:
+
+      date 10080045
+
+sets the date to Oct 8, 12:45 AM.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "?" if the argument is syntactically incorrect.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/db.1 b/man/man1/db.1
new file mode 100644 (file)
index 0000000..859bd7e
--- /dev/null
@@ -0,0 +1,283 @@
+.pa 1
+.he 'DB (I)'3/15/72'DB (I)'
+.ti 0
+NAME           db -- debug
+.sp
+.ti 0
+SYNOPSIS       db\b\b__ [ core [ namelist ] ] [ -\b_ ]
+.sp
+.ti 0
+DESCRIPTION    Unlike
+many debugging packages (including DEC's ODT, on
+which db\b\b__ is loosely based) db\b\b__ is not loaded as part of the
+core image which it is used to examine; instead it examines files.
+Typically, the file will be either a core image produced
+after a fault or the binary output of
+the assembler.
+Core\b\b\b\b____ is the file being debugged; if omitted "core" is assumed.
+namelist\b\b\b\b\b\b\b\b________ is a file containing a symbol table.
+If it is omitted,
+the symbol table is obtained from the
+file being debugged,
+or if not there from a.out\b\b\b\b\b_____.
+If no appropriate name list file
+can be found, db\b\b__ can still be used but some of its symbolic
+facilities become unavailable.
+
+For the meaning of the optional third argument, see
+the last paragraph below.
+.sp
+The format for most db\b\b__ requests is an address followed
+by a one character command.
+.sp
+Addresses are expressions built up as follows:
+.sp
+.in +6
+.un 3
+1. A name has the value assigned to it
+when the input file was assembled.
+It may be relocatable or not depending
+on the use of the name during the assembly.
+.br
+.un 3
+.sp
+2. An octal number is an absolute quantity with the appropriate
+value.
+.br
+.un 3
+.sp
+3. A decimal number immediately followed by "." is
+an absolute quantity with the appropriate value.
+.br
+.un 3
+.sp
+4. An octal number immediately followed by "r" is a relocatable
+quantity with the appropriate value.
+.br
+.un 3
+.sp
+5. The symbol "." indicates the current pointer
+of db\b\b__.  The current pointer is set by many db\b\b__ requests.
+
+.ti -3
+6. A "*" before
+an expression forms an expression whose value is the
+number in the word addressed by the first expression.
+A "*" alone is equivalent to "*.".
+
+.ti -3
+6. Expressions separated by "+" or " " (blank) are expressions
+with value equal to the sum of the components.  At most
+one of the components may be relocatable.
+.br
+.un 3
+.sp
+8. Expressions separated by "-" form an expression
+with value equal to the difference to the components.
+If the right component is relocatable, the left component
+must be relocatable.
+.br
+.un 3
+.sp
+9. Expressions are evaluated left to right.
+.sp 1
+.in -6
+Names for registers are
+built in:
+.sp
+   r0 ... r5
+   sp
+   pc
+   fr0 ... fr5
+.sp
+These may be examined.
+Their values are deduced from the contents
+of the stack in a core image file.  They are meaningless
+in a file that is not a core image.
+.sp
+If no address is given for a command, the current address
+(also specified by ".") is assumed.  In general, "."
+points to the last word or byte printed by db\b\b__.
+.sp
+There are db\b\b__ commands for examining locations
+interpreted as octal numbers, machine instructions,
+ASCII characters, and addresses.
+For numbers and characters, either bytes
+or words may be examined.
+The following commands are used to examine the specified file.
+.sp
+.in +6
+.un 3
+/  The addressed word is printed in octal.
+
+.un 3
+\\  The addressed byte is printed in octal.
+
+.un 3
+"  The addressed word is printed as two ASCII characters.
+
+.un 3
+'  The addressed byte is printed as an ASCII character.
+.ti -3
+
+`  The addressed word is printed in decimal.
+
+.un 3
+?  The addressed word is interpreted as a machine
+instruction and a symbolic form of the instruction,
+including symbolic addresses, is printed.
+Often, the result will appear exactly as it was written
+in the source program.
+.br
+.un 3
+
+&  The addressed word is interpreted as a symbolic address
+and is printed as the name of the symbol whose value is closest
+to the addressed word, possibly followed by a signed offset.
+.br
+.un 3
+
+<nl> (i. e., the character "new line")  This command advances
+the current location counter "." and prints the resulting
+location in the mode last specified by
+one of the above requests.
+.br
+.un 3
+
+^  This character decrements "." and prints the
+resulting location in the mode last selected
+one of the above requests.  It is a converse to <nl>.
+
+.un 3
+%  Exit.
+.sp
+.in -6
+Odd addresses to word-oriented commands are rounded
+down.
+The incrementing and decrementing
+of "." done by the <nl> and ^ requests is by one or
+two depending on whether the last command
+was word or byte oriented.
+.sp
+The address portion of any of the above commands
+may be followed by a comma and then by an
+expression.  In this case that number of sequential
+words or bytes specified by the expression is printed.
+"." is advanced so that it points at the
+last thing printed.
+.sp
+There are two commands to interpret the value
+of expressions.
+.sp
+.in +6
+.un 3
+=  When preceded by an expression, the value of the expression
+is typed in octal.
+When not preceded by an expression, the value of "." is
+indicated.
+This command does not change the value of ".".
+.br
+.un 3
+
+:  An attempt is made to print the given expression
+as a symbolic address.  If the expression is relocatable,
+that symbol is found whose value is nearest
+that of the expression, and the symbol is typed, followed by
+a sign and the appropriate offset.
+If the value of the expression is absolute, a symbol
+with exactly the indicated value is sought and
+printed if found; if no matching symbol is discovered, the
+octal value of the expression is given.
+.sp
+.in -6
+The following command may be used to patch the file being debugged.
+.sp
+.in +6
+.un 3
+!  This command must be preceded by an expression.
+The value of the expression is stored at the location
+addressed by the current value of ".".
+The opcodes do not appear in the symbol
+table, so the user must assemble them by hand.
+
+.sp
+.in -6
+The following command is used after a fault has caused
+a core image file to be produced.
+.sp
+.in +6
+.un 3
+$  causes the fault type and
+the contents of the general registers and
+several other registers to be printed both in octal and symbolic
+format.
+The values are as they were at the time of the fault.
+.sp
+.in -6
+Db\b\b__ should not be used to examine special files,
+for example disks and tapes, since it reads one byte
+at a time.
+Use od(I) instead.
+
+For some purposes, it is important to know how addresses
+typed by the user correspond with
+locations in the file being debugged.
+The mapping algorithm employed by db\b\b__ is non-trivial
+for two reasons:
+First, in an a.out\b\b\b\b\b_____ file, there is a 20(8) byte header
+which will not appear when the file is loaded into
+core for execution.
+Therefore, apparent location 0 should correspond
+with actual file offset 20.
+Second, some systems cause a "squashed" core
+image to be written.
+In such a core
+image, addresses in the stack must be mapped
+according to the degree of squashing
+which has been employed.
+Db\b\b__ obeys the following rules:
+
+If exactly one argument is given, and if it appears
+to be an a.out\b\b\b\b\b_____ file, the 20-byte header is skipped
+during addressing, i.e., 20 is added to all addresses typed.
+As a consequence, the header can be examined
+beginning at location -20.
+
+If exactly one argument is given and if the file does
+not appear to be an a.out\b\b\b\b\b_____ file, no mapping is done.
+
+If zero or two arguments are given,
+the mapping appropriate to a core image file is employed.
+This means that locations above the program break
+and below the stack
+effectively do not exist (and are not, in fact, recorded
+in the core file).
+Locations above the user's stack pointer are mapped,
+in looking at the core file, to
+the place where they are really stored.
+The per-process data kept by the
+system, which is stored in the last 512(10) bytes
+of the core file,
+can be addressed at apparent locations 160000-160777.
+
+If one wants to examine
+a file which has an associated name list,
+but is not a core image file, the last argument "-"
+can be used (actually the only purpose of the
+last argument is to make the number of
+arguments not equal to two).
+This feature is used most frequently in
+examining the memory file /dev/mem.
+
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       as(I), core(V), a.out(V), od(I)
+.sp
+.ti 0
+DIAGNOSTICS    "File not found" if the first argument
+cannot be read; otherwise "?".
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/dc.1 b/man/man1/dc.1
new file mode 100644 (file)
index 0000000..06e4845
--- /dev/null
@@ -0,0 +1,196 @@
+.pa 1
+.he 'DC (I)'1/15/73'DC (I)'
+.ti 0
+NAME           dc -- desk calculator
+.sp
+.ti 0
+SYNOPSIS       dc\b\b__ [file]
+.sp
+.ti 0
+DESCRIPTION    dc\b\b__
+is an arbitrary precision integer arithmetic package.
+The overall structure of dc is
+a stacking (reverse Polish) calculator.
+The following constructions are recognized
+by the calculator:
+.sp
+.in +3
+.ti -3
+number
+.br
+The value of the number is pushed on the stack.
+A number is an unbroken string of the digits 0-9.
+It may be preceded by an underscore (_) to input a
+negative number.
+.sp
+.ti -3
++\b_ -\b_ *\b_ /\b_ %\b_ ^\b_
+.br
+The top two values on the stack are added (+\b_),
+subtracted (-\b_), multiplied (*\b_), divided (/\b_),
+remaindered (%\b_) or exponentiated (^).
+The two entries are popped off the stack;
+the result is pushed on the stack in their place.
+.sp
+.ti -3
+s\b_x
+.br
+The top of the stack is popped and stored into
+a register named x, where x may be any character.
+.sp
+.ti -3
+l\b_x
+.br
+The value in register x is pushed on the stack.
+The register x is not altered.
+All registers start with zero value.
+.sp
+.ti -3
+d\b_
+.br
+The top value on the stack is pushed on the stack.
+Thus the top value is duplicated.
+.sp
+.ti -3
+p\b_
+.br
+The top value on the stack is printed.
+The top value remains unchanged.
+.sp
+.ti -3
+f\b_
+.br
+All values on the stack and in registers are printed.
+.sp
+.ti -3
+.ul 1
+q
+.br
+exits the program. If executing a string, the nesting level is
+popped by two.
+.sp
+.ti -3
+.ul
+x
+.br
+treats the top element of the stack as a character string
+and executes it as a string of dc commands.
+.sp
+.ti -3
+[...]\b\b\b\b\b_____
+.br
+puts the bracketed ascii string onto the top of the stack.
+.sp
+.ti -3
+<\b_x =\b_x >\b_x
+.br
+The top two elements of the stack are popped and compared.
+Register x is executed if they obey the stated
+relation.
+.sp
+.ti -3
+.ul
+v
+.br
+replaces the top element on the stack by its square root.
+.sp
+.ti -3
+!\b_
+.br
+interprets the rest of the line as a UNIX command.
+.sp
+.ti -3
+c\b_
+.br
+All values on the stack are popped.
+.sp
+.ti -3
+i\b_
+.br
+The top value on the stack is popped and used as the
+number radix for further input.
+.sp
+.ti -3
+o\b_
+.br
+the top value on the stack is popped and used as the
+number radix for further output.
+.sp
+.ti -3
+z\b_
+.br
+the stack level is pushed onto the stack.
+.sp
+.ti -3
+?\b_
+.br
+a line of input is taken from the input source (usually the console)
+and executed.
+.sp
+.ti -3
+new-line
+.br
+ignored except as the name of a register or to end the
+response to a ?\b_.
+.sp
+.ti -3
+space
+.br
+ignored except as the name of a register or to terminate a number.
+.br
+.sp
+.in -3
+If a file name is given, input is taken from that file until
+end-of-file, then input is taken from the console.
+.sp
+An example to 
+calculate the monthly, weekly and
+hourly rates for a $10,000/year salary.
+.sp
+.nf
+.in +3
+10000
+100*   (now in cents)
+dsa    (non-destructive store)
+12/    (pennies per month)
+la52/  (pennies per week)
+d10*   (deci-pennies per week)
+375/   (pennies per hour)
+f      (print all results)
+     512
+     19230
+     83333
+"a"  1000000
+.sp
+.in -3
+An example which prints the first ten values of n! is
+.in +3
+[la1+dsa*pla10>x]sx
+0sa1
+lxx
+.sp
+.fi
+.in -3
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       msh(VII), salloc(III)
+.sp
+.ti 0
+DIAGNOSTICS    (x) ? for unrecognized character x.
+.br
+(x) ? for not enough elements on the stack to do what was asked
+by command x.
+.br
+"Out of space" when the free list is exhausted (too many digits).
+.br
+"Out of headers" for too many numbers being kept around.
+.br
+"Out of pushdown" for too many items on the stack.
+.br
+"Nesting Depth" for too many levels of nested execution.
+.sp
+.ti 0
+.ti 0
+BUGS           --
diff --git a/man/man1/df.1 b/man/man1/df.1
new file mode 100644 (file)
index 0000000..fb1e1ec
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'DF (I)'1/20/73'DF (I)'
+.ti 0
+NAME           df -- disk free
+.sp
+.ti 0
+SYNOPSIS       df\b\b__ [ filesystem ]
+.sp
+.ti 0
+DESCRIPTION    df\b\b__
+prints out the number of free blocks
+available on a file system.
+If the file system is unspecified,
+the free space on all of
+the normally mounted file systems
+is printed.
+.sp
+.ti 0
+FILES          /dev/rf?,
+/dev/rk?,
+/dev/rp?
+.sp
+.ti 0
+SEE ALSO       check(VIII)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/dsw.1 b/man/man1/dsw.1
new file mode 100644 (file)
index 0000000..20db630
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'DSW (I)'3/15/72'DSW (I)'
+.ti 0
+NAME           dsw  --  delete interactively
+.sp
+.ti 0
+SYNOPSIS       dsw\b\b\b___ [ directory ]
+.sp
+.ti 0
+DESCRIPTION    For
+each file in the given directory ("." if not specified)
+dsw\b\b\b___ types its name.  If "y" is typed, the file is deleted;
+if "x", dsw\b\b\b___ exits; if anything else, the file
+is not removed.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       rm(I)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           The name "dsw"
+is a carryover from the ancient past.  Its etymology is
+amusing but the name is nonetheless ill-advised.
diff --git a/man/man1/du.1 b/man/man1/du.1
new file mode 100644 (file)
index 0000000..4af9382
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'DU (I)'1/20/73'DU (I)'
+.ti 0
+NAME           du  --  summarize disk usage
+.sp
+.ti 0
+SYNOPSIS       du\b\b__  [ -s\b\b__ ] [ -a\b\b__ ] [ name ... ]
+.sp
+.ti 0
+DESCRIPTION    du\b\b__
+gives the number of blocks contained in all files
+and (recursively) directories within each specified directory or file name\b\b\b\b____.
+If name\b\b\b\b____ is missing, .\b_ is used.
+
+The optional argument -s\b\b__ causes only the grand total to
+be given.
+The optional argument -a\b\b__ causes an entry to be generated
+for each file.
+Absence of either causes an entry to be generated for
+each directory only.
+
+A file which has two links to it is only counted once.
+.sp
+.ti 0
+FILES          .
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           Non-directories
+given as arguments (not under -a option) are not listed.
+.sp
+Removable
+file systems do not work correctly
+since i-numbers may be repeated while the corresponding
+files are distinct.
+Du should maintain an i-number list per root directory
+encountered.
diff --git a/man/man1/echo.1 b/man/man1/echo.1
new file mode 100644 (file)
index 0000000..ba2bdb5
--- /dev/null
@@ -0,0 +1,25 @@
+.pa 1
+.he 'ECHO (I)'3/15/72'ECHO (I)'
+.ti 0
+NAME           echo -- echo arguments 
+.sp
+.ti 0
+SYNOPSIS       echo\b\b\b\b____ [ arg\e8\e9\e91\e8 ... ]
+.sp
+.ti 0
+DESCRIPTION    echo\b\b\b\b____
+writes all its arguments in order as a line on the
+standard output file.
+It is mainly useful for producing diagnostics in command files.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/ed.1 b/man/man1/ed.1
new file mode 100644 (file)
index 0000000..d9a38bb
--- /dev/null
@@ -0,0 +1,421 @@
+.pa 1
+.he 'ED (I)'1/15/73'ED (I)'
+.tr |
+.ti 0
+NAME
+.br
+ed  --  editor
+.sp
+.ti 0
+SYNOPSIS
+.br
+ed\b\b__ [ name ]
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in -8
+ed\b\b__
+is the standard text editor.
+.sp
+If the optional argument is given, ed\b\b__
+simulates an e\b_ command on the named file; that is to say,
+the file is read into ed\b\b__'s buffer so that it can be edited.
+.sp
+ed\b\b__ operates on a copy of any file it is editing; changes made
+in the copy have no effect on the file until a write
+(w\b_) command is given.
+The copy of the text being edited resides
+in a temporary file called the buffer\b\b\b\b\b\b______.  There is only
+one buffer.
+.sp
+Commands to ed\b\b__ have a simple and regular structure: zero or
+more addresses\b\b\b\b\b\b\b\b\b_________ followed by a single character command\b\b\b\b\b\b\b_______, possibly
+followed by parameters to the command.
+These addresses specify one or more lines in the buffer.
+Every command which requires addresses has default addresses,
+so that the addresses can often be omitted.
+.sp
+In general, only one command may appear on a line.
+Certain commands allow the input of text.
+This text is placed in the appropriate place in the buffer.
+While ed\b\b__ is accepting text, it is said
+to be in input\b\b\b\b\b_____ mode\b\b\b\b____.  In this mode, no commands are recognized;
+all input is merely collected.
+Input mode is left by typing a period (.) alone at the
+beginning of a line.
+.sp
+ed\b\b__ supports a limited form of regular\b\b\b\b\b\b\b_______ expression\b\b\b\b\b\b\b\b\b\b__________ notation.
+A regular expression is an expression which specifies
+a set of strings of characters.
+A member of this set of strings is said to be matched\b\b\b\b\b\b\b_______
+by the regular expression.
+The regular expressions allowed by ed\b\b__ are constructed as follows:
+.sp
+.in +6
+.ti -3
+1. An ordinary character (not one of those discussed below)
+is a regular expression and matches that character.
+.sp
+.ti -3
+2. A circumflex (^) at the beginning of a regular expression
+matches the null character at the beginning of a line.
+.sp
+.ti -3
+3. A currency symbol ($) at the end of a regular expression
+matches the null character at the end of a line.
+.sp
+.ti -3
+4. A period (.) matches any character but a new-line character.
+
+.ti -3
+5. A regular expression followed by an asterisk (*)
+matches any number of adjacent occurrences (including zero)
+of the regular expression it follows.
+
+.ti -3
+6. A string of characters enclosed in square brackets
+([]) matches any character in the string but no others.
+If, however, the first character of the string is a circumflex
+(^) the regular expression matches any character but new-line
+and the characters in the string.
+
+.ti -3
+7. The concatenation of regular expressions is a regular
+expression which matches the concatenation of the strings
+matched by the components of the regular expression.
+
+.ti -3
+8. The null regular expression standing alone
+is equivalent to the last regular expression encountered.
+
+.in -6
+Regular expressions are used in addresses to specify
+lines and in one command (s\b_, see below)
+to specify a portion of a line which is to be replaced.
+
+If it is desired to use one of
+the regular expression metacharacters as an ordinary
+character, that character may be preceded by "\\".
+This also applies to the character bounding the regular
+expression (often "/") and to "\\" itself.
+.sp
+Addresses are constructed as follows.
+To understand addressing in ed\b\b__
+it is necessary to know that at any time there is a current\b\b\b\b\b\b\b_______
+line\b\b\b\b____.  Generally speaking, the current line is
+the last line affected by a command; however,
+the exact effect on the current line
+by each command is discussed under the description of
+the command.
+
+.in +6
+.ti -3
+1. The character "." addresses the current line.
+
+.ti-3
+2.|The character "^" addresses the line immediately before the current line.
+.sp
+.ti -3
+3. The character "$" addresses the last line of the buffer.
+
+.ti -3
+4. A decimal number n\b_ addresses the n\b_th line of the buffer.
+
+.ti -3
+6. A regular expression enclosed in slashes "/" addresses
+the first line found by searching toward the end of the
+buffer and stopping at the first line containing a
+string matching the regular expression.
+If necessary the search wraps around to the beginning of the
+buffer.
+
+.ti -3
+5. A regular expression enclosed in queries "?" addresses
+the first line found by searching toward the beginning of
+the buffer and stopping at the first line found containing
+a string matching the regular expression.  If necessary
+the search wraps around to the end of the buffer.
+
+.ti -3
+7. An address followed by a plus sign "+"
+or a minus sign "-" followed by a decimal number specifies that address plus
+(resp. minus) the indicated number of lines.
+The plus sign may be omitted.
+
+.ti-3
+8.|"'x" addresses the line associated (marked) with the
+mark name character "x"
+which must be a printable character.
+Lines may be marked with the "k" command described below.
+.sp
+.in -6
+Commands may require zero, one, or two addresses.
+Commands which require no addresses regard the presence
+of an address as an error.
+Commands which accept one or two addresses
+assume default addresses when insufficient are given.
+If more addresses are given than such a command requires,
+the last one or two (depending on what is accepted) are used.
+
+Addresses are separated from each other typically by a comma
+(,).
+They may also be separated by a semicolon
+(;).  In this case the current line "." is set to
+the previous address before the next address is interpreted.
+This feature can be used to determine the starting
+line for forward and backward searches ("/", "?").
+The second address of any two-address sequence
+must correspond to a line following the line corresponding to the first address.
+
+In the following list of ed\b\b__ commands, the default addresses
+are shown in parentheses.  The parentheses are not part of
+the address, but are used to show that the given addresses are
+the default.
+
+As mentioned, it is generally illegal for more than one
+command to appear on a line.
+However, any command may be suffixed by "p" (for "print").
+In that case, the current line is printed after the command
+is complete.
+.ne 6
+
+.in +6
+.ti -3
+(.)a
+.ti -3
+<text>
+.ti -3
+.li
+\1f.
+.br
+The a\b_ppend command reads the given text
+and appends it after the addressed line.  "." is left
+on the last line input, if there
+were any, otherwise at the addressed line.
+Address "0" is legal for this command; text is placed
+at the beginning of the buffer.
+
+.ti -3
+(.,.)c
+.ti -3
+<text>
+.ti -3
+\1f.
+.br
+The c\b_hange
+command deletes the addressed lines, then accepts input
+text which replaces these lines.
+"." is left at the last line input; if there were none,
+it is left at the first line not changed.
+
+.ti -3
+(.,.)d
+.br
+The d\b_elete command deletes the addressed lines from the buffer.
+The line originally after the last line deleted becomes the current line;
+if the lines deleted were originally at the end,
+the new last line becomes the current line.
+
+.ti -3
+e filename
+.br
+The e\b_dit
+command causes the entire contents of the buffer to be deleted,
+and then the named file to be read in.
+"." is set to the last line of the buffer.
+The number of characters read is typed.
+"filename" is remembered for possible use as a default file name
+in a subsequent r\b_ or w\b_ command.
+.sp
+.ti-3
+f filename
+.br
+The f\b_ilename command prints the currently remembered file name.
+If "filename" is given,
+the currently remembered file name is changed to "filename".
+
+.ti -3
+(1,$)g/regular expression/command list
+.br
+In the g\b_lobal
+command, the first step is to mark every line which matches
+the given regular expression.
+Then for every such line, the
+given command list is executed with "." initially set to that line.
+A single command or the first of multiple commands
+appears on the same line with the global command.
+All lines of a multi-line list except the last line must be ended with "\\".
+a\b_, i\b_, and c\b_ commands and associated input are permitted;
+the "." terminating input mode may be omitted if it would be on the
+last line of the command list.
+The (global) commands, g\b_ and v\b_, are not permitted in the command list.
+
+.ti -3
+(.)i
+.ti -3
+<text>
+.ti -3
+\1f.
+.br
+This command i\b_nserts the given text before the addressed line.
+"." is left at the last line input; if there were none,
+at the addressed line.
+This command differs from the a\b_ command only in the placement of the
+text.
+
+.ti-3
+(.)kx
+.br
+The mark\b_ command associates or marks the addressed line with
+the single character mark name "x".
+The ten most recent mark names are remembered.
+The current mark names may be printed with the n\b_ command.
+
+.ti -3
+(.,.)mA
+.br
+The m\b_ove command will reposition the addressed lines after the line
+addressed by "A".
+The line originally after the last line moved becomes the current line;
+if the lines moved were originally at the end,
+the new last line becomes the current line.
+
+.ti-3
+n
+.br
+The markn\b_ames command will print the current mark names.
+
+.ti -3
+(.,.)p
+.br
+The p\b_rint command prints the addressed lines.  "."
+is left at the last line printed.
+The p\b_ command may\b\b\b___ be placed on the same line after any command.
+
+.ti -3
+q\b_
+.br
+The q\b_uit command causes ed\b\b__ to exit.  No automatic write
+of a file is done.
+
+.ti -3
+($)r filename
+.br
+The r\b_ead command
+reads in the given file after the addressed line.
+If no file name is given,
+the remembered file name, if any, is used (see e\b_ and f\b_ commands).
+The remembered file name is not changed unless
+"filename" is the very first file name
+mentioned.
+Address "0" is legal for r\b_ and causes the
+file to be read at the beginning of the buffer.
+If the read is successful, the number of characters
+read is typed.
+"." is left at the last line read in from the file.
+
+.ti -3
+(.,.)s/regular expression/replacement/    or,
+.ti -3
+(.,.)s/regular expression/replacement/g
+.br
+The s\b_ubstitute command searches each addressed
+line for an occurrence of the specified regular expression.
+On each line in which a match is found,
+all matched strings are replaced by the replacement specified,
+if the global replacement indicator "g" appears after the command.
+If the global indicator does not appear, only the first occurrence
+of the matched string is replaced.
+It is an error for the substitution to fail on all addressed lines.
+Any character other than space or new-line
+may be used instead of "/" to delimit the regular expression
+and the replacement.
+"." is left at the last line substituted.
+
+The ampersand "&" appearing in the replacement
+is replaced by the regular expression that was matched.
+The special meaning of "&" in this context may be
+suppressed by preceding it by "\\".
+
+.ti -3
+(1,$)v/regular expression/command list
+.br
+This command is the same as the g\b_lobal command
+except that the command list is executed
+with "." initially set to every line except\b\b\b\b\b\b______ those
+matching the regular expression
+
+.ti -3
+(1,$)w filename
+.br
+The w\b_rite command writes the addressed lines onto
+the given file.
+If the file does not exist,
+it is created mode 17 (readable and writeable by everyone).
+The remembered file name is not\b\b\b___ changed unless
+"filename" is the very first file name mentioned.
+If no file name is given,
+the remembered file name, if any, is used (see e\b_ and f\b_ commands).
+"." is unchanged.
+If the command is successful, the number of characters written is
+typed.
+
+.ti -3
+($)=
+.br
+The line number of the addressed line is typed.
+"." is unchanged by this command.
+
+.ti -3
+!UNIX command
+.br
+The remainder of the line after the "!" is sent
+to UNIX to be interpreted as a command.
+"." is unchanged.
+
+.ti -3
+(.+1)<newline>
+.br
+An address alone on a line causes that line to be printed.
+A blank line alone is equivalent to ".+1p"; it is useful
+for stepping through text.
+
+.in -6
+If an interrupt signal (ASCII DEL) is sent,
+ed\b\b__ will print a "?" and return to its command level.
+
+If invoked with the command name '-', (see init\b\b\b\b____)
+ed\b\b__ will sign on with the message "Editing system"
+and print "*" as the command level prompt character.
+.sp
+Ed\b\b__ has size limitations on the maximum number of lines that can be edited,
+and on the maximum number of characters in a line,
+in a global's command list,
+and in a remembered file name.
+These limitations vary with the physical core size of the PDP11 computer
+on which ed\b\b__ is being used.
+The range of limiting sizes
+for the above mentioned items is;
+1300|-|4000 lines per file,
+256|-|512 characters per line,
+63|-|256 characters per global command list,
+and
+64 characters per file name.
+.sp
+.ti 0
+.in +8
+FILES
+.br
+/tmp/etm?      temporary
+.br
+/etc/msh       to implement the "!" command.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "?" for any error
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/exit.1 b/man/man1/exit.1
new file mode 100644 (file)
index 0000000..970eacd
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'EXIT(I)'3/15/72'EXIT(I)'
+.ti 0
+NAME           exit  --  terminate command file
+.sp
+.ti 0
+SYNOPSIS       exit\b\b\b\b____
+.sp
+.ti 0
+DESCRIPTION    exit\b\b\b\b____
+performs a seek\b\b\b\b____ to the end of its standard input file.
+Thus, if it is invoked inside
+a file of commands, upon return from exit\b\b\b\b____ the shell will
+discover an end-of-file and terminate.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       if(I), goto(I), sh(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/factor.1 b/man/man1/factor.1
new file mode 100644 (file)
index 0000000..fb1aa2a
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'FACTOR (I)'1/15/73'FACTOR (I)'
+.ti 0
+NAME           factor -- discover prime factors of a number
+.sp
+.ti 0
+SYNOPSIS       factor\b\b\b\b\b\b______
+.sp
+.ti 0
+DESCRIPTION    When factor is invoked, it types
+out "Enter:" at you.  If you type in a positive
+number less than 2^56 (about 7.2E16), it will repeat the number
+back at you and then its prime factors each one printed
+the proper number of times.  Then it says "Enter:" again.
+To exit, feed it an EOT or a delete.
+.sp
+Maximum time to factor is proportional to sqrt(n) and occurs
+when n is prime.  It takes 1 minute to factor a prime near 10^13.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "Ouch." for input out of range or for garbage input.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/fc.1 b/man/man1/fc.1
new file mode 100644 (file)
index 0000000..5c33f61
--- /dev/null
@@ -0,0 +1,292 @@
+.pa 1
+.he 'FC (I)'9/1/72'FC (I)'
+.ti 0
+NAME           fc -- fortran compiler
+.sp
+.ti 0
+SYNOPSIS       fc\b\b__ [ -c\b\b__ ] sfile\d1\u.f\b\b__ ... ofile\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    fc\b\b__
+is the UNIX Fortran compiler.
+It accepts three types of arguments:
+
+Arguments whose names end with ".f" are assumed to be
+Fortran source program units; they are compiled, and
+the object program is left on the file sfile\d1\u.o (i.e.
+the file whose name is that of the source with ".o" substituted
+for ".f").
+
+Other arguments (except for "-c") are assumed
+to be either loader flags, or
+object programs, typically produced by an earlier fc\b\b__ run,
+or perhaps libraries of Fortran-compatible routines.
+These programs, together with the results of any
+compilations specified, are loaded (in the order
+given) to produce an executable program with name
+a.out\b\b\b\b\b_____.
+
+The "-c" argument suppresses the loading phase, as does
+any syntax error in any of the routines being compiled.
+
+The following is a list
+of differences between fc\b\b__
+and ANSI standard Fortran (also see the BUGS section):
+.sp
+.in +3
+.ti -3
+1. Arbitrary combination of types is allowed
+in expressions.  Not all combinations are expected to
+be supported at runtime.
+All of the normal
+conversions involving integer, real, double
+precision and complex are allowed.
+.sp
+.ti -3
+2. The 'standard' implicit statement is recognized.
+.sp
+.ti -3
+3. The types
+doublecomplex, logical*1,
+integer*2 and real*8 (doubleprecision)
+are supported.
+.sp
+.ti -3
+4. &\b_ as the first character of a line
+signals a continuation card.
+.sp
+.ti -3
+5. c\b_ as the first character of a line signals a comment.
+.sp
+.ti -3
+6. All keywords are recognized in lower case.
+.sp
+.ti -3
+7. The notion of 'column 7' is not implemented.
+
+.ti -3
+8. G-format input is free form--
+leading blanks are ignored, the first blank after the start
+of the number terminates the field.
+
+.ti -3
+9. A comma in any numeric or logical input field terminates
+the field.
+
+.ti -4
+10. There is no carriage control on output.
+.sp
+.in -3
+In I/O statements, only unit numbers 0-19 are supported.
+Unit number nn\b\b__ corresponds to file "fortnn\b\b__;"
+(e.g. unit 9 is file "fort09").
+For input, the file must exist;
+for output, it will be created.
+
+Unit 5 is permanently associated with
+the standard input file; unit 6 with the
+standard output file.
+.sp
+.ti 0
+FILES          file.f                  input file
+.nf
+a.out                  loaded output
+f.tmp[123]             temporary (deleted)
+/usr/fort/fc[1234]     compilation phases
+/usr/lib/fr0.o         runtime startoff
+/usr/lib/filib.a       interpreter library
+/usr/lib/libf.a                builtin functions, etc.
+/usr/lib/liba.a                system library
+.fi
+.sp
+.ti 0
+SEE ALSO       ANSI standard
+.sp
+.ti 0
+DIAGNOSTICS    Compile-time diagnostics
+are given by number.
+If the source code is available, it is
+printed with an underline at the current
+character pointer.
+Errors possible are:
+
+.in +8
+.ti -8
+1      statement too long
+.ti -8
+2      syntax error in type statement
+.ti -8
+3      redeclaration
+.ti -8
+4      missing ( in array declarator
+.ti -8
+5      syntax error in dimension statement
+.ti -8
+6      inappropriate or gratuitous array declarator
+.ti -8
+7      syntax error in subscript bound
+.ti -8
+8      illegal character
+.ti -8
+9      common variable is a parameter or already in common
+.ti -8
+10     common syntax error
+.ti -8
+11     subroutine/blockdata/function not first statement
+.ti -8
+12     subroutine/function syntax error
+.ti -8
+13     block data syntax error
+.ti -8
+14     redeclaration in external
+.ti -8
+15     external syntax error
+.ti -8
+16     implicit syntax error
+.ti -8
+17     subscript on non-array
+.ti -8
+18     incorrect subscript count
+.ti -8
+19     subscript out of range
+.ti -8
+20     subscript syntax error
+.ti -8
+22     DATA syntax error
+.ti -8
+23     Illegal variable in DATA
+.ti -8
+23     equivalence inconsistency
+.ti -8
+24     equivalence syntax error
+.ti -8
+25     separate common blocks equivalenced
+.ti -8
+26     common block illegally extended by equivalence
+.ti -8
+27     common inconsistency created by equivalence
+.ti -8
+28     DATA table overflow
+.ti -8
+29     () imbalance in expression
+.ti -8
+30     expression syntax error
+.ti -8
+31     illegal variable in equivalence
+.ti -8
+32     Storage initialized twice by DATA
+.ti -8
+33     non array/function used with subscripts/arguments
+.ti -8
+35     goto syntax error
+.ti -8
+37     illegal return
+.ti -8
+38     continue, return, stop, call, end, or pause syntax error
+.ti -8
+39     assign syntax error
+.ti -8
+40     if syntax error
+.ti -8
+41     I/O syntax error
+.ti -8
+42     do or I/O iteration error
+.ti -8
+43     do end missing
+.ti -8
+50     illegal statement in block data
+.ti -8
+51     multiply defined labels
+.ti -8
+52     undefined label
+.ti -8
+53     dimension mismatch
+.ti -8
+54     expression syntax error
+.ti -8
+55     end of statement in hollerith constant
+.ti -8
+56     array too large
+.ti -8
+99     \ eB\ f table overflow
+.ti -8
+101    unrecognized statement
+.ti -8
+
+.ti -8
+Runtime diagnostics:
+.ti -8
+
+.ti -8
+1      invalid log argument
+.ti -8
+2      bad arg count to amod
+.ti -8
+3      bad arg count to atan2
+.ti -8
+4      excessive argument to cabs
+.ti -8
+5      exp too large in cexp
+.ti -8
+6      bad arg count to cmplx
+.ti -8
+7      bad arg count to dim
+.ti -8
+8      excessive argument to exp
+.ti -8
+9      bad arg count to idim
+.ti -8
+10     bad arg count to isign
+.ti -8
+11     bad arg count to mod
+.ti -8
+12     bad arg count to sign
+.ti -8
+13     illegal argument to sqrt
+.ti -8
+14     assigned/computed goto out of range
+.ti -8
+15     subscript out of range
+.ti -8
+16     real**real overflow
+
+.ti -8
+100    illegal I/O unit number
+.ti -8
+101    inconsistent use of I/O unit
+.ti -8
+102    cannot create output file
+.ti -8
+103    cannot open input file
+.ti -8
+104    EOF on input file
+.ti -8
+105    illegal character in format
+.ti -8
+106    format does not begin with (
+.ti -8
+107    no conversion in format but non-empty list
+.ti -8
+108    excessive parenthesis depth in format
+.ti -8
+109    illegal format specification
+.ti -8
+110    illegal character in input field
+.ti -8
+111    end of format in hollerith specification
+.ti -8
+999    unimplemented input conversion
+.sp
+.in -8
+.ti 0
+BUGS           The following is a list of
+those features not yet implemented:
+.sp
+.br
+arithmetic statement functions
+
+backspace, endfile, rewind runtime
+
+binary I/O
+
+no scale factors on input
diff --git a/man/man1/fed.1 b/man/man1/fed.1
new file mode 100644 (file)
index 0000000..1741359
--- /dev/null
@@ -0,0 +1,127 @@
+.pa 1
+.he 'FED (I)'1/15/73'FED (I)'
+.ti 0
+NAME
+.br
+fed -- edit associative memory for form letter
+.sp
+.ti 0
+SYNOPSIS
+.br
+fe\b\b__d\b_
+.sp
+.ti 0
+DESCRIPTION
+.br
+fed\b\b\b___ is used to edit a form letter associative memory
+file, form.m, which consists of named strings.
+Commands consist of single letters followed by a list of
+string names separated by a single space and ending with a
+new line.
+The conventions of the Shell with respect to '*' and '?' hold for
+all commands but m\b_ where literal string names are expected.
+The commands are:
+
+.in +5
+.ti -5
+e name\e91\e8 ...
+
+e\b_dit writes the string whose name is name\e91\e8 onto a temporary file
+and executes the system editor ed\b\b__.  On exit from the system
+editor the temporary file is copied back into the associative
+memory.  Each argument is operated on separately.  The sequence of
+commands to add the string from 'file' to memory with name
+'newname' is as follows:
+
+       e newname
+       0       (printed by ed)
+       r file
+       200
+       w
+       200
+       q       (get out of ed)
+       q       (get out of fe)
+
+To dump a string onto a file:
+
+       e name
+       200     (printed by ed)
+       w filename
+       200
+       q       (get out of ed)
+       q       (get out of fe)
+.sp2
+.ti -5
+d [ name\e91\e8 ... ]
+
+d\b_eletes a string and its name from the memory.  When called with
+no arguments d\b_ operates in a verbose mode typing each string
+name and deleting only if a 'y' is typed.  A 'q' response returns
+to fed's command level.  Any other response does nothing.
+.sp 2
+.ti -5
+m name\e91\e8 name\e92\e8 ...
+
+(m\b_ove) changes the name of name\e91\e8 to name\e92\e8 and removes previous
+string name\e92\e8 if one exists.  Several pairs of arguments may be given.
+.sp 2
+.ti -5
+n [ name\e91\e8 ... ]
+
+(n\b_ames) lists the string names in the memory.  If called with
+the optional arguments, it just lists those requested.
+.sp 2
+.ti -5
+p name\e91\e8 ...
+
+p\b_rints the contents of the strings with names given by the arguments.
+.sp 2
+.ti -5
+q
+(q\b_uit) returns to the system.
+.sp 2
+.ti -5
+c [ p\b_ ] [ f\b_ ]
+
+c\b_hecks the associative memory file for consistency
+and reports the number of free headers and blocks.
+The optional arguments do the following:
+.sp
+.in +5
+.ti -2
+p causes any unaccounted for string to be 
+printed
+
+.ti -2
+f fixes broken memories by adding 
+unaccounted-for headers to free
+storage and removing references to
+released headers from associative
+memory.
+.in -5
+.sp
+.sp
+.in -5
+.ti 0
+FILES          /tmp/ftmp?      temporary
+.br
+form.m associative memory
+.sp
+.ti 0
+SEE ALSO       form(I), ed(I), sh(I)
+.sp
+.ti 0
+DIAGNOSTICS    '?' unknown command
+.br
+'Cannot open temp. file'-- cannot create a temporary file for ed command
+.br
+'name not in memory.' if string 'name' is not in the associative
+memory and is used as an argument for d\b_ or m\b_.
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+WARNING                It
+is legal but an unwise idea to have string names
+with blanks, ":" or "?" in them.
diff --git a/man/man1/form.1 b/man/man1/form.1
new file mode 100644 (file)
index 0000000..4087d53
--- /dev/null
@@ -0,0 +1,84 @@
+.pa 1
+.he 'FORM (I)'6/15/72'FORM (I)'
+.ti 0
+NAME
+.br
+form -- form letter generator
+.sp
+.ti 0
+SYNOPSIS
+.br
+form\b\b\b\b____ proto arg\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION
+.br
+form\b\b\b\b____ generates a form letter from a prototype
+letter, an associative memory, arguments and in a special case, the
+current date.
+.sp
+If form\b\b\b\b____ is invoked with the proto\b\b\b\b\b_____ argument 'x', the associative memory is
+searched for an entry with name 'x' and the contents filed under that name are
+used as the prototype.  If the search fails, the message "[x]:" is typed on
+the console and whatever text is typed in from the console, terminated by
+two new lines, is used as the prototype.
+.sp
+If the prototype argument is missing, '{letter}' is assumed.
+.sp
+Basically, form\b\b\b\b____ is a copy process from the prototype to the output file.
+If an element of the form [n] (where n\b_ is a digit from 1 to 9) is encountered,
+the n\b_th argument arg\b\b\b___\e9n\e8 is inserted in its place, and that argument is then
+rescanned.  If [0] is encountered, the current date is inserted.  If
+the desired argument has not been given, a message of the form "[n]:" is
+typed.  The response typed in then is used for that argument.
+.sp
+If an element of the form [name] or {name} is encountered, the name is looked up in the
+associative memory.  If it is found, the contents of the memory under this
+name replaces the original element (again rescanned).  If
+the name is not found, a message of the form "[name]:" is typed.
+The response typed in is used for that element.  The response is
+entered in the memory under the name if the name is enclosed in [].
+The response is not entered in the memory but is remembered for the
+duration of the letter if the name is enclosed in {}.
+.sp
+In both of the above cases, the response is typed in by entering
+arbitrary text terminated by two new lines.  Only the first of the
+two new lines is passed with the text.
+.sp
+If one of the special characters [{]}\\ is preceded by
+a \\, it loses its special character.
+.sp
+If a file named "forma" already exists in the users directory, "formb" is
+used as the output file and so forth to "formz".
+.sp
+The file "form.m" is created if none exists.  Because form.m is
+operated on by the disc allocater, it should only be changed by using
+fed\b\b\b___, the form letter editor, or form\b\b\b\b____.
+.sp
+.fi
+.ti 0
+FILES
+.br
+form.m associative memory
+.br
+form?  output file (read only)
+.sp
+.fi
+.ti 0
+SEE ALSO
+.br
+fed(I), type(I), roff(I)
+.sp
+.fi
+.ti 0
+DIAGNOSTICS
+.br
+"cannot open output file" "cannot open memory file"
+when the appropriate files cannot be located or created.
+.sp
+.fi
+.ti 0
+BUGS
+.br
+An unbalanced ] or } acts as an end of file but
+may add a few strange entries to the associative memory.
diff --git a/man/man1/forml.1 b/man/man1/forml.1
new file mode 100644 (file)
index 0000000..092553b
--- /dev/null
@@ -0,0 +1,50 @@
+.pa 1
+.he 'FORML (I)'10/24/72'FORML (I)'
+.ti 0
+NAME           forml -- form letter generator processor
+.sp
+.ti 0
+SYNOPSIS       forml\b\b\b\b\b_____ [ name ] ...
+.sp
+.ti0
+DESCRIPTION    A streamlined program for typing form letters.
+The names pick out
+prestored form letters prepared according to the conventions
+of
+.ul
+form
+and
+.ul
+roff.
+The program prompts to get each blank
+filled in.
+When all the forms are completed, it prompts "Set paper."
+It waits for a newline before printing each letter.
+
+If more than one name is given, the name of 
+each letter is announced
+before the prompts for it begin.
+If no names are given, the program asks "Which letter?" before
+each.
+Respond with the name and a newline, or newline only when done.
+.sp
+On a 2741 type terminal, the program assumes the
+letter is to be typed with a correspondence ball,
+and also prompts "Change ball."
+Replace the ball at the end.
+.sp
+.ti0
+FILES          form.m (memory),
+.br
+forma, formb, ... temporaries
+.sp
+.ti0
+SEE ALSO       form(I), fed(I), roff(I)
+.br
+.sp
+.ti0
+DIAGNOSTICS    "Try again"--can't get a process
+.br
+.sp
+.ti0
+BUGS           --
diff --git a/man/man1/goto.1 b/man/man1/goto.1
new file mode 100644 (file)
index 0000000..64feea7
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he 'GOTO (I)'3/15/72'GOTO (I)'
+.ti 0
+NAME           goto  --  command transfer
+.sp
+.ti 0
+SYNOPSIS       goto\b\b\b\b____ label
+.sp
+.ti 0
+DESCRIPTION    goto\b\b\b\b____
+is only allowed when the Shell
+is taking commands from a file.
+The file is searched (from the beginning)
+for a line beginning with ":" followed by one
+or more spaces followed by
+the label\b\b\b\b\b_____.
+If such a line is found, the goto\b\b\b\b____ command returns.
+Since the read pointer in the command file points to the
+line after the label,
+the effect is to cause the Shell to transfer to the
+labelled line.
+
+":" is a do-nothing
+command that only serves to place a label.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sh(I), :(I)
+.sp
+.ti 0
+DIAGNOSTICS    "goto error", if
+the input file is a typewriter; "label not found".
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/hyphen.1 b/man/man1/hyphen.1
new file mode 100644 (file)
index 0000000..77daab2
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'HYPHEN (I)'1/15/73'HYPHEN (I)'
+.ti 0
+NAME           hyphen -- find hyphenated words
+.sp
+.ti 0
+SYNOPSIS       hyphen\b\b\b\b\b\b______ file\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    It finds all of the words in a
+document which are hyphenated across lines
+and prints them back at you in a convenient format.
+
+If no arguments are given, the standard output
+is used.
+Thus hyphen\b\b\b\b\b\b______ may be used as a filter.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    yes
+.sp
+.ti 0
+BUGS           yes, it gets confused, but with no ill effects other than
+spurious extra output.
diff --git a/man/man1/if.1 b/man/man1/if.1
new file mode 100644 (file)
index 0000000..917ec74
--- /dev/null
@@ -0,0 +1,76 @@
+.pa 1
+.he 'IF (I)'3/15/72'IF (I)'
+.ti 0
+NAME           if --  conditional command
+.sp
+.ti 0
+SYNOPSIS       if\b\b__ expr command [ arg\e91\e8 ... ]
+.sp
+.ti 0
+DESCRIPTION    if\b\b__
+evaluates the expression expr\b\b\b\b____, and if its value is true\b\b\b\b____,
+executes the given command\b\b\b\b\b\b\b_______ with the given arguments.
+
+The following primitives are used to construct
+the expr\b\b\b\b____:
+
+.in +9
+.ti -4
+-r\b\b__ file
+.br
+true if the file exists and is readable.
+
+.ti -4
+-w\b\b__ file
+.br
+true if the file exists and is writable
+
+.ti -4
+s1 =\b_ s2
+.br
+true if the strings s1\b\b__ and s2\b\b__ are equal.
+
+.ti -4
+s1 !=\b\b__ s2
+.br
+true if the strings s1\b\b__ and s2\b\b__ are not equal.
+
+.in -9
+These primaries may be combined with the
+following operators:
+
+.in +5
+!\b_
+.ti +4
+unary negation operator
+
+-a\b\b__
+.ti +4
+binary and\b\b\b___ operator
+
+-o\b\b__
+.ti +4
+binary or\b\b__ operator
+
+(\b_ expr )\b_
+.ti +4
+parentheses for grouping.
+
+.in -5
+-a\b\b__ has higher precedence than -o\b\b__.
+Notice that all the operators and flags are separate
+arguments to if\b\b__ and hence must be surrounded by spaces.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sh(I)
+.sp
+.ti 0
+DIAGNOSTICS    "if error",
+if the expression has the wrong syntax;
+"command not found."
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/ld.1 b/man/man1/ld.1
new file mode 100644 (file)
index 0000000..1347d1b
--- /dev/null
@@ -0,0 +1,111 @@
+.pa 1
+.he 'LD (I)'3/15/72'LD (I)'
+.ti 0
+NAME           ld  --  link editor
+.sp
+.ti 0
+SYNOPSIS       ld\b\b__ [ -sulxr\b\b\b\b\b\b______ ] name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    ld\b\b__  combines several
+object programs into one; resolves external
+references; and searches libraries.
+In the simplest case the names of several object
+programs are given, and ld\b\b__ combines them, producing
+an object module which can be either executed or
+become the input for a further ld\b\b__ run.
+In the latter case, the "-r" option must be given
+to preserve the relocation bits.
+.sp
+The argument routines are concatenated in the order
+specified.  The entry point of the output is the
+beginning of the first routine.
+.sp
+If any argument is a library, it is searched exactly once.
+Only those routines defining an unresolved external
+reference are loaded.
+If a routine from a library
+references another routine in the library,
+the referenced routine must appear after the
+referencing routine in the library.
+Thus the order of programs within libraries
+is important.
+.sp
+ld\b\b__ understands several flag arguments which are written
+preceded by a "-":
+.sp
+.in +6
+.ti -3
+-s "squash" the output, that is, remove the symbol table
+and relocation bits to save space (but impair the
+usefulness of the debugger).
+This information can also be removed by strip\b\b\b\b\b_____.
+.ti -3
+.sp
+-u take the following argument as a symbol and enter
+it as undefined in the symbol table.  This is useful
+for loading wholly from a library, since initially the symbol
+table is empty and an unresolved reference is needed
+to force the loading of the first routine.
+.sp
+.ti -3
+-l This option is an abbreviation for a library name.
+"-l" alone stands for "/usr/lib/liba.a", which
+is the standard system library for assembly language
+programs.
+"-lx" stands for "/usr/lib/libx.a" where x is any character.
+There are libraries for Fortran (x="f"), C (x="c"), Explor (x="e") and B (x="b").
+
+.ti -3
+-x Do not preserve local
+(non-.globl) symbols in the output symbol table; only enter
+external symbols.
+This option saves some space in the output file.
+
+.ti -3
+-r generate relocation bits in the output file
+so that it can be the subject of another ld\b\b__ run.
+.sp
+.in -6
+The output of ld\b\b__ is left on a.out\b\b\b\b\b_____.  This file is executable
+only if no errors occurred during the load.
+.sp
+.ti 0
+FILES          /usr/lib/lib?.a libraries
+.br
+a.out  output file
+.sp
+.ti 0
+SEE ALSO       as(I), ar(I)
+.sp
+.ti 0
+DIAGNOSTICS    "file
+not found"-- bad argument
+.sp
+"bad format"-- bad argument
+.sp
+"relocation error"-- bad argument (relocation
+bits corrupted)
+.sp
+"multiply defined"-- same symbol defined twice in same load
+.sp
+"un"-- stands for "undefined symbol"
+
+"symbol not found"--  loader bug
+
+"can't move output file"-- can't move temporary to a.out file
+
+"no relocation bits"-- an input file lacks relocation information
+
+"too many symbols"-- too many references to external
+symbols in a given routine
+
+"premature EOF"
+
+"can't create l.out"-- cannot make temporary file
+
+"multiple entry point"-- more than one entry point
+specified (not possible yet).
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/ln.1 b/man/man1/ln.1
new file mode 100644 (file)
index 0000000..80c55e9
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'LN (I)'3/15/72'LN (I)'
+.ti 0
+NAME           ln  --  make a link
+.sp
+.ti 0
+SYNOPSIS       ln\b\b__ name\d1\u [ name\d2\u ] 
+.sp
+.ti 0
+DESCRIPTION    ln\b\b__ creates a link to an existing file name\d1\u.
+If name\d2\u is given, the link has that name;
+otherwise it is placed in the current directory
+and its name is the last component
+of name\d1\u.
+.sp
+It is forbidden to link to a directory
+or to link across file systems.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       rm(I)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           There is nothing particularly
+wrong with ln\b\b__, but links don't work right with respect
+to the backup system:  one copy is backed up for each link, and
+(more serious) in case of a file system reload
+both copies are restored and the information that a link was involved
+is lost.
diff --git a/man/man1/login.1 b/man/man1/login.1
new file mode 100644 (file)
index 0000000..d979e08
--- /dev/null
@@ -0,0 +1,54 @@
+.pa 1
+.he 'LOGIN (I)'3/15/72'LOGIN (I)'
+.ti 0
+NAME           login  --  sign onto UNIX
+.sp
+.ti 0
+SYNOPSIS       login\b\b\b\b\b_____  [ username [ password ] ]
+.sp
+.ti 0
+DESCRIPTION    The login\b\b\b\b\b_____ command
+is used when a user initially
+signs onto UNIX, or it may be used at any time to change
+from one user to another.
+The latter case is the one summarized above and
+described here.
+See login\b\b\b\b\b_____ (VII) for how to dial up initially.
+
+If login\b\b\b\b\b_____ is invoked without an argument,
+it will ask for a user name, and, if
+appropriate, a password.
+Echoing is turned off (if possible) during the typing of the password,
+so it will not appear on the written record of the
+session.
+.sp
+After a successful login,
+accounting files are updated and
+the user is informed of the
+existence of mailbox
+and message-of-the-day files.
+
+Login is recognized by the Shell
+and executed directly (without forking).
+.sp
+.ti 0
+FILES          /tmp/utmp       accounting
+.br
+/tmp/wtmp      accounting
+.br
+mailbox                mail
+.br
+/etc/motd      message-of-the-day
+/etc/passwd    password file
+.sp
+.ti 0
+SEE ALSO       login(VII), init(VII), getty(VII), mail(I)
+.sp
+.ti 0
+DIAGNOSTICS    "login incorrect",
+if the name or the password is bad.
+"No Shell,", "cannot open password file," "no directory:"
+consult a UNIX programming councilor.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/ls.1 b/man/man1/ls.1
new file mode 100644 (file)
index 0000000..da3548d
--- /dev/null
@@ -0,0 +1,52 @@
+.pa 1
+.he 'LS (I)'3/15/72'LS (I)'
+.ti 0
+NAME           ls  --  list contents of directory
+.sp
+.ti 0
+SYNOPSIS       ls\b\b__ [ -\b_ltasd\b\b\b\b\b_____ ] name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    ls\b\b__
+lists the contents of one or more directories under
+control of several options:
+.sp
+.in +5
+.ti -3
+-l list in l\b_ong format, giving i-number, mode, owner,
+size in bytes, and time of last modification
+for each file.
+(see stat\b\b\b\b____ for format of the mode)
+
+.ti -3
+-t sort by time modified (latest first) instead of
+by name, as is normal
+
+.ti -3
+-a list all entries; usually those beginning with "." are
+suppressed
+
+.ti -3
+-s give size in blocks for each entry
+
+.ti -3
+-d if argument is a directory, list only its name, not
+its contents (mostly used with "-l" to get status
+on directory)
+.sp
+.in -5
+If no argument is given, "." is listed.
+If an argument is not a directory, its name is given.
+.sp
+.ti 0
+FILES          /etc/passwd to get user ID's for ls -l
+.sp
+.ti 0
+SEE ALSO       stat(I)
+.sp
+.ti 0
+DIAGNOSTICS    "name
+nonexistent"; "name unreadable"; "name unstatable."
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/m6.1 b/man/man1/m6.1
new file mode 100644 (file)
index 0000000..e36d103
--- /dev/null
@@ -0,0 +1,109 @@
+.pa 1
+.he 'M6 (I)'11/15/72'M6 (I)'
+.ti 0
+NAME           m6 -- general purpose macro processor
+.sp
+.ti 0
+SYNOPSIS       m6\b\b__
+[ -d\b\b__ arg1 ] [ arg2 [ arg3 ] ]
+.sp
+.ti 0
+DESCRIPTION    m6\b\b__
+takes input from file arg2 (or standard input if arg2 is missing)
+and places output on file arg3 (or standard output).
+A working file of definitions, "m.def",
+is initialized from  file arg1 if that is supplied.
+M6 differs from the standard [1] in these
+respects:
+.sp
+#trace:, #source: and #end:
+are not defined.
+.sp
+#meta,arg1,arg2: transfers the role of metacharacter
+arg1 to character arg2. If two metacharacters become identical
+thereby, the outcome of further processing is not guaranteed.
+For example, to make []{} play the
+roles of #:<> type
+.sp
+.in+5
+\\\#meta,<\\\#>,[:
+.br
+[meta,<:>,]:
+.br
+[meta,[substr,<<>>,1,1;,{]
+.br
+[meta,[substr,{{>>,2,1;,}]
+.in-5
+.sp
+#del,arg1: deletes the definition of macro arg1.
+.sp
+#save: and #rest: save and restore the definition table together with
+the current metacharacters on file
+m.def.
+.sp
+#def,arg1,arg2,arg3: works as in the standard with the extension
+that an integer may be
+supplied to arg3 to cause the new macro to perform the
+action of a specified builtin before its replacement text is evaluated.
+Thus all builtins
+except #def: can be retrieved even after deletion.
+Codes for arg3 are:
+.sp
+.in+5
+.nf
+0 - no function
+1,2,3,4,5,6 - gt,eq,ge,lt,ne,le
+7,8 - seq,sne
+9,10,11,12,13 - add,sub,mpy,div,exp
+20 - if
+21,22 - def,copy
+23 - meta
+24 - size
+25 - substr
+26,27 - go,gobk
+28 - del
+29 - dnl
+30,31 - save,rest
+.fi
+.in-5
+.sp
+.ti 0
+FILES          m.def--working file of definitions
+.br
+/usr/lang/mdir/m6a--m6 processor proper (/usr/bin/m6 is only an initializer)
+.br
+/usr/lang/mdir/m6b--default initialization for m.def
+.br
+/bin/cp--used for copying initial value of m.def
+.sp
+.ti 0
+SEE ALSO       [1] A. D. Hall,
+The M6 Macroprocessor, Bell Telephone Laboratories, 1969
+.sp
+.ti 0
+DIAGNOSTICS    "err"
+-- a bug, an unknown builtin or a bad definition table
+.br
+"oprd"--can't open input or initial definitions
+.br
+"opwr"--can't open output
+.br
+"ova" -- overflow of nested arguments
+.br
+"ovc" -- overflow of calls
+.br
+"ovd" -- overflow of definitions
+.br
+"Try again" -- no process available for copying m.def
+.br
+.sp
+.ti 0
+BUGS           Characters in internal tables are stored
+one per word.
+They really should be packed to improve capacity.
+For want of space (and because of unpacked formats) no file arguments
+have been provided to #save: or #rest:,
+and no check is made on the actual opening of file m.def.
+Again to save space,
+garbage collection makes calls on #save: and #rest: and so overwrites
+m.def.
diff --git a/man/man1/mail.1 b/man/man1/mail.1
new file mode 100644 (file)
index 0000000..6b00d12
--- /dev/null
@@ -0,0 +1,58 @@
+.pa 1
+.he 'MAIL (I)'10/25/72'MAIL (I)'
+.ti 0
+NAME           mail  --  send mail to another user
+.sp
+.ti 0
+SYNOPSIS       mail\b\b\b\b____ [ -yn\b\b\b___ ]
+.br
+.ul
+mail
+letter person ...
+.br
+mail\b\b\b\b____ person
+.sp
+.ti 0
+DESCRIPTION    mail\b\b\b\b____
+without an argument searches for a file called mailbox\b\b\b\b\b\b\b_______, prints
+it if present, and asks if it should be saved.  If the answer
+is "y", the mail is renamed mbox\b\b\b\b____, otherwise it is deleted.
+Mail\b\b\b\b____ with a -yn\b\b\b___ argument works the same way, except
+that the answer to the question is supplied by the argument.
+.sp
+When followed by the names of a letter
+and one or more people,
+the letter is appended to
+each person's mailbox\b\b\b\b\b\b\b_______.
+When a person\b\b\b\b\b\b______ is specified without a letter\b\b\b\b\b\b______,
+the letter is taken from the sender's standard input up to an EOT.
+Each letter is preceded by the sender's name and a postmark.
+
+A person\b\b\b\b\b\b______ is either
+a user name recognized by login\b\b\b\b\b_____, in which case the mail
+is sent to the default working directory of that user,
+or the path name of a directory,
+in which case mailbox\b\b\b\b\b\b\b_______ in that directory is used.
+.sp
+When a user logs in he is informed of the presence
+of mail.
+.sp
+.ti 0
+FILES          /etc/passwd     to identify sender
+.br
+               to locate persons
+.br
+mailbox                input mail
+.br
+mbox           saved mail
+.sp
+.ti 0
+SEE ALSO       login(I)
+.sp
+.ti 0
+DIAGNOSTICS    "Who are you?"
+if the user cannot be identified for some reason (a bug).
+"Cannot send to user" if mailbox\b\b\b\b\b\b\b_______ cannot be opened.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/man.1 b/man/man1/man.1
new file mode 100644 (file)
index 0000000..dec4ecc
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'MAN (I)'3/15/72'MAN (I)'
+.ti 0
+NAME           man -- run off section of UNIX manual
+.sp
+.ti 0
+SYNOPSIS       man\b\b\b___ title [ section ]
+.sp
+.ti 0
+DESCRIPTION    man\b\b\b___
+is a shell command file that will locate
+and run off a particular section of this manual.
+Title is the the desired
+part of the manual.
+Section is the section number of the manual.
+(In Arabic, not Roman numerals.)
+If section is missing, 1\b_ is assumed.
+For example,
+
+       man man
+
+would reproduce this page.
+.sp
+.ti 0
+FILES          /sys/man/man?/*
+.sp
+.ti 0
+SEE ALSO       sh(I), roff(I)
+.sp
+.ti 0
+DIAGNOSTICS    "File not found", "Usage .."
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/mesg.1 b/man/man1/mesg.1
new file mode 100644 (file)
index 0000000..880ab13
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'MESG (I)'3/15/72'MESG (I)'
+.ti 0
+NAME           mesg  --  permit or deny messages
+.sp
+.ti 0
+SYNOPSIS       mesg\b\b\b\b____ [ n\b_ ][ y\b_ ]
+.sp
+.ti 0
+DESCRIPTION    mesg\b\b\b\b____ n\b_
+forbids messages via write\b\b\b\b\b_____ by revoking non-user
+write permission on the user's typewriter.
+mesg\b\b\b\b____ y\b_ reinstates permission.
+mesg\b\b\b\b____ with no argument reverses the current permission.
+In all cases the previous state is reported.
+.sp
+.ti 0
+FILES          /dev/tty?
+.sp
+.ti 0
+SEE ALSO       write(I)
+.sp
+.ti 0
+DIAGNOSTICS    "?" if the standard input file is not a typewriter
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/mkdir.1 b/man/man1/mkdir.1
new file mode 100644 (file)
index 0000000..7c15981
--- /dev/null
@@ -0,0 +1,25 @@
+.pa 1
+.he 'MKDIR (I)'3/15/72'MKDIR (I)'
+.ti 0
+NAME           mkdir  --  make a directory
+.sp
+.ti 0
+SYNOPSIS       mkdir\b\b\b\b\b_____ dirname ...
+.sp
+.ti 0
+DESCRIPTION    mkdir\b\b\b\b\b_____ creates specified directories
+in mode 17.
+.sp
+The standard entries "." and ".." are made automatically.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       rmdir(I)
+.sp
+.ti 0
+DIAGNOSTICS    "dirname ?"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/mt.1 b/man/man1/mt.1
new file mode 100644 (file)
index 0000000..e01ec0c
--- /dev/null
@@ -0,0 +1,124 @@
+.pa 1
+.he 'MT (I)'6/12/72'MT (I)'
+.ti 0
+NAME           mt  --  manipulate magtape
+.sp
+.ti 0
+SYNOPSIS       mt\b\b__  [ key ] [ name ... ]
+.sp
+.ti 0
+DESCRIPTION    mt\b\b__
+saves and restores selected portions of the file system
+hierarchy on magtape.
+Its actions are controlled by the key\b\b\b___ argument.
+The key is a string of characters containing
+at most one function letter and possibly
+one or more function modifiers.
+Other arguments to the command are file or directory
+names specifying which files are to be dumped, restored,
+or tabled.
+
+The function portion of
+the key is specified by one of the following letters:
+
+.in +6
+.ti -3
+r  The indicated files and directories, together with
+all subdirectories, are dumped
+onto the tape.
+The old contents of the tape are lost.
+
+.ti -3
+x  extracts the named files from the tape to the file system.
+The owner, mode, and date-modified are restored to what they
+were when the file was dumped.
+If no file argument is given, the entire contents of the
+tape are extracted.
+
+.ti -3
+t  lists the names of all files stored on the tape which
+are the same as or are hierarchically below
+the file arguments.  If no file argument is given,
+the entire contents of the tape are tabled.
+
+.ti -3
+l  is the same as t\b_ except that an expanded listing
+is produced giving all the available information about the
+listed files.
+
+.in -6
+The following characters may be used in addition to the letter
+which selects the function desired.
+
+.in +6
+.ti -3
+0, ..., 7  This modifier selects the drive on which the tape is mounted.
+"0" is the default.
+
+.ti -3
+v  Normally mt\b\b__ does its work silently.  The v\b_ (verbose)
+option causes it to type the name of each file it treats
+preceded by a letter to indicate what is happening.
+
+.in +2
+ a  file is being added
+ x  file is being extracted
+
+.in -2
+The v\b_ option can be used with r\b_ and x\b_ only.
+
+.ti -3
+f  causes
+new entries copied on tape to be 'fake' in that
+only the entries, not the data associated
+with the entries are updated.
+Such fake entries cannot be extracted.
+Usable only with r\b_.
+
+.ti -3
+w  causes mt\b\b__ to pause before treating each file, type
+the indicative letter and the file name (as with v\b_)
+and await the user's response.  Response
+"y" means "yes", so the file is treated.  Null response
+means "no", and the file does not take part
+in whatever is being done.  Response "x" means "exit";
+the mt\b\b__ command terminates immediately.  In the x\b_ function,
+files previously asked about
+have been extracted already.
+With r\b_, no change has been made to the tape.
+
+.ti -3
+m  make (create) directories during an x\b_ if necessary.
+.in -6
+.sp
+.ti 0
+FILES          /dev/mt?
+.sp
+.ti 0
+SEE ALSO       tap(I), tap(V)
+.sp
+.ti 0
+DIAGNOSTICS    Tape open error
+.br
+Tape read error
+.br
+Tape write error
+.br
+Directory checksum
+.br
+Directory overflow
+.br
+Seek error
+.br
+Tape overflow
+.br
+Phase error (a file has changed after it was selected for
+dumping but before it was dumped)
+.br
+.sp
+.ti 0
+BUGS           If, during an "x",
+the files are specified in a different order
+than they are on the tape,
+seek errors will result because the tape
+cannot be rewound.
diff --git a/man/man1/mv.1 b/man/man1/mv.1
new file mode 100644 (file)
index 0000000..7966ab0
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'MV (I)'2/9/73'MV (I)'
+.ti 0
+NAME           mv  --  move or rename a file
+.sp
+.ti 0
+SYNOPSIS       mv\b\b__ name\d1\u name\d2\u
+.sp
+.ti 0
+DESCRIPTION    mv\b\b__
+changes the name of name\d1\u to
+name\d2\u.
+If name\d2\u is a directory, name\d1\u is moved to
+that directory with its original file-name.
+Directories may only be moved within the same parent
+directory (just renamed).
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    yes
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/nm.1 b/man/man1/nm.1
new file mode 100644 (file)
index 0000000..6a4bc5b
--- /dev/null
@@ -0,0 +1,33 @@
+.pa 1
+.he 'NM (I)'3/15/72'NM (I)'
+.ti 0
+NAME           nm  --  print name list
+.sp
+.ti 0
+SYNOPSIS       nm\b\b__ [ name ]
+.sp
+.ti 0
+DESCRIPTION    nm\b\b__
+prints the symbol table from the output file of an
+assembler or loader run.
+Each symbol name is preceded by its value (blanks if undefined)
+and one of the letters "U" (undefined) "A" (absolute) "T"
+(text segment symbol),
+"D" (data segment symbol), or "B"
+(bss segment symbol).
+Global symbols have their first character underlined.
+The output is sorted alphabetically.
+.sp
+If no file is given, the symbols in a.out\b\b\b\b\b_____ are listed.
+.sp
+.ti 0
+FILES          a.out
+.sp
+.ti 0
+SEE ALSO       as(I), ld(I)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/nroff.1 b/man/man1/nroff.1
new file mode 100644 (file)
index 0000000..1a77059
--- /dev/null
@@ -0,0 +1,191 @@
+.pa 1
+.he 'NROFF (I)'1/15/73'NROFF (I)'
+.ti 0
+NAME           nroff  --  format text
+.sp
+.ti 0
+.nf
+SYNOPSIS       nroff\b\b\b\b\b_____ [+\b_N] [-s\b\b__] [-h\b\b__] [-q\b\b__] [-i\b\b__] files
+.fi
+.sp
+.ti 0
+DESCRIPTION    nroff\b\b\b\b\b_____
+formats text according to control lines embedded
+in the text files.
+The non-file option arguments are interpreted as follows:
+
+.in +6
+.ti -3
++N Output will commence at the first page whose page
+number is N (independent of whether or not the
+page number is being printed).
+
+.ti -3
+-s Stop between pages. Printing will halt prior to
+each page (including the first) to permit paper
+loading and changing. Printing is restarted by
+typing either a "newline" or "delete" character.
+
+.ti -3
+-h High-speed output. During output, strings of
+space characters are replaced where possible with
+tab characters to speed up output. Futhermore, if
+the output is directed into a file or a pipe,
+this mode effectively reduces the total number of
+characters in the file or pipe; this is especially
+important in multi-column output where the
+temporary file(s) or pipe(s) would otherwise contain
+a large number of space characters.
+
+.ti -3
+-q The prompt names for insertions are not printed
+and the bell character is sent instead; in
+addition, the insertion is not echoed. This mode
+permits insertions during the actual output printing
+
+.ti -3
+-i Index mode. NROFF creates a file called "index"
+containing every word output together with the
+line and page number. The format is word, tab,
+page, tab, line, newline, etc. Invoking this mode
+slows down the execution of NROFF considerably.
+.sp
+.in -6
+Nroff is more completely described
+in [1].
+A condensed Request Summary is included here.
+.sp
+.ti 0
+FILES          /etc/suftab     suffix hyphenation tables
+.br
+/tmp/rtm?      temporary
+.br
+.sp
+.ti 0
+SEE ALSO       [1] NROFF User's Manual (available as MM-73-1271-2).
+.sp
+.ti 0
+DIAGNOSTICS    none
+.sp
+.ti 0
+BUGS           -
+.in 0
+.bp
+.cc %
+%nf
+%ce
+REQUEST REFERENCE AND INDEX
+
+Request  Initial  If no    Cause
+Form\b\b\b\b____     Value\b\b\b\b\b_____    Argument\b\b\b\b\b\b\b\b________ Break\b\b\b\b\b_____ Explanation\b\b\b\b\b\b\b\b\b\b\b___________
+
+I.  Page\b\b\b\b____ Control\b\b\b\b\b\b\b_______
+
+.pl +\b_N   N=66     N=66     no    P\b_age L\b_ength.
+.bp +\b_N   N=1      -        yes   B\b_egin P\b_age.
+.pn +\b_N   N=1      ignored  no    P\b_age N\b_umber.
+.po +\b_N   N=0      N=prev   no    P\b_age O\b_ffset.
+.ne N    -        N=1      no    NE\b\b__ed N lines.
+
+II.  Text\b\b\b\b____ Filling\b\b\b\b\b\b\b_______, Adjusting\b\b\b\b\b\b\b\b\b_________, and\b\b\b___ Centering\b\b\b\b\b\b\b\b\b_________
+
+.br      -        -        yes   BR\b\b__eak.
+.fi      fill     -        yes   FI\b\b__ll output lines.
+.nf      fill     -        yes   N\b_oF\b_ill.
+.ad c    adj,norm adjust   no    AD\b\b__just mode on.
+.na      adjust   -        no    N\b_oA\b_djust.
+.ce N    off      N=1      yes   CE\b\b__nter N input text lines.
+
+III.  Line\b\b\b\b____ Spacing\b\b\b\b\b\b\b_______ and\b\b\b___ Blank\b\b\b\b\b_____ Lines\b\b\b\b\b_____
+
+.ls +\b_N   N=1      N=prev   no    L\b_ine S\b_pacing.
+.sp N    -        N=1      yes   SP\b\b__ace N lines
+.lv N    -        N=1      no    OR-
+.sv N    -        N=1      no    S\b_aV\b_e N lines.
+.os      -        -        no    O\b_utput S\b_aved lines.
+.ns      space    -        no    N\b_o-S\b_pace mode on.
+.rs      -        -        no    R\b_estore S\b_pacing.
+.xh      off      -        no    EX\b_tra-H\b_alf-line mode on.
+
+IV.  Line\b\b\b\b____ Length\b\b\b\b\b\b______ and\b\b\b___ Indenting\b\b\b\b\b\b\b\b\b_________
+
+.ll +\b_N   N=65     N=prev   no    L\b_ine L\b_ength.
+.in +\b_N   N=0      N=prev   yes   IN\b\b__dent.
+.ti +\b_N   -        N=1      yes   T\b_emporary I\b_ndent.
+
+V.  Macros\b\b\b\b\b\b______, Diversion\b\b\b\b\b\b\b\b\b_________, and\b\b\b___ Line\b\b\b\b____ Traps\b\b\b\b\b_____
+
+.de xx   -        ignored  no    DE\b\b__fine or redefine a macro.
+.rm xx   -        -        no    R\b_eM\b_ove macro name.
+.di xx   -        end      no    DI\b\b__vert output to macro "xx".
+.wh -\b_N xx         -        no    WH\b\b__en; set a line trap.
+.ch -\b_N -\b_M         -        no    OR-
+.ch xx -\b_M         -        no    OR-
+.ch -\b_N y          -        no    OR-
+.ch xx y          -        no    CH\b\b__ange trap line.
+
+VI.  Number\b\b\b\b\b\b______ Registers\b\b\b\b\b\b\b\b\b_________
+
+.nr a +\b_N -\b_M       -        no    OR-
+.nr ab +\b_N -\b_M      -        no    N\b_umber R\b_egister.
+.nc c    \\n       \\n       no    N\b_umber C\b_haracter.
+.ar      arabic   -        no    Arabic numbers.
+.ro      arabic   -        no    Roman numbers.
+.RO      arabic   -        no    ROMAN numbers.
+
+VII.  Input\b\b\b\b\b_____ and\b\b\b___ Output\b\b\b\b\b\b______ Conventions\b\b\b\b\b\b\b\b\b\b\b___________ and\b\b\b___ Character\b\b\b\b\b\b\b\b\b_________ Translations\b\b\b\b\b\b\b\b\b\b\b\b____________
+
+.ta N,M,...       none     no    PseudoTA\b\b__bs setting.
+.tc c    space    space    no    T\b_ab replacement C\b_haracter.
+.lc c    .        .        no    L\b_eader replacement C\b_haracter.
+.ul N    -        N=1      no    UN\b\b__derline input text lines.
+.cc c    .        .        no    Basic C\b_ontrol C\b_haracter.
+.c2 c    '        '        no    Nobreak control character.
+.li N    -        N=1      no    Accept input lines LI\b\b__terally.
+.tr abcd....      -        no    TR\b\b__anslate on output.
+
+VIII.  Hyphenation\b\b\b\b\b\b\b\b\b\b\b___________.
+
+.nh      on       -        no    N\b_o H\b_yphen.
+.hy      on       -        no    HY\b\b__phenate.
+.hc c    none     none     no    H\b_yphenation indicator C\b_haracter.
+
+IX.  Three\b\b\b\b\b_____ Part\b\b\b\b____ Titles\b\b\b\b\b\b______.
+
+.tl 'left'center'right'    no    T\b_itL\b_e.
+.lt N    N=65     N=prev   no    L\b_ength of T\b_itle.
+
+X.  Output\b\b\b\b\b\b______ Line\b\b\b\b____ Numbering\b\b\b\b\b\b\b\b\b_________.
+
+.nm +\b_N M S I      off      no    N\b_umber M\b_ode on or off, set parameters.
+.np M S I         reset    no    N\b_umber P\b_arameters set or reset.
+
+XI.  Conditional\b\b\b\b\b\b\b\b\b\b\b___________ Input\b\b\b\b\b_____ Line\b\b\b\b____ Acceptance\b\b\b\b\b\b\b\b\b\b__________
+
+.if c anything    -        no    OR-
+.if !c anything   -        no    OR-
+.if N anything    -        no    OR-
+.if !N anything   -        no    IF\b\b__ true accept line of "anything".
+
+XII.  Environment\b\b\b\b\b\b\b\b\b\b\b___________ Switching\b\b\b\b\b\b\b\b\b_________.
+
+.ev N    N=0      N=prev   no    E\b_nV\b_ironment switched.
+
+XIII.  Insertions\b\b\b\b\b\b\b\b\b\b__________ from\b\b\b\b____ the\b\b\b___ Standard\b\b\b\b\b\b\b\b________ Input\b\b\b\b\b_____ Stream\b\b\b\b\b\b______
+
+.rd prompt        bell     no    R\b_eaD\b_ insert.
+.ex      -        -        no    EX\b\b__it.
+
+XIV.  Input\b\b\b\b\b_____ File\b\b\b\b____ Switching\b\b\b\b\b\b\b\b\b\b _________
+
+.so filename      -        no    Switch SO\b\b__urce file (push down).
+.nx filename      -        no    N\b_eX\b_t file.
+.sp
+XV.  Miscellaneous\b\b\b\b\b\b\b\b\b\b\b\b\b_____________
+
+.ig      -        -        no    IG\b\b__nore.
+.fl      -        -        no    FL\b\b__ush output buffer.
+.ab      -        -        no    AB\b\b__ort.
+%cc .
+.fi
+.in 16
diff --git a/man/man1/od.1 b/man/man1/od.1
new file mode 100644 (file)
index 0000000..114143e
--- /dev/null
@@ -0,0 +1,74 @@
+.pa 1
+.he 'OD (I)'1/15/73'OD (I)'
+.ti 0
+NAME           od  --  octal dump
+.sp
+.ti 0
+SYNOPSIS       od\b\b__ [ -abcdho\b\b\b\b\b\b\b_______ ] [ file ] [ [+\b_]offset[.\b_][b\b_] ]
+.sp
+.ti 0
+DESCRIPTION    od\b\b__
+dumps
+file\b\b\b\b____
+in
+one or more formats
+as
+selected by the first argument.
+(If the first argument is missing, -o\b\b__ is default.)
+The meanings of the format argument characters
+are:
+
+.in +5
+.ti -2
+a\b_ interprets words as PDP-11 instructions and
+dis-assembles the operation code.
+Unknown operation codes print as ???.
+
+.ti -2
+b\b_ interprets bytes in octal.
+
+.ti -2
+c\b_ interprets bytes in ascii.
+Unknown ascii characters are printed as \\?.
+
+.ti -2
+d\b_ interprets words in decimal.
+
+.ti -2
+h\b_ interprets words in hex.
+
+.ti -2
+o\b_ interprets words in octal.
+
+.in -5
+The file argument specifies which file is to be dumped.
+If no file argument is specified,
+the standard input is used.
+Thus od can be used as a filter.
+
+The offset argument specifies the offset
+in the file where dumping is to commence.
+This argument is normally interpreted
+as octal bytes.
+If '.' is appended, the offset is interpreted in
+decimal.
+If 'b' is appended, the offset is interpreted in blocks.
+(A block is 512 bytes.)
+If the file argument is omitted,
+the offset argument must be preceded by '+'.
+
+Dumping continues until an end-of-file
+condition or until
+halted by sending an interrupt signal.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       db(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/opr.1 b/man/man1/opr.1
new file mode 100644 (file)
index 0000000..0c015cc
--- /dev/null
@@ -0,0 +1,48 @@
+.pa 1
+.he 'OPR (I)'1/15/73'OPR (I)'
+.ti 0
+NAME           opr -- off line print
+.sp
+.ti 0
+SYNOPSIS       opr\b\b\b___ [--\b\b__] [-\b_] [+\b_] [+-\b\b__]file\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    opr\b\b\b___
+will arrange to have the
+201 data phone daemon submit a job to the
+Honeywell 6070 to print the file arguments.
+Normally,
+the output appears at the GCOS central site.
+If the first argument is --\b\b__, the output
+is remoted to station R1.
+(Station R1 has a 1403 printer.)
+
+Normally, each file is printed in the state it is found
+when the data phone daemon reads it.
+If a particular file argument is preceded by +\b_,
+or a preceding argument of +\b_ has been encountered,
+then opr\b\b\b___ will make a copy for the daemon to print.
+If the file argument is preceded by -\b_,
+or a preceding argument of -\b_ has been encountered,
+then opr will unlink (remove) the file.
+
+If there are no
+arguments except for the optional --\b\b__,
+then the standard input is read and off-line printed.
+Thus opr\b\b\b___ may be used as a filter.
+.sp
+.ti 0
+FILES          /usr/dpd/*      spool area
+.br
+/etc/passwd    personal ident cards
+.br
+/etc/dpd       daemon
+.sp
+.ti 0
+SEE ALSO       dpd(I), passwd(V)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/ov.1 b/man/man1/ov.1
new file mode 100644 (file)
index 0000000..c3a4bcd
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'OV (I)'6/12/72'OV (I)'
+.ti 0
+NAME           ov -- overlay pages
+.sp
+.ti 0
+SYNOPSIS       ov\b\b__ [ file ]
+.sp
+.ti 0
+DESCRIPTION    ov\b\b__
+is a postprocessor for producing double column formatted
+text when using nroff(I).
+ov\b\b__
+literally overlays successive pairs of 66-line pages.
+
+If the file argument is missing,
+the standard input is used.
+Thus ov\b\b__ may be used as a filter.
+.sp
+.ti 0
+FILES          none
+.sp
+.ti 0
+SEE ALSO       nroff(I), pr(I)
+.sp
+.ti 0
+DIAGNOSTICS    none
+.sp
+.ti 0
+BUGS           Other page lengths should be permitted.
diff --git a/man/man1/passwd.1 b/man/man1/passwd.1
new file mode 100644 (file)
index 0000000..b5e916b
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'PASSWD (I)'9/1/72'PASSWD (I)'
+.ti 0
+NAME           passwd -- set login password
+.sp
+.ti 0
+SYNOPSIS       passwd\b\b\b\b\b\b______ name password
+.sp
+.ti 0
+DESCRIPTION    The
+password is placed on the given login name.
+This can only be done by the user ID
+corresponding to the login name or by the super-user.
+An explicit null argument ("") for the password
+argument will remove
+any password from the login name.
+.sp
+.ti 0
+FILES          /etc/passwd
+.sp
+.ti 0
+SEE ALSO       login(I), passwd(V), crypt(III)
+.sp
+.ti 0
+DIAGNOSTICS    Diagnostics
+are given for a non-match of the login name,
+lack of permission and for password file format errors.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/pr.1 b/man/man1/pr.1
new file mode 100644 (file)
index 0000000..80bd0dc
--- /dev/null
@@ -0,0 +1,49 @@
+.pa 1
+.he 'PR (I)'1/15/73'PR (I)'
+.ti 0
+NAME           pr  --  print file
+.sp
+.ti 0
+SYNOPSIS       pr\b\b__ [-cm\b\b\b___] [-h\b\b__ name] [-\b_n] [+\b_n] [file\e91\e8 ...]
+.sp
+.ti 0
+DESCRIPTION    pr\b\b__
+produces a printed listing of one or more files.
+The output is separated into pages headed by a date,
+the name of the file or a header (if any), and the page number.
+If there are no file arguments, pr\b\b__ prints the standard
+input file, and is thus usable as a filter.
+
+Options apply to all following files but may be reset
+between files:
+
+   -c\b\b__ print current date
+   -m\b\b__ print date file last modified (default)
+.sp
+   -\b_n produce n-column output
+.sp
+   +\b_n begin printing with page n
+.sp
+   -h\b\b__ treats the next argument as a header
+.sp
+If there is a header in force, it is printed in place of
+the file name.
+.sp
+Interconsole messages via write\b\b\b\b\b_____(I) are
+forbidden during a pr\b\b__.
+.sp
+.sp
+.ti 0
+FILES          /dev/tty?
+to suspend messages.
+.sp
+.ti 0
+SEE ALSO       cat(I), cp(I)
+.sp
+.ti 0
+DIAGNOSTICS    none (files not found are ignored)
+.sp
+.ti 0
+BUGS           In multi-column
+output, non-printing characters other than new-line
+cause misalignment.
diff --git a/man/man1/proof.1 b/man/man1/proof.1
new file mode 100644 (file)
index 0000000..b817bd9
--- /dev/null
@@ -0,0 +1,41 @@
+.pa 1
+.he 'PROOF (I)'1/15/73'PROOF (I)'
+.ti 0
+NAME           proof -- compare two text files
+.sp
+.ti 0
+SYNOPSIS       proof\b\b\b\b\b_____
+oldfile newfile
+.sp
+.ti 0
+DESCRIPTION    proof\b\b\b\b\b_____
+lists
+those lines of
+.ul
+newfile
+that differ from corresponding lines in
+.ul
+oldfile.
+The line number in
+.ul
+newfile
+is given.
+When changes, insertions or deletions have
+been made the program attempts to resynchronize
+the text in the two files by finding a sequence of
+lines in both files that again agree.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       cmp(I)
+.sp
+.ti 0
+DIAGNOSTICS    yes,
+but they are undecipherable, e.g. "?1".
+.sp
+.ti 0
+BUGS           proof\b\b\b\b\b_____
+is still evolving.  Any bugs discovered or suggestions
+should be brought to ENP.
diff --git a/man/man1/reloc.1 b/man/man1/reloc.1
new file mode 100644 (file)
index 0000000..a5fcc57
--- /dev/null
@@ -0,0 +1,45 @@
+.pa 1
+.he 'RELOC (I)'2/7/73'RELOC (I)'
+.ti 0
+NAME           reloc -- relocate object files
+.sp
+.ti 0
+SYNOPSIS       reloc\b\b\b\b\b_____ file [-\b_]octal [ -\b_ ]
+.sp
+.ti 0
+DESCRIPTION    reloc\b\b\b\b\b_____
+modifies the named object program file so that it will operate correctly
+at a different core origin than the one for which
+it was assembled or loaded.
+
+The new core origin is the old origin
+increased by
+the given octal\b\b\b\b\b_____
+number (or decreased if the number has a "-" sign).
+
+If the object file was generated by the link-editor ld\b\b__,
+the "-r" ld\b\b__ option must have been given to
+preserve the relocation information in the file.
+
+If the optional last argument is given, then any
+"setd" instruction at the start of the file
+will be replaced by a no-op.
+
+The purpose of this command is to simplify the
+preparation of object programs for systems
+which have no relocation hardware.
+It is hard to imagine a situation
+in which it would be useful to attempt directly to execute
+a program treated by reloc\b\b\b\b\b_____.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       as(I), ld(I), a.out(V)
+.sp
+.ti 0
+DIAGNOSTICS    As appropriate
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/rew.1 b/man/man1/rew.1
new file mode 100644 (file)
index 0000000..d9fb897
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'REW (I)'1/15/73'REW (I)'
+.ti 0
+NAME           rew  --  rewind tape
+.sp
+.ti 0
+SYNOPSIS       rew \b\b\b\b___ [ [m\b_]digit ]
+.sp
+.ti 0
+DESCRIPTION    rew\b\b\b___
+rewinds DECtape or magtape drives.  The digit is the logical
+tape number, and should range from 0 to 7.
+If the digit is preceded by 'm',
+rew\b\b\b___ applies to magtape rather than DECtape.
+A missing digit indicates drive 0.
+.sp
+.ti 0
+FILES          /dev/tap?
+.br
+/dev/mt?
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "?" if there is no tape mounted on the indicated
+drive or if the file cannot be opened.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/rm.1 b/man/man1/rm.1
new file mode 100644 (file)
index 0000000..dfab84f
--- /dev/null
@@ -0,0 +1,48 @@
+.pa 1
+.he 'RM (I)'1/20/73'RM (I)'
+.ti 0
+NAME           rm  -- remove (unlink) files
+.sp
+.ti 0
+SYNOPSIS       rm\b\b__ [ -f\b\b__ ] [ -r\b\b__ ] name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    rm\b\b__
+removes the entries for one or more files from a directory.
+If an entry was the last link to the file, the file
+is destroyed.
+Removal of a file requires write permission in its directory,
+but neither read nor write permission on the file itself.
+
+If there is no write permission to a
+file designated to be removed,
+rm\b\b__ will print the file name, its mode and then
+read a line from the standard input.
+If the line begins with 'y', the file is removed,
+otherwise it is not.
+The optional argument -f\b\b__ prevents the above interaction.
+
+If a designated file is a directory,
+an error comment is printed unless the optional
+argument -r\b\b__ has been used.
+In that case, rm\b\b__ recursively deletes the
+entire contents of the specified directory.
+To remove directories per se see rmdir(I).
+.sp
+.ti 0
+FILES          /etc/glob to implement -r\b\b__ flag
+.sp
+.ti 0
+SEE ALSO       rmdir(I)
+.sp
+.ti 0
+DIAGNOSTICS    "name: non existent"
+.br
+"name: not removed" if cannot remove
+.br
+"name: try again" error from fork
+.sp
+.ti 0
+BUGS           When
+rm\b\b__ removes the contents of a directory under the
+-r\b\b__ flag, full pathnames are not printed in diagnostics.
diff --git a/man/man1/rmdir.1 b/man/man1/rmdir.1
new file mode 100644 (file)
index 0000000..1434b05
--- /dev/null
@@ -0,0 +1,32 @@
+.pa 1
+.he 'RMDIR (I)'3/15/72'RMDIR (I)'
+.ti 0
+NAME           rmdir  --  remove directory
+.sp
+.ti 0
+SYNOPSIS       rmdir\b\b\b\b\b_____ dir\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    rmdir\b\b\b\b\b_____
+removes (deletes) directories.
+The directory must be empty (except for the standard entries
+"." and "..", which rmdir\b\b\b\b\b_____ itself removes).
+Write permission is required in the
+directory in which the directory appears.
+.sp
+.ti 0
+FILES          none
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "dir?"
+is printed if directory dir\b\b\b___ cannot be found, is not a directory, or is not
+removable.
+.sp
+"dir -- directory not empty" is printed if dir\b\b\b___ has entries
+other than "." or "..".
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/roff.1 b/man/man1/roff.1
new file mode 100644 (file)
index 0000000..24d9e26
--- /dev/null
@@ -0,0 +1,197 @@
+.pa 1
+.he 'ROFF (I)'6/12/72'ROFF (I)'
+.ti 0
+NAME           roff  --  format text
+.sp
+.ti 0
+.nf
+SYNOPSIS       roff\b\b\b\b____ [ +\b_number ] [ -s\b\b__ ] [ -h\b\b__ ] file\d1\u ...
+.fi
+.sp
+.ti 0
+DESCRIPTION    roff\b\b\b\b____
+formats text according to control lines embedded
+in the text in file\e91\e8, ... .
+Encountering a nonexistent file terminates printing.
+The optional argument "+\b_number" causes printing
+to begin at the first page
+with that number.
+The optional argument
+"-s\b\b__" causes printing to stop before each page
+including the first
+to allow paper manipulation;
+printing is resumed upon
+receipt of an interrupt signal.
+The optional argument
+"-h" causes the output to contain
+horizontal tabs for two or more spaces
+that end on a tab stop.
+An interrupt signal received during printing terminates all
+printing.
+Incoming interconsole messages are turned off during printing,
+and the original message acceptance state is restored upon
+termination.
+.sp
+At the present time, there
+is no document describing ROFF in full.
+A Request Summary is attached.
+.sp
+.ti 0
+FILES          /etc/suftab     suffix hyphenation tables
+.br
+/tmp/rtm?      temporary
+.br
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    none
+.sp
+.ti 0
+BUGS           -
+.bp
+.de xx
+.ti0
+.li
+..
+.tc |
+.tr |
+.in 0
+.ce
+REQUEST SUMMARY
+.sp2
+.ul
+Request        Break   Initial Meaning
+.in24
+.na
+.sp
+.xx
+.ad    yes     yes     Begin adjusting right margins.
+.xx
+.ar    no      arabic  Arabic page numbers.
+.xx
+.br    yes     -       Causes a line break -­ thÃ¥ filling of
+the current line is stopped.
+.xx
+.bl|n  yes     -       Insert contiguous block of n blank lines.
+If necessary, a new page will be
+started to accomodate the entire block.
+.xx
+.bp|+n yes     n=1     Begin new page and number it n.
+If n is not given, normal sequencing occurs.
+.xx
+.cc|c  no      c=.     Control character becomes `c'.
+.xx
+.ce|n  yes     -       Center the next n input lines,
+without filling.
+.xx
+.de|xx no      -       Define macro named "xx"
+(definition ends with a line beginning with "..").
+.xx
+.ds    yes     no      Double space; same as ".ls 2".
+.xx
+.ef|t  no      t=''''  Even foot title becomes t.
+.xx
+.eh|t  no      t=''''  Even head title becomes t.
+.xx
+.fi    yes     yes     Begin filling output lines.
+.xx
+.fo    no      t=''''  All foot titles are t.
+.xx
+.hc|c  no      none    Hyphenation character set to `c'.
+.xx
+.he|t  no      t=''''  All head titles are t.
+.xx
+.hx    no      -       Title lines are suppressed.
+.xx
+.hy|n  no      n=1     Hyphenation is done, if n=1;
+and is not done, if n=0.
+.xx
+.ig    no      -       Ignore input lines until and including
+a line beginning with "..".
+.xx
+.in|+n yes     -       Indent n spaces from left margin.
+.xx
+.ix +n no      -       Same as ".in" but without break.
+.xx
+.li|n  no      -       Literal, treat next n lines as text.
+.xx
+.ll|+n no      n=65    Line length including indent is n characters.
+.xx
+.ls|+n yes     n=1     Line spacing set to n lines per output line.
+.xx
+.m1|n  no      n=2     n blank lines are put between the top
+of a new page and the head title.
+.xx
+.m2|n  no      n=2     n blanks lines put between head title
+and beginning of text on page.
+.xx
+.m3|n  no      n=1     n blank lines put between the end of
+text and the foot title.
+.xx
+.m4|n  no      n=3     n blank lines put between the foot title
+and the bottom of page.
+.xx
+.na    yes     no      Stop adjusting the right margin.
+.xx
+.ne|n  no      -       Begin new page, if n output lines
+cannot fit on present page.
+.xx
+.nn|+n no      -       The next n output lines are not numbered.
+.xx
+.n1    no      no      Output lines are numbered sequentially
+beginning with 1 on each new page.
+Head and foot titles are not numbered.
+.xx
+.n2    no      no      Output lines are numbered sequentially
+beginning with 1 on the next output line.
+.xx
+.ni|+n no      n=0     Line numbers are indented n.
+.xx
+.nf    yes     no      Stop filling output lines.
+.xx
+.nx|filename   -       Change to input file "filename".
+.xx
+.of|t  no      t=''''  Odd foot title becomes t.
+.xx
+.oh|t  no      t=''''  Odd head title becomes t.
+.xx
+.pa|+n yes     n=1     Same as ".bp".
+.xx
+.pl|+n no      n=66    Total paper length taken to be n lines.
+.xx
+.po|+n no      n=0     Page offset.
+All lines are preceded by N spaces.
+.xx
+.ro    no      arabic  Roman page numbers.
+.xx
+.sk|n  no      -       n pages with head and foot titles but
+otherwise blank will be output beginning
+with the next page containing text.
+.xx
+.sp|n  yes     -       Insert block of n blank lines.
+If the bottom of a page is reached,
+remaining lines are not\b\b\b___ put on next page.
+.xx
+.ss    yes     yes     Single space output lines,
+equivalent to ".ls 1".
+.xx
+.ta|N|M|...    -       Pseudotab settings.
+Initial tab settings are columns 9,17,25,...
+.xx
+.tc|c  no      c="|"   Tab replacement character becomes "c".
+.xx
+.ti|+n yes     -       Temporarily indent next output line
+n spaces.
+.xx
+.tr|abcd.. no  -       Translate a into b, c into d, etc.
+.xx
+.ul|n  no      -       Underline the letters and numbers on the
+next n input lines.
+.sp
+.in0
+.fi
+.tc
+.in 16
+.tr ||
diff --git a/man/man1/sh.1 b/man/man1/sh.1
new file mode 100644 (file)
index 0000000..114920c
--- /dev/null
@@ -0,0 +1,386 @@
+.pa 1
+.he 'SH (I)'1/15/73'SH (I)'
+.ti 0
+NAME           sh  --  shell (command interpreter)
+.sp
+.ti 0
+SYNOPSIS       sh\b\b__ [ name [ arg\d1\u ... [ arg\d9\u ] ] ]
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+sh\b\b__
+is the standard command interpreter.
+It is the program which reads and arranges the execution of
+the command lines typed by most users.
+It may itself be called as a command to interpret
+files of commands.
+Before discussing the arguments to the shell
+used as a command, the structure of command
+lines themselves will be given.
+
+.ul
+Command lines
+.sp
+Command lines are sequences of commands separated by command
+delimiters.
+Each command is a sequence of non-blank command arguments
+separated by blanks.
+The
+first argument specifies the name of a command to be
+executed.  Except for certain types of special
+arguments discussed below, the arguments
+other than the command name are passed
+without interpretation to the invoked
+command.
+.sp
+If the first argument is the name of an executable
+file, it is invoked;
+otherwise the string "/bin/" is prepended to the argument.
+(In this way most standard commands,
+which reside in "/bin", are found.)
+If no such command is found,
+the string "/usr" is further prepended
+(to give "/usr/bin/command") and another attempt
+is made to execute the resulting
+file.
+(Certain "overflow" commands
+live in "/usr/bin".)  If
+the "/usr/bin" file exists, but is not
+executable, it is used by the shell as
+a command file.
+That is to say it is executed
+as though it were typed from the console.
+If all attempts fail, a diagnostic is printed.
+.sp
+The remaining non-special arguments are simply passed to the command
+without further interpretation by the shell.
+.sp
+.ul
+Command delimiters
+
+There are three command delimiters:  the new-line, ";", and "&".
+The semicolon ";" specifies sequential execution of the commands
+so separated; that is,
+.sp
+       coma; comb
+.sp
+causes the execution first of command coma\b\b\b\b____, then of comb\b\b\b\b____.
+The ampersand "&" causes simultaneous execution:
+.sp
+       coma & comb
+.sp
+causes coma\b\b\b\b____ to be called,
+followed immediately by comb\b\b\b\b____ without waiting for coma\b\b\b\b____ to finish.
+Thus coma\b\b\b\b____ and comb\b\b\b\b____
+execute simultaneously.  As a special case,
+.sp
+       coma &
+.sp
+causes coma\b\b\b\b____ to be executed and the shell immediately
+to request another command without waiting for coma\b\b\b\b____.
+.a
+.sp
+.ul
+Termination Reporting
+.sp
+If a command (not followed by "&") terminates abnormally,
+a message is printed.
+(All terminations other than exit and interrupt
+are considered abnormal.)
+The following is a list of the abnormal
+termination messages:
+.sp
+       Bus error
+       Trace/BPT trap
+       Illegal instruction
+       IOT trap
+       Power fail trap
+       EMT trap
+       Bad system call
+       Quit
+       PIR trap
+       Floating exception
+       Memory violation
+       Killed
+       User I/O
+       Error
+.sp
+If a core image is produced,
+" -- Core dumped" is appended to the appropriate message.
+.sp
+.ul
+Redirection of I/O
+
+Three char\ 6ac\ 6ter sequences cause the immediately following string
+to be interpreted as a special argument to the shell itself, not
+passed to the command.
+
+An argument of the form "<arg" causes the file arg\b\b\b___
+to be used as the standard input file of the given command.
+
+An argument of the form ">arg" causes file "arg" to be used
+as the standard output file for the given command.
+"Arg" is created if it did not exist, and in any case is truncated
+at the outset.
+
+An argument of the form ">>arg" causes file "arg" to be used as the
+standard output for the given command.  If "arg"
+did not exist, it is created; if it did exist,
+the command output is appended to the file.
+
+.ul
+Pipes and Filters
+
+A pipe\b\b\b\b____ is a channel such that information
+can be written into one end of the pipe by one program,
+and read at the other end by another program.
+(See pipe\b\b\b\b____ (II)).  A
+filter\b\b\b\b\b\b______ is a program which reads the standard
+input file, performs some transformation,
+and writes the result on the standard output file.
+By extending the syntax used
+for redirection of I/O, a command line can
+specify that the output produced by
+a command be passed via a pipe
+through another command which acts as a filter.
+For example:
+
+       command >filter>
+
+More generally, special arguments of the form
+
+       >f\d1\u>f\d2\u>...>
+
+specify that output is to be passed successively
+through the filters f\d1\u, f\d2\u, ...,
+and end up on the standard output stream.
+By saying instead
+
+       >f\d1\u>f\d2\u>...>file
+
+the output finally ends up in file\b\b\b\b____.  (The
+last ">" could also have been a ">>"
+to specify concatenation onto the end of file\b\b\b\b____.)
+
+In exactly analogous manner input filtering can
+be specified via one of
+
+       <f\d1\u<f\d2\u<...<
+       <f\d1\u<f\d2\u<...<file
+
+Both input and output filtering
+can be specified in the same command, though not in the same
+special argument.
+
+For example:
+
+       ls >pr>
+
+produces a listing of the current directory with
+page headings, while
+
+       ls >pr>xx
+
+puts the paginated listing into the file xx.
+
+If any of the filters needs arguments, quotes can be used
+to prevent the required blank characters from
+violating the blankless
+syntax of filters.
+For example:
+
+       ls >"pr -h 'My directory'">
+
+uses quotes twice, once to protect the entire pr\b\b__ command,
+once to protect the heading argument of pr\b\b__.
+(Quotes are discussed fully below.)
+
+.ul
+Generation of argument lists
+
+If any argument contains any of the char\ 6ac\ 6ters "?",
+"*" or '[', it is treated specially as follows.
+The current directory is searched for files which match\b\b\b\b\b_____
+the given argument.
+
+The char\ 6ac\ 6ter "*" in an argument matches any string of char\ 6ac\ 6ters
+in a file name (including the null string).
+
+The character "?" matches any
+single char\ 6ac\ 6ter in a file name.
+
+Square brackets "[...]" specify
+a class of characters which
+matches any single file-name character in the class.
+Within the brackets,
+each ordinary character is taken
+to be a member of the class.
+A pair of characters separated by "-" places
+in the class
+each character lexically greater than or equal to
+the first and less than or equal to the second
+member of the pair.
+
+Other characters match only the same character in
+the file name.
+
+For example, "*" matches all file names;
+"?" matches all one-char\ 6ac\ 6ter file names; "[ab]*.s" matches
+all file names beginning with "a" or "b" and ending with ".s";
+"?[zi-m]" matches all two-character file names ending
+with "z" or the letters "i" through "m".
+
+If the argument with "*" or "?" also contains a "/", a slightly
+different procedure is used:  instead of the current directory,
+the directory used is the one obtained
+by taking the argument up to the last "/" before a "*" or "?".
+The matching process matches the remainder of the argument
+after this "/"  against the files in the derived directory.
+For example: "/usr/dmr/a*.s" matches
+all files in directory "/usr/dmr" which begin
+with "a" and end with ".s".
+
+In any event, a list of names is obtained which match
+the argument.  This list is sorted into alphabetical order,
+and the resulting sequence of arguments replaces the
+single argument containing the "*", "[", or "?".
+The same process is carried out for each argument
+(the resulting lists are not\b\b\b___ merged)
+and finally the command is called with the resulting list of
+arguments.
+
+For example: directory /usr/dmr contains the files
+a1.s, a2.s, ..., a9.s.  From any directory, the command
+
+     as /usr/dmr/a?.s
+
+calls as\b\b__ with arguments
+/usr/dmr/a1.s, /usr/dmr/a2.s, ...
+/usr/dmr/a9.s
+in that order.
+.sp
+.ul
+.ul
+Quoting
+
+The char\ 6ac\ 6ter "\\" causes the immediately following char\ 6ac\ 6ter
+to lose any special meaning it may have to the shell;  in this
+way "<", ">", and other char\ 6ac\ 6ters meaningful to the
+shell may be passed as part of arguments.
+A special case of this feature allows the continuation of commands
+onto more than one line:  a new-line preceded by "\\" is translated
+into a blank.
+.sp
+Sequences of char\ 6ac\ 6ters enclosed in double (") or single (')
+quotes are also taken literally.
+.sp
+.ul
+Argument passing
+
+When the shell is invoked as a command, it has additional
+string processing capabilities.
+Recall that the form in which the shell is invoked is
+
+     sh [ name [ arg\d1\u ... [ arg\d9\u ] ] ]
+
+The name\b\b\b\b____ is the name of a file which will be read and
+interpreted.  If not given, this subinstance of the shell
+will continue to read the standard input file.
+
+In command lines in the file
+(not in command input),
+character sequences of the form "$n", where n\b_ is a digit 0, ..., 9,
+are replaced by the n\b_th argument to the invocation
+of the shell (arg\dn\u).
+"$0" is replaced by name\b\b\b\b____.
+
+.ul
+End of file
+
+An end-of-file in the shell's input causes it to exit.
+A side effect of this fact means that the way to
+log out from UNIX is to type an end of file.
+
+.ul
+Special commands
+
+Two commands are treated specially by the shell.
+
+"Chdir" is done without
+spawning a new process by executing the sys\b\b\b___ chdir\b\b\b\b\b_____
+primitive.
+
+"Login" is done by executing
+/bin/login without creating a new process.
+
+These peculiarities are inexorably imposed
+upon the shell by the basic structure
+of the UNIX process control system.
+It is a rewarding exercise to work
+out why.
+
+.ul
+Command file errors; interrupts
+
+Any shell-detected error, or an interrupt signal,
+during the execution of a command file
+causes the shell to cease execution of that file.
+
+.in 16
+.ti 0
+FILES          /etc/glob,
+which interprets "*", "?", and "[".
+.sp
+.ti 0
+SEE ALSO       "The UNIX Time-sharing System",
+which gives the theory of operation of the
+shell.
+.sp
+.ti 0
+DIAGNOSTICS
+.br
+.in 8
+"Input not found", when a command file is
+specified which cannot be read;
+.br
+"Arg count", if the number of arguments to the chdir pseudo-command
+is not exactly 1,
+or if "*", "?", or "[" is used inappropriately;
+.br
+"Bad directory", if the directory given in "chdir" cannot be
+switched to;
+.br
+"Try again", if no new process can be created to execute
+the specified command;
+.br
+""' imbalance", if single or double quotes are not matched;
+.br
+"Input file", if an argument after "<" cannot be read;
+.br
+"Output file", if an argument after ">" or ">>" cannot
+be written (or created);
+.br
+"Command not found", if the specified command cannot be executed.
+.br
+"No match", if no arguments are generated for a command
+which contains "*", "?", or "[".
+.br
+Termination messages described above.
+.sp
+.in 16
+.ti 0
+BUGS           If any argument contains a quoted "*",
+"?", or "[", then all instances of these characters
+must be quoted.
+This is because sh\b\b__ calls the glob\b\b\b\b____ routine whenever
+an unquoted "*", "?", or "[" is noticed;
+the fact that other instances of these characters occurred
+quoted is not noticed by glob\b\b\b\b____.
+
+When output is redirected,
+particularly through a filter,
+diagnostics tend to be
+sent down the pipe and are sometimes
+lost altogether.
diff --git a/man/man1/size.1 b/man/man1/size.1
new file mode 100644 (file)
index 0000000..019a623
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'SIZE (I)'9/2/72'SIZE (I)'
+.ti 0
+NAME           size -- size of an object file
+.sp
+.ti 0
+SYNOPSIS       size\b\b\b\b____ [ object ... ]
+.sp
+.ti 0
+DESCRIPTION    The
+size, in bytes, of the
+object files are printed.
+If no file is given, a.out\b\b\b\b\b_____ is default.
+The size is printed in octal for the
+text, data, and bss portions of each file.
+The sum of these is also printed in octal
+and decimal.
+.sp
+.ti 0
+FILES          a.out   default
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "object not found" if the input cannot be read.
+"bad format: object" if the input file
+does not have a valid object header.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/sno.1 b/man/man1/sno.1
new file mode 100644 (file)
index 0000000..e685212
--- /dev/null
@@ -0,0 +1,99 @@
+.pa 1
+.he 'SNO (I)'2/9/73'SNO (I)'
+.ti 0
+NAME           sno -- SNOBOL interpreter
+.sp
+.ti 0
+SYNOPSIS       sno\b\b\b___ [ file ]
+.sp
+.ti 0
+DESCRIPTION    sno\b\b\b___
+is a SNOBOL III (with slight differences)
+compiler and interpreter.
+sno\b\b\b___ obtains input from the
+concatenation of file\b\b\b\b____ and the standard input.
+All input through a statement
+containing the label 'end' is
+considered program and is compiled.
+The rest is available to 'syspit'.
+
+The following is a list of differences
+between sno\b\b\b___ and SNOBOL III:
+
+.in +3
+There are no unanchored searches.
+To get the same effect:
+
+.ti +3
+a ** b         unanchored search for b
+.ti +3
+a *x* b = x c  unanchored assignment
+
+No back referencing
+
+.ti +3
+x = "abc"
+.ti +3
+a *x* x                unanchored search for "abc"
+
+Different function declaration.
+The function declaration is
+done at compile time by the use of the label 'define'.
+Thus there is no ability to define functions at run time
+and the use of the name 'define' is preempted.
+There is also no provision for 'automatic' variables
+other than the parameters.
+
+.ti +3
+define f()
+.ti +3
+       or
+.ti +3
+define f(a,b,c)
+
+All labels except 'define' (even 'end')
+must have a non-empty statement.
+
+If 'start' is a label in the program,
+program execution will start there.
+If not, execution begins with the first
+executable statement.
+('define' is not an executable statement)
+
+There are no builtin functions
+
+Variable length patterns
+at the end of a pattern match are not treated
+specially.
+They still match the shortest rather than
+longest text.
+
+Parentheses for arithmetic are not needed.
+Normal (eg FORTRAN) precedence applies.
+Because of this, the arithmetic
+operators '/' and '*'
+must be set off by space.
+
+The right side of assignments
+must be non-empty.
+
+Either ' or " may be used for literal quotes.
+
+The pseudo-variable 'sysppt' is not available.
+.in -3
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       SNOBOL III manual.
+(JACM\b\b\b\b____; Vol. 11 No. 1; Jan 1964; pp 21)
+.sp
+.ti 0
+DIAGNOSTICS    As appropriate
+.sp
+.ti 0
+BUGS           Runtime
+diagnostics give the
+last program line number
+rather than the executing statement line number.
diff --git a/man/man1/sort.1 b/man/man1/sort.1
new file mode 100644 (file)
index 0000000..29157a8
--- /dev/null
@@ -0,0 +1,44 @@
+.pa 1
+.he 'SORT (I)'9/2/72'SORT (I)'
+.ti 0
+NAME           sort -- sort a file
+.sp
+.ti 0
+SYNOPSIS       sort\b\b\b\b____ [ -\b_ ] [ input [ output ] ]
+.sp
+.ti 0
+DESCRIPTION    sort\b\b\b\b____
+will sort the input file and write the
+sorted file on the output file.
+If the output file is not given,
+the input file is rewritten.
+If the input file is missing,
+sort uses the standard input as
+input and the standard output for output.
+Thus sort\b\b\b\b____ may be used as a filter.
+
+The sort is line-by-line in increasing ASCII collating sequence,
+except that upper-case letters are considered
+the same as the lower-case letters.
+
+The optional argument -\b_ will cause a reverse sort.
+
+sort\b\b\b\b____ is implemented in such a way that
+
+       sort /dev/mt0
+
+works correctly provided the tape is not too big.
+.sp
+.ti 0
+FILES          /tmp/stm?
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           The
+largest file that can be
+sorted is about 128K bytes.
diff --git a/man/man1/speak.1 b/man/man1/speak.1
new file mode 100644 (file)
index 0000000..0c31647
--- /dev/null
@@ -0,0 +1,79 @@
+.pa 1
+.he 'SPEAK (I)'2/1/73'SPEAK (I)'
+.ti 0
+NAME           speak -- word to voice translator
+.sp
+.ti 0
+SYNOPSIS       speak\b\b\b\b\b_____ [ -\b_ ] [ vocabulary ]
+.sp
+.ti 0
+DESCRIPTION    speak\b\b\b\b\b_____
+turns a stream of ascii words
+into utterances and outputs them to a voice synthesizer.
+It has facilities for maintaining a vocabulary.
+It receives, from the standard input 
+
+.in +2
+.ti -2
+- working lines - text of words separated by blanks
+.ti -2
+- phonetic lines - strings of phonemes for one word preceded
+and separated by commas.
+The phonetic code is given in vsp\b\b\b___(VII).
+.ti -2
+- empty lines
+.ti -2
+- command lines - beginning with !\b_.  The following forms
+are recognized:
+.in+1
+.in+8
+
+.ti-8
+!\b_r\b_ file    replace coded vocabulary from file
+.ti-8
+!\b_w\b_ file    write coded vocabulary on file
+.ti-8
+!\b_p\b_ print phonetics for working word
+.ti-8
+!\b_l\b_ list vocabulary on standard output with phonetics
+.ti-8
+!c\b\b__ word    copy phonetics from working word to
+specified word
+.ti-8
+!s\b\b__ file    (save) append working word and phonetics to file
+in style of !l\b\b__
+.in-8
+
+.in-3
+Each working line replaces its predecessor.
+Its first word is the "working word".
+Each phonetic line replaces the phonetics stored for the
+working word.
+Each working line, phonetic line or empty line
+causes the working line to be uttered.
+The process terminates at the end of input.
+
+Unknown words are spelled
+as strings of one-letter words.
+Unknown one-letter words burp.
+
+A phonetic line of comma only will delete the
+entry for the working word.
+
+speak\b\b\b\b\b_____ is initialized with a coded vocabulary stored in file
+.ul
+/etc/speak.m.
+The vocabulary option substitutes a different file for speak.m\b\b\b\b\b\b\b_______.
+.sp
+The -\b_ option suppresses all utterances.
+.sp
+.ti 0
+FILES          /etc/speak.m
+.sp
+.ti 0
+SEE ALSO       vsp(VII), speakm(V), vt(IV)
+.sp
+.ti 0
+BUGS           Vocabulary overflow is unchecked.
+Excessively long words cause dumps.
+Space is not reclaimed from deleted entries.
diff --git a/man/man1/split.1 b/man/man1/split.1
new file mode 100644 (file)
index 0000000..907a8fc
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'SPLIT (I)'1/15/73'SPLIT (I)'
+.ti 0
+NAME           split -- split a file into pieces
+.sp
+.ti 0
+SYNOPSIS       split [ [ file1 ] file2 ]
+.sp
+.ti 0
+DESCRIPTION    Split reads file1 and writes
+it in 1000-line pieces, as many as are necessary, onto
+a set of output files.  The name of the first output
+file is file2 with an "a" appended, and so on
+through the alphabet and beyond.  If no output name is given,
+"x" is default.
+.sp
+If no input file is given, or the first argument is "-",
+then the standard input file is used.
+.sp
+.ti 0
+FILES          -
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    yes
+.sp
+.ti 0
+BUGS           Watch out for 8-character file names.
diff --git a/man/man1/stat.1 b/man/man1/stat.1
new file mode 100644 (file)
index 0000000..7641899
--- /dev/null
@@ -0,0 +1,76 @@
+.pa 1
+.he 'STAT (I)'3/15/72'STAT (I)'
+.ti 0
+NAME           stat  --  get file status
+.sp
+.ti 0
+SYNOPSIS       stat\b\b\b\b____ name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    stat\b\b\b\b____
+gives several kinds of information about one or more
+files:
+.sp
+   i-number
+   access mode
+   number of links
+   owner
+   size in bytes
+   date and time of last modification
+   name (useful when several files are named)
+.sp
+All information is self-explanatory except the mode.
+The mode is a six-character string whose characters mean the
+following:
+.sp
+.in +5
+.ti -2
+1 s: file is small (smaller than 4096 bytes)
+.br
+l: file is large
+
+.ti -2
+2 d: file is a directory
+.br
+x: file is executable
+.br
+u: set user ID on execution
+.br
+-: none of the above
+.ti -2
+
+3 r: owner can read
+.br
+-: owner cannot read
+
+.ti -2
+4 w: owner can write
+.br
+-: owner cannot write
+
+.ti -2
+5 r: non-owner can read
+.br
+-: non-owner cannot read
+.ti -2
+
+6 w: non-owner can write
+.br
+-: non-owner cannot write
+.in -5
+.sp
+The owner is almost always given in symbolic form;  however
+if he cannot be found in "/etc/passwd" a number is given.
+.sp
+If the number of arguments to stat\b\b\b\b____ is not exactly 1
+a header is generated identifying the fields of the status information.
+.sp
+.ti 0
+FILES          /etc/passwd
+.sp
+.ti 0
+SEE ALSO       istat(I), ls(I) (-l option)
+.sp
+.ti 0
+DIAGNOSTICS    "name?"
+for any error.
diff --git a/man/man1/strip.1 b/man/man1/strip.1
new file mode 100644 (file)
index 0000000..bffe221
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'STRIP (I)'3/15/72'STRIP (I)'
+.ti 0
+NAME           strip  --  remove symbols and relocation bits
+.sp
+.ti 0
+SYNOPSIS       strip\b\b\b\b\b_____ name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    strip\b\b\b\b\b_____ removes the symbol
+table and relocation bits ordinarily attached to the output
+of the assembler and loader.
+This is useful to save space after a program has been
+debugged.
+
+The effect of strip\b\b\b\b\b_____ is the same as use of the -s\b\b__ option
+of ld\b\b__.
+.sp
+.ti 0
+FILES          /tmp/stm?       temporary file
+.sp
+.ti 0
+SEE ALSO       ld(I), as(I)
+.sp
+.ti 0
+DIAGNOSTICS    Diagnostics are given for:
+non-existent argument;
+.br
+inability to create temporary file;
+.br
+improper format (not an object file);
+.br
+inability to re-read temporary file.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/stty.1 b/man/man1/stty.1
new file mode 100644 (file)
index 0000000..3e39cb0
--- /dev/null
@@ -0,0 +1,49 @@
+.pa 1
+.he 'STTY (I)'6/12/72'STTY (I)'
+.ti 0
+NAME           stty -- set teletype options
+.sp
+.ti 0
+SYNOPSIS       stty\b\b\b\b____ option\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    Stty\b\b\b\b____
+will set certain I/O options on the current output teletype.
+The option strings are
+selected from the following set:
+
+.in +3
+.nf
+even\b\b\b\b____   allow even parity.
+-even\b\b\b\b\b_____        disallow even parity.
+odd\b\b\b___      allow odd parity
+-odd\b\b\b\b____   disallow odd parity
+raw\b\b\b___      raw mode input
+       (no erase/kill/interrupt/quit/EOT)
+-raw\b\b\b\b____   negate raw mode
+-nl\b\b\b___      allow cr for lf (and echo lf cr)
+nl\b\b__ allow nl only
+echo\b\b\b\b____   echo back every character typed.
+-echo\b\b\b\b\b_____        do not echo characters.
+lcase\b\b\b\b\b_____        map upper case to lower case
+-lcase\b\b\b\b\b\b______     do not map case
+-tabs\b\b\b\b\b_____        replace tabs by spaces
+tabs\b\b\b\b____   preserve tabs
+delay\b\b\b\b\b_____        calculate cr and tab delays.
+-delay\b\b\b\b\b\b______     no cr/tab delays
+ebcdic\b\b\b\b\b\b______     ebcdic ball conversion (2741 only)
+corres\b\b\b\b\b\b______     correspondence ball conversion (2741 only)
+.in -3
+.sp
+.fi
+.ti 0
+FILES          standard output.
+.sp
+.ti 0
+SEE ALSO       stty(II)
+.sp
+.ti 0
+DIAGNOSTICS    "Bad options"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/sum.1 b/man/man1/sum.1
new file mode 100644 (file)
index 0000000..93ac4b3
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'SUM (I)'3/15/72'SUM (I)'
+.ti 0
+NAME           sum  --  sum file
+.sp
+.ti 0
+SYNOPSIS       sum\b\b\b___ name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    sum\b\b\b___
+sums the contents of the bytes (mod 2^16) of
+one or more files and prints the answer in octal.
+A separate sum is printed for each file specified,
+along with the number of whole or partial
+512-byte blocks read.
+
+In practice, sum\b\b\b___ is often used to verify that
+all of a special file can be read without error.
+.sp
+.ti 0
+FILES          none
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "oprd" if the file cannot be
+opened; "?" if an error is discovered during the read.
+.sp
+.ti 0
+BUGS           none
diff --git a/man/man1/tap.1 b/man/man1/tap.1
new file mode 100644 (file)
index 0000000..1453053
--- /dev/null
@@ -0,0 +1,147 @@
+.pa 1
+.he 'TAP (I)'3/15/72'TAP (I)'
+.ti 0
+NAME           tap  --  manipulate DECtape
+.sp
+.ti 0
+SYNOPSIS       tap\b\b\b___  [ key ] [ name ... ]
+.sp
+.ti 0
+DESCRIPTION    tap\b\b\b___
+saves and restores selected portions of the file system
+hierarchy on DECtape.
+Its actions are controlled by the key\b\b\b___ argument.
+The key is a string of characters containing
+at most one function letter and possibly
+one or more function modifiers.
+Other arguments to the command are file or directory
+names specifying which files are to be dumped, restored,
+or tabled.
+
+The function portion of
+the key is specified by one of the following letters:
+
+.in +6
+.ti -3
+r  The indicated files and directories, together with
+all subdirectories, are dumped
+onto the tape.
+If files with the same names
+already exist, they are replaced (hence the "r").
+"Same" is determined by string comparison, so
+"./abc" can never be the same as "/usr/dmr/abc" even
+if "/usr/dmr" is the current directory.
+If no file argument is given, "." is the default.
+
+.ti -3
+u  updates the tape.
+u\b_ is the same as r\b_, but a file is replaced only if its
+modification date is later than the date stored on the tape;
+that is to say, if it has changed since it was dumped.
+u\b_ is the default command if none is given.
+
+.ti -3
+d  deletes the named files and directories from
+the tape.  At least one file argument must be given.
+
+.ti -3
+x  extracts the named files from the tape to the file system.
+The owner, mode, and date-modified are restored to what they
+were when the file was dumped.
+If no file argument is given, the entire contents of the
+tape are extracted.
+
+.ti -3
+t  lists the names of all files stored on the tape which
+are the same as or are hierarchically below
+the file arguments.  If no file argument is given,
+the entire contents of the tape are tabled.
+
+.ti -3
+l  is the same as t\b_ except that an expanded listing
+is produced giving all the available information about the
+listed files.
+
+.in -6
+The following characters may be used in addition to the letter
+which selects the function desired.
+
+.in +6
+.ti -3
+0, ..., 7  This modifier selects the drive on which the tape is mounted.
+"0" is the default.
+
+.ti -3
+v  Normally tap\b\b\b___ does its work silently.  The v\b_ (verbose)
+option causes it to type the name of each file it treats
+preceded by a letter to indicate what is happening.
+
+.in +2
+ r  file is being replaced
+.nf
+ a  file is being added (not there before)
+.fi
+ x  file is being extracted
+ d  file is being deleted
+
+.in -2
+The v\b_ option can be used with r\b_, u\b_, d\b_, and x\b_ only.
+
+.ti -3
+c  means a fresh dump is being created; the tape directory
+will be zeroed before beginning.  Usable only with r\b_ and u\b_.
+
+.ti -3
+f  causes
+new entries copied on tape to be 'fake' in that
+no data is present for these entries.
+Such fake entries cannot be extracted.
+Usable only with r\b_ and u\b_.
+
+.ti -3
+w  causes tap\b\b\b___ to pause before treating each file, type
+the indicative letter and the file name (as with v\b_)
+and await the user's response.  Response
+"y" means "yes", so the file is treated.  Null response
+means "no", and the file does not take part
+in whatever is being done.  Response "x" means "exit";
+the tap\b\b\b___ command terminates immediately.  In the x\b_ function,
+files previously asked about
+have been extracted already.
+With r\b_, u\b_, and d\b_ no change has been made to the tape.
+
+.ti -3
+m  make (create) directories during an x\b_ if necessary.
+.in -6
+.sp
+.ti 0
+FILES          /dev/tap?
+.sp
+.ti 0
+SEE ALSO       mt(I)
+.sp
+.ti 0
+DIAGNOSTICS    Tape open error
+.br
+Tape read error
+.br
+Tape write error
+.br
+Directory checksum
+.br
+Directory overflow
+.br
+Tape overflow
+.br
+Phase error (a file has changed after it was selected for
+dumping but before it was dumped)
+.br
+.sp
+.ti 0
+BUGS           Asks
+about "fake" entries on "xw", when it should ignore
+them.
+If a fake entry is extracted, and the file already
+exists on disk, the extraction does not take
+place (as is correct), but the mode and user ID of the file
+are set to 0.
diff --git a/man/man1/time.1 b/man/man1/time.1
new file mode 100644 (file)
index 0000000..9b959f2
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'TIME (I)'10/26/72'TIME (I)'
+.ti 0
+NAME           time -- time a command
+.sp
+.ti 0
+SYNOPSIS       time\b\b\b\b____ command 
+.sp
+.ti 0
+DESCRIPTION    The 
+given command is timed; after it is complete,
+time\b\b\b\b____
+prints the time spent in the system, waiting for disk, and in execution
+of the command.
+
+The disk I/O time can be variable depending
+on other activity in the system.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       tm (VIII)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.br
+"command terminated abnormally"
+.br
+"Command not found."
diff --git a/man/man1/tmg.1 b/man/man1/tmg.1
new file mode 100644 (file)
index 0000000..64c68dd
--- /dev/null
@@ -0,0 +1,52 @@
+.pa 1
+.he 'TMG (I)'10/21/72'TMG (I)'
+.ti 0
+NAME           tmg -- compiler compiler
+.sp
+.ti 0
+SYNOPSIS       tmg\b\b\b___ name
+.sp
+.ti 0
+DESCRIPTION    tmg\b\b\b___
+produces a translator for the language whose parsing
+and translation rules are described in file name.t\b\b__.
+The new translator appears
+in a.out and may be used thus:
+.ce
+.sp
+a.out\b\b\b\b\b_____ input [ output ]
+.sp
+Except in rare cases input must be a randomly
+addressable file.
+If no output file is specified, the standard output file
+is assumed.
+.sp
+.ti 0
+FILES          /sys/tmg/tmgl.o -- the compiler-compiler
+.br
+/sys/tmg[abc] -- libraries
+.br
+alloc.d -- table storage
+.sp
+.ti 0
+SEE ALSO       A Manual for the Tmg Compiler-writing Language,
+MM-72-1271-8.
+.sp
+.ti 0
+DIAGNOSTICS    Syntactic errors result in "???" followed by the
+offending line.
+.br
+Situations such as space overflow
+with which the Tmg processor or a Tmg-produced
+processor can not cope result in a descriptive comment and 
+a dump.
+.sp
+.ti 0
+BUGS           9.2 footnote 1 is not enforced, causing trouble.
+.br
+Restrictions (7.) against mixing bundling primitives
+should be lifted.
+.br
+Certain hidden reserved words exist: gpar, classtab, trans.
+.br
+Octal digits include 8=10 and 9=11.
diff --git a/man/man1/tss.1 b/man/man1/tss.1
new file mode 100644 (file)
index 0000000..bec3e9d
--- /dev/null
@@ -0,0 +1,65 @@
+.pa 1
+.he 'TSS (I)'3/15/72'TSS (I)'
+.ti 0
+NAME           tss -- interface to Honeywell TSS
+.sp
+.ti 0
+SYNOPSIS       tss\b\b\b___
+.sp
+.ti 0
+DESCRIPTION    tss\b\b\b___
+will call the Honeywell 6070 on
+the 201 data phone.
+It will then go into direct access with
+TSS.
+Output generated by TSS is typed on the standard output and
+input requested by TSS is read from the standard input
+with UNIX typing conventions.
+
+An interrupt signal (ASCII DEL)
+is transmitted
+as a "break" to TSS.
+
+Input lines beginning with !\b_ are interpreted as UNIX
+commands.
+Input lines beginning with ~\b_ are interpreted as commands
+to the interface routine.
+.sp
+~<file insert input from named UNIX file
+.sp
+~>file deliver tss output to named UNIX file
+.sp
+~p     pop the output file
+.sp
+~q     disconnect from tss (quit)
+.sp
+~r file        receive from HIS routine CSR/DACCOPY
+.sp
+~s file        send file to HIS routine CSR/DACCOPY
+.sp
+Ascii files may be most efficiently transmitted using
+the HIS routine CSR/DACCOPY
+in this fashion.
+Underlined text comes from TSS.
+AFTname is the 6070 file to be dealt with.
+.sp
+       SYSTEM\b\b\b\b\b\b______?\b_ CSR/DACCOPY (s) AFTname
+       Send Encoded File\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b_________________ ~s file
+
+       SYSTEM\b\b\b\b\b\b______? CSR/DACCOPY (r) AFTname
+       Receive Encoded File\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b____________________ ~r file
+.sp
+.ti 0
+FILES          /dev/dn0,
+/dev/dp0
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    DONE when communication is broken.
+.sp
+.ti 0
+BUGS           When
+diagnostic problems occur,
+tss\b\b\b___ exits rather abruptly.
diff --git a/man/man1/tty.1 b/man/man1/tty.1
new file mode 100644 (file)
index 0000000..2027545
--- /dev/null
@@ -0,0 +1,24 @@
+.pa 1
+.he 'TTY (I)'3/15/72'TTY (I)'
+.ti 0
+NAME           tty  --  get tty name
+.sp
+.ti 0
+SYNOPSIS       tty\b\b\b___
+.sp
+.ti 0
+DESCRIPTION    tty\b\b\b___ gives the name of the user's typewriter
+in the form "ttyn" for n\b_ a digit.  The actual path
+name is then "/dev/ttyn".
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "not a tty" if the standard input file is not a typewriter.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/type.1 b/man/man1/type.1
new file mode 100644 (file)
index 0000000..fe4cdfc
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'TYPE (I)'6/12/72'TYPE (I)'
+.ti 0
+NAME           type  --  type on single sheet paper
+.sp
+.ti 0
+SYNOPSIS       type\b\b\b\b____ file\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    type\b\b\b\b____
+copies its input files to the standard output.
+Before each new page (66 lines) and before each new file,
+type stops and reads the standard input
+for a new line character before continuing.
+This allows time for insertion of single
+sheet paper.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/typo.1 b/man/man1/typo.1
new file mode 100644 (file)
index 0000000..f0a9b65
--- /dev/null
@@ -0,0 +1,45 @@
+.pa 1
+.he 'TYPO (I)'1/15/73'TYPO (I)'
+.ti 0
+NAME           typo -- find possible typo's
+.sp
+.ti 0
+SYNOPSIS       typo\b\b\b\b____ [ -\b_ ] file\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    typo hunts through a document for unusual
+words, typographic errors, and hapax legomena and prints
+them on the standard output.
+.sp
+All words used in the document are printed
+out in decreasing order of peculiarity along
+with an index of peculiarity.  An index of 10
+or more is considered peculiar.  Printing of
+certain very common English words is suppressed.
+.sp
+The statistics for judging words are taken from
+the document itself; with some help from known
+statistics of English.  The "-" option suppresses
+the help from English and should be used if the
+document is written in, for example, Urdu.
+.sp
+Roff and Nroff control lines are ignored.
+Upper case is mapped into lower case.
+Quote marks, vertical bars, hyphens, and ampersands are stripped from
+within words.
+Words hyphenated across lines are put back together.
+.sp
+.ti 0
+FILES          /tmp/ttmp??, /etc/salt, /etc/w2006
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    yes, lots
+.sp
+.ti 0
+BUGS           Because
+of the mapping into lower case and the stripping
+of special characters, words
+may be hard to locate in the original text.
diff --git a/man/man1/un.1 b/man/man1/un.1
new file mode 100644 (file)
index 0000000..aa9634c
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'UN (I)'3/15/72'UN (I)'
+.ti 0
+NAME           un  --  undefined symbols
+.sp
+.ti 0
+SYNOPSIS       un\b\b__ [ name ]
+.sp
+.ti 0
+DESCRIPTION    un\b\b__
+prints a list of undefined symbols from an assembly
+or loader run.
+If the file argument is not specified, a.out\b\b\b\b\b_____ is the default.
+Names are listed alphabetically except that non-global
+symbols come first.  Undefined global
+symbols (unresolved external references) have their
+first character underlined.
+.sp
+.ti 0
+FILES          a.out
+.sp
+.ti 0
+SEE ALSO       as(I), ld(I)
+.sp
+.ti 0
+DIAGNOSTICS    "?" if the file cannot be found.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/uniq.1 b/man/man1/uniq.1
new file mode 100644 (file)
index 0000000..a5a620a
--- /dev/null
@@ -0,0 +1,51 @@
+.pa 1
+.he 'UNIQ (I)'12/1/72'UNIQ (I)'
+.ti 0
+NAME           uniq -- report repeated lines in a file
+.sp
+.ti 0
+SYNOPSIS       uniq\b\b\b\b____ [ -ud\b\b\b___ ]  [ input [ output ] ]
+.sp
+.ti 0
+DESCRIPTION    uniq\b\b\b\b____
+reads the input
+file comparing adjacent lines.
+In the normal case, the second and succeeding copies
+of repeated lines are
+removed; the remainder is written on the output file.
+Note that repeated lines must be adjacent
+in order to be found.
+(See sort(I))
+If the -u\b\b__ flag is used,
+just the lines that are not repeated
+in the original file are output.
+The -d\b\b__ option specifies that
+one copy of just the repeated lines is to
+be written.
+Note that the normal mode output is the union of the
+-u\b\b__ and -d\b\b__ mode outputs.
+.sp
+The following example will print one copy of all
+lines in the file a\b_ that do not occur in b\b_:
+.sp
+       sort a x
+       uniq x a1
+       sort b x
+       uniq x b1
+       cat a1 b1 >x
+       sort x
+       uniq -u x >>a1
+       sort a1
+       uniq -d a1
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sort(I)
+.sp
+.ti 0
+DIAGNOSTICS    "cannot open input", "cannot create output"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/vs.1 b/man/man1/vs.1
new file mode 100644 (file)
index 0000000..383cd8e
--- /dev/null
@@ -0,0 +1,44 @@
+.he 'VS (I)'2/13/73'VS(I)'
+.ti0
+NAME           vs -- phoneme list to voice synthesizer
+.sp
+.ti0
+SYNOPSIS       vs\b\b__
+.sp
+.ti0
+DESCRIPTION    vs\b\b__
+accepts phoneme descriptor lists and translates them into
+byte strings suitable for the Federal Screw Works Voice
+Synthesizer.
+Phoneme descritors should be separated by commas and
+have the general form "%NIxx"
+where "xx" is a one or two character phoneme name,
+"I" is an optional inflection parameter,
+and "%N" is an optional count of the number of times
+the phoneme is to be repeated (maximum 9).
+"I" can have the values 0, 1, 2, 3 representing decreasing
+strength (default is 2).
+A description of the phonemes and their names can be
+found in the file vsp\b\b\b___(VII).
+For example,
+.in +5
+.sp
+a0,o1,t,r,1ai,1ay,d,j,ih,u1,%2s
+.sp
+.in-5
+will generate the word "outrageous".
+The output is buffered;
+a newline will cause the buffered output to be
+sent to the Voice Synthesizer.
+.sp
+.ti0
+FILES          -
+.sp
+.ti0
+SEE ALSO       vsp(VII), speak(I)
+.sp
+.ti0
+DIAGONOSTICS   -
+.sp
+.ti0
+BUGS           -
diff --git a/man/man1/wc.1 b/man/man1/wc.1
new file mode 100644 (file)
index 0000000..6631ae6
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'WC (I)'3/15/72'WC (I)'
+.ti 0
+NAME           wc -- get (English) word count
+.sp
+.ti 0
+SYNOPSIS       wc\b\b__ name\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    wc\b\b__
+provides a count of the words, text lines, and control lines for
+each argument file.
+
+A text line is a sequence of characters not beginning with ".",
+"!" or "'"
+and ended by a new-line.
+A control line is a line beginning with ".",
+"!" or "'".
+A word is a sequence of characters bounded by the beginning
+of a line, by the end of a line, or by a blank or a tab.
+
+When
+there is more than one input file,
+a grand total is also printed.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       roff(I)
+.sp
+.ti 0
+DIAGNOSTICS    none; arguments not found are ignored.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/who.1 b/man/man1/who.1
new file mode 100644 (file)
index 0000000..61dd392
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'WHO (I)'3/15/72'WHO (I)'
+.ti 0
+NAME           who  --  who is on the system
+.sp
+.ti 0
+SYNOPSIS       who\b\b\b___ [ who-file ]
+.sp
+.ti 0
+DESCRIPTION    who\b\b\b___, without an argument,
+lists the name, typewriter channel, and login time
+for each current UNIX user.
+
+Without an argument,
+who\b\b\b___ examines the /tmp/utmp\b\b\b\b\b\b\b\b\b_________
+file to obtain its information.
+If a file is given, that file is examined.
+Typically the given file will be /tmp/wtmp\b\b\b\b\b\b\b\b\b_________,
+which contains a record of all the logins since it
+was created.
+Then who\b\b\b___ will list
+logins, logouts, and crashes since the creation of
+the wtmp file.
+
+Each login is listed with user name, last character
+of input device name (with /dev/tty\b\b\b\b\b\b\b\b________ suppressed),
+date and time.
+Certain logouts produce a similar line without a user name.
+Reboots produce a line with "x" in the place of the device name,
+and a fossil time indicative of when the system went down.
+.sp
+.ti 0
+FILES          /tmp/utmp
+.sp
+.ti 0
+SEE ALSO       login(I), init(VII)
+.sp
+.ti 0
+DIAGNOSTICS    "?" if a named file cannot be read.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man1/write.1 b/man/man1/write.1
new file mode 100644 (file)
index 0000000..b60ddca
--- /dev/null
@@ -0,0 +1,62 @@
+.pa 1
+.he 'WRITE (I)'3/15/72'WRITE (I)'
+.ti 0
+NAME           write  --  write to another user
+.sp
+.ti 0
+SYNOPSIS       write\b\b\b\b\b_____ user
+.sp
+.ti 0
+DESCRIPTION    write\b\b\b\b\b_____ copies lines from your typewriter to that of
+another user.  When first called, write\b\b\b\b\b_____ sends the message
+.sp
+     message from yourname...
+.sp
+The recipient of the message should write back at this point.
+Communication continues until an end of file is
+read from the typewriter or an interrupt is sent.
+At that point write\b\b\b\b\b_____ writes "EOT" on the other terminal.
+.sp
+Permission to write may be denied or granted by use of the mesg\b\b\b\b____
+command.
+At the outset writing is allowed.
+Certain commands, in particular roff\b\b\b\b____ and pr\b\b__, disallow
+messages in order to prevent messy output.
+
+If the character "!" is found at the beginning of a line,
+write\b\b\b\b\b_____ calls the mini-shell msh\b\b\b___ to execute the rest of the
+line as a command.
+
+The following protocol is suggested for using write\b\b\b\b\b_____:
+When you first write to another user, wait for him to
+write back before starting to send.
+Each party should end each message with a distinctive
+signal ("(o)" for "over" is conventional) that the other may reply.
+"(oo)" (for "over and out") is suggested when conversation
+is about to be terminated.
+
+.ti 0
+FILES          /tmp/utmp       to find user
+.br
+/etc/msh       to execute !
+.sp
+.ti 0
+SEE ALSO       mesg(I), msh(VII)
+.sp
+.ti 0
+DIAGNOSTICS    "user not logged in"; "permission denied".
+.sp
+.ti 0
+BUGS           write\b\b\b\b\b_____
+should check the mode of the other user's typewriter
+and refuse to proceed unless non-user
+write permission is given.
+Currently it is possible to write to another
+person with the same user-ID even though
+he has forbidden messages.
+
+write\b\b\b\b\b_____ should also allow specification of
+the typewriter name of a user who
+is logged in several times instead
+of picking out the instance with the
+lowest name.
diff --git a/man/man2/boot.2 b/man/man2/boot.2
new file mode 100644 (file)
index 0000000..9e93643
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'BOOT (II)'7/29/72'BOOT (II)'
+.ti 0
+NAME           boot -- reboot UNIX
+.sp
+.ti 0
+SYNOPSIS       sys boot        / boot = 39. not in assembler
+.sp
+.ti 0
+DESCRIPTION    UNIX
+will clean up outstanding I\/O, and then execute
+the reboot read-only program.
+This call is restricted to the super-user.
+All users will be logged out.
+.sp
+.ti 0
+SEE ALSO       boot procedures (VII)
+.sp
+.ti 0
+DIAGNOSTICS    the c-bit is set if you are
+not the super-user
+.sp
+.ti 0
+BUGS           It
+often doesn't work (for unknown reasons).
+.br
+It depends on switch settings.
diff --git a/man/man2/break.2 b/man/man2/break.2
new file mode 100644 (file)
index 0000000..a838263
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'BREAK (II)'3/15/72'BREAK (II)'
+.ti 0
+NAME           break  --  set program break
+.sp
+.ti 0
+SYNOPSIS       sys break; addr  / break = 17.
+.sp
+.ti 0
+DESCRIPTION    break\b\b\b\b\b_____
+sets the system's idea of the highest location used by the program
+to addr\b\b\b\b____.  Locations greater than addr\b\b\b\b____ and below the stack pointer
+are not swapped and are thus liable to unexpected modification.
+.sp
+An argument of 0 is taken to mean 16K bytes.
+If the argument is higher than the stack pointer the
+entire user core area is swapped.
+.sp
+When a program begins execution via exec\b\b\b\b____
+the break is set at the
+highest location defined by the program
+and data storage areas.
+Ordinarily, therefore, only programs with growing
+data areas need to use break\b\b\b\b\b_____.
+.sp
+.ti 0
+SEE ALSO       exec(II)
+.sp
+.ti 0
+DIAGNOSTICS    none; strange addresses cause the break to be
+set at 16K bytes.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/cemt.2 b/man/man2/cemt.2
new file mode 100644 (file)
index 0000000..4d03c41
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'CEMT (II)'9/4/72'CEMT (II)'
+.ti 0
+NAME           cemt  --  catch emt traps
+.sp
+.ti 0
+.nf
+SYNOPSIS       sys cemt; arg  / cemt = 29.
+.fi
+.sp
+.ti 0
+DESCRIPTION    This call
+allows one to catch traps resulting from
+the emt\b\b\b___ instruction.
+Arg\b\b\b___ is a location within the program; emt\b\b\b___ traps
+are sent to that location.
+The normal effect of emt\b\b\b___ traps may be restored by giving
+an arg\b\b\b___ equal to 0.
+.sp
+To return after catching the emt\b\b\b___
+trap, execute the rti\b\b\b___ instruction.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/chdir.2 b/man/man2/chdir.2
new file mode 100644 (file)
index 0000000..04beefc
--- /dev/null
@@ -0,0 +1,24 @@
+.pa 1
+.he 'CHDIR (II)'3/15/72'CHDIR (II)'
+.ti 0
+NAME           chdir  --  change working directory
+.sp
+.ti 0
+SYNOPSIS       sys chdir; dirname  / chdir = 12.
+.sp
+.ti 0
+DESCRIPTION    dirname\b\b\b\b\b\b\b_______
+is the address of the pathname of a directory, terminated by a 0 byte.
+chdir\b\b\b\b\b_____ causes this directory
+to become the current working directory.
+.sp
+.ti 0
+SEE ALSO       chdir(I)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit (c-bit)
+is set if the given name is not that of a directory
+or is not readable.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/chmod.2 b/man/man2/chmod.2
new file mode 100644 (file)
index 0000000..f456bec
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'CHMOD (II)'3/15/72'CHMOD (II)'
+.ti 0
+NAME           chmod  --  change mode of file
+.sp
+.ti 0
+SYNOPSIS       sys chmod; name; mode  / chmod = 15.
+.sp
+.ti 0
+DESCRIPTION    The file whose name
+is given as the null-terminated string pointed to by name\b\b\b\b____
+has its mode changed to mode\b\b\b\b____.
+Modes are constructed by or\b\b__ing together some
+combination of the following:
+.sp
+.in +3
+ 01 write, non-owner
+ 02 read, non-owner
+ 04 write, owner
+ 10 read, owner
+ 20 executable
+ 40 set user ID on execution
+.in -3
+.sp
+Only the owner of a file (or the super-user) may change the mode.
+.sp
+.ti 0
+SEE ALSO       chmod(I)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit
+(c-bit) set if name\b\b\b\b____ cannot be found or if current user
+is neither the owner of the file nor the super-user.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/chown.2 b/man/man2/chown.2
new file mode 100644 (file)
index 0000000..73702ee
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'CHOWN (II)'3/15/72'CHOWN (II)'
+.ti 0
+NAME           chown  --  change owner of file
+.sp
+.ti 0
+SYNOPSIS       sys chown; name; owner  / chown = 16.
+.sp
+.ti 0
+DESCRIPTION    The file
+whose name is given by the null-terminated string pointed
+to by name\b\b\b\b____ has its owner changed to owner\b\b\b\b\b_____.
+Only the present owner of a file (or the super-user) may
+donate the file to another user.  Also, one may not
+change the owner of a file with the set-user-ID bit
+on, otherwise one could create Trojan Horses.
+.sp
+.ti 0
+SEE ALSO       chown(I), uids(V)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit (c-bit) is set
+on illegal owner changes.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/close.2 b/man/man2/close.2
new file mode 100644 (file)
index 0000000..b5d74fb
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'CLOSE (II)'3/15/72'CLOSE (II)'
+.ti 0
+NAME           close  --  close a file
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys close  / close = 6.
+.sp
+.ti 0
+DESCRIPTION    Given
+a file descriptor such as returned from an open or creat call,
+close\b\b\b\b\b_____ closes the associated file.
+A close of all files is automatic on exit, but since
+processes are limited to 10 simultaneously open files,
+close\b\b\b\b\b_____ is necessary for programs which deal with many files.
+.sp
+.ti 0
+SEE ALSO       creat(II), open(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set for an unknown file descriptor.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/creat.2 b/man/man2/creat.2
new file mode 100644 (file)
index 0000000..89025e0
--- /dev/null
@@ -0,0 +1,45 @@
+.pa 1
+.he 'CREAT (II)'3/15/72'CREAT (II)'
+.ti 0
+NAME           creat  --  create a new file
+.sp
+.ti 0
+SYNOPSIS       sys     creat; name; mode       / creat = 8.
+.br
+(file descriptor in r0)
+.sp
+.ti 0
+DESCRIPTION    creat\b\b\b\b\b_____
+creates a new file or prepares to rewrite an existing
+file called name\b\b\b\b____;
+name\b\b\b\b____ is the address of a null-terminated string.
+If the file did not exist, it is given mode mode\b\b\b\b____;
+if it did exist, its mode and owner remain unchanged
+but it is truncated to 0 length.
+.sp
+The file is also opened for writing, and its file descriptor
+is returned in r0.
+.sp
+The mode\b\b\b\b____ given is arbitrary; it need not allow
+writing.
+This feature is used by programs which deal with temporary
+files of fixed names.  The creation is done with
+a mode that forbids writing.  Then if a second
+instance of the program attempts a creat\b\b\b\b\b_____, an error is
+returned and the program knows that the name is unusable
+for the moment.
+.sp
+.ti 0
+SEE ALSO       write(II), close(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) may be set if: a needed directory is not readable;
+the file does not exist and the directory
+in which it is to be created is not writable; the file
+does exist and is unwritable;
+the file is a directory;
+there are already 10 files open.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/csw.2 b/man/man2/csw.2
new file mode 100644 (file)
index 0000000..d8f1cf5
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'CSW (II)'7/29/72'CSW (II)'
+.ti 0
+NAME           csw -- read console switches
+.sp
+.ti 0
+SYNOPSIS       sys csw / csw = 38. not in assembler
+.br
+(value of csw in r0)
+.br
+(value of buttons in r1)
+.sp
+.ti 0
+DESCRIPTION    The setting of
+the console switches is returned in r0.
+The setting of the
+external buttons is returned in r1.
+.a
+The return is synced to
+a 30 CPS clock for graphical applications.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    none
+.sp
+.ti 0
+BUGS           Currently the buttons are unavailable.
diff --git a/man/man2/dup.2 b/man/man2/dup.2
new file mode 100644 (file)
index 0000000..e8c7c8b
--- /dev/null
@@ -0,0 +1,54 @@
+.pa 1
+.he 'DUP (II)'1/15/73'DUP (II)'
+.ti 0
+NAME           dup -- duplicate an open file descriptor
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys dup        / dup = 41.; not in assembler
+.br
+(file descriptor in r0)
+.sp
+.ti 0
+DESCRIPTION    Given
+a file descriptor returned from
+an open or creat call,
+dup\b\b\b___
+will allocate another file descriptor
+synonymous
+with
+the original.
+The new file descriptor is returned in r0.
+.sp
+Dup\b\b\b___
+is used more to manipulate the value
+of file descriptors
+than to genuinely
+duplicate a file descriptor.
+Since the algorithm to allocate
+file descriptors
+is known to use the
+lowest available
+value between 0 and 9,
+combinations of dup\b\b\b___
+and close\b\b\b\b\b_____ can be
+used to
+manipulate file descriptors
+in a general way.
+This is handy for
+manipulating standard input and/or
+standard output.
+.sp
+.ti 0
+SEE ALSO       creat(II), open(II), close(II)
+.sp
+.ti 0
+DIAGNOSTICS    The
+error bit (c-bit)
+is set if:
+the given file descriptor is invalid;
+there are already 10 open files.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/exec.2 b/man/man2/exec.2
new file mode 100644 (file)
index 0000000..949ce26
--- /dev/null
@@ -0,0 +1,88 @@
+.pa 1
+.he 'EXEC (II)'3/15/72'EXEC (II)'
+.ti 0
+NAME           exec  --  execute a file
+.sp
+.ti 0
+SYNOPSIS       sys exec; name; args  / exec = 11.
+.br
+.li
+...
+.ti -6
+name: <...\\0>
+.br
+.li
+...
+.ti -6
+args: arg1; arg2; ...; 0
+.ti -6
+arg1: <...\\0>
+.br
+.li
+...
+.sp
+.ti 0
+DESCRIPTION    exec\b\b\b\b____
+overlays the calling process with the named file, then
+transfers to the
+beginning of the core image of the file.
+The first argument to exec\b\b\b\b____ is a pointer to the name of the file
+to be executed.
+The second is the address of a list of pointers to
+arguments to be passed to the file.
+Conventionally, the first argument is the name of the
+file.
+Each pointer addresses a string terminated by a null byte.
+.sp
+There can be no return from the file; the calling core image
+is lost.
+
+The program break is set from the executed file; see the format
+of a.out.
+
+Once the called file starts execution, the arguments are available
+as follows.
+The stack pointer points to a word containing the number of arguments.  Just above
+this number is a list of pointers to the argument strings.
+
+  sp-> nargs
+       arg1
+       ...
+       argn
+
+ arg1: <arg1\\0>
+       ...
+ argn: <argn\\0>
+
+The arguments are placed as high as possible in core:
+just below 57000(8).
+
+Files remain open across
+exec\b\b\b\b____ calls.  However, the illegal instruction, emt\b\b\b___, quit, and interrupt trap
+specifications are reset to the standard values.
+(See ilgins\b\b\b\b\b\b______, cemt\b\b\b\b____, quit\b\b\b\b____, intr\b\b\b\b____.)
+
+Each user has a real\b\b\b\b____ user ID and an effective\b\b\b\b\b\b\b\b\b_________ user ID
+(The real ID identifies the person using the system;
+the effective ID determines his access privileges.)
+exec\b\b\b\b____ changes the effective user ID to
+the owner of the executed file if the file has the "set-user-ID"
+mode.  The real user ID is not affected.
+.sp
+.ti 0
+SEE ALSO       fork(II)
+.sp
+.ti 0
+DIAGNOSTICS    If
+the file cannot be read or if it is not executable, a return
+from exec\b\b\b\b____ constitutes the diagnostic.
+The error bit (c-bit) is set.
+.sp
+.ti 0
+BUGS           Very high core and
+very low core are used by exec\b\b\b\b____
+to construct the argument list
+for the new core image.
+If the original copies of the
+arguments reside in these places,
+problems can result.
diff --git a/man/man2/exit.2 b/man/man2/exit.2
new file mode 100644 (file)
index 0000000..551ffd1
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'EXIT (II)'3/15/72'EXIT (II)'
+.ti 0
+NAME           exit  --  terminate process
+.sp
+.ti 0
+SYNOPSIS       (status in r0)
+.br
+sys exit  / exit = 1
+.sp
+.ti 0
+DESCRIPTION    exit\b\b\b\b____
+is the normal means of terminating a process.
+Exit closes all the process' files and notifies the parent process
+if it is executing a wait\b\b\b\b____.
+The low byte of r0
+is available as status to the parent process.
+.sp
+This call can never return.
+.sp
+.ti 0
+SEE ALSO       wait(II)
+.sp
+.ti 0
+DIAGNOSTICS    -
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/fork.2 b/man/man2/fork.2
new file mode 100644 (file)
index 0000000..300c1de
--- /dev/null
@@ -0,0 +1,32 @@
+.pa 1
+.he 'FORK (II)'3/15/72'FORK (II)'
+.ti 0
+NAME           fork  --  spawn new process
+.sp
+.ti 0
+SYNOPSIS       sys fork  / fork = 2.
+.br
+(new process return)
+.br
+(old process return)
+.sp
+.ti 0
+DESCRIPTION    fork\b\b\b\b____
+is the only way new processes are created.
+The new process's core image is a copy of
+that of the caller of fork\b\b\b\b____; the only distinction
+is the return location and the fact
+that r0 in the old process contains the process ID
+of the new process.
+This process ID is used by wait\b\b\b\b____.
+.sp
+.ti 0
+SEE ALSO       wait(II), exec(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set in the old process if a new process
+could not be created because of lack of process space.
+.sp
+.ti 0
+BUGS           See wait(II) for a subtile bug in process destruction.
diff --git a/man/man2/fpe.2 b/man/man2/fpe.2
new file mode 100644 (file)
index 0000000..1da9968
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'FPE (II)'9/2/72'FPE (II)'
+.ti 0
+NAME           fpe -- set floating exception handling
+.sp
+.ti 0
+SYNOPSIS       sys fpe; arg / fpe = 40. not in assembler
+.sp
+.ti 0
+DESCRIPTION    This call
+allows one to catch traps resulting from
+floating point exceptions.
+Arg\b\b\b___ is a location within the program; floating exception traps
+are sent to that location.
+The normal effect of floating exception traps may be restored by giving
+an arg\b\b\b___ equal to 0.
+.sp
+To return after catching the
+fpe\b\b\b___
+trap, execute the rti\b\b\b___ instruction.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           The
+floating point exception (FEC) register
+is not saved per process.
+Examining this register for possible
+remedial action after a floating point
+exception trap is not guaranteed to work.
diff --git a/man/man2/fstat.2 b/man/man2/fstat.2
new file mode 100644 (file)
index 0000000..d731f75
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'FSTAT (II)'3/15/72'FSTAT (II)'
+.ti 0
+NAME           fstat  --  get status of open file
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys fstat; buf  / fstat = 28.
+.sp
+.ti 0
+DESCRIPTION    This
+call is identical to stat\b\b\b\b____, except that it operates
+on open files instead of files given by name.
+It is most often used to get the status
+of the standard input and output files, whose names
+are unknown.
+.sp
+.ti 0
+SEE ALSO       stat(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set if the file descriptor is unknown.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/getuid.2 b/man/man2/getuid.2
new file mode 100644 (file)
index 0000000..eb3a3dd
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'GETUID (II)'3/15/72'GETUID (II)'
+.ti 0
+NAME           getuid  --  get user identification
+.sp
+.ti 0
+SYNOPSIS       sys getuid  / getuid = 24.
+.br
+(user ID in r0)
+.sp
+.ti 0
+DESCRIPTION    getuid\b\b\b\b\b\b______ returns
+the real user ID of
+the current process.
+The real user ID identifies the person who is logged in,
+in con\ 6tra\ 6dis\ 6tinc\ 6tion to the effective user ID, which
+determines his access permission at each moment.
+It is thus useful to programs which operate using
+the "set user ID" mode, to find out who invoked them.
+.sp
+.ti 0
+.ti 0
+SEE ALSO       setuid(II)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/gtty.2 b/man/man2/gtty.2
new file mode 100644 (file)
index 0000000..0f265f6
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'GTTY (II)'3/15/72'GTTY (II)'
+.ti 0
+NAME           gtty  --  get typewriter status
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys gtty; arg  / gtty = 32.
+.br
+.li
+...
+.ti -5
+arg: .=.+6
+.sp
+.ti 0
+DESCRIPTION    gtty\b\b\b\b____
+stores in the three words addressed by arg\b\b\b___ the status
+of the typewriter whose file descriptor is given in r0.
+The format is the same as that passed by stty\b\b\b\b____.
+.sp
+.ti 0
+SEE ALSO       stty(II)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit
+(c-bit) is set if the file descriptor does not refer
+to a typewriter.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/ilgins.2 b/man/man2/ilgins.2
new file mode 100644 (file)
index 0000000..5ced8f8
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'ILGINS (II)'3/15/72'ILGINS (II)'
+.ti 0
+NAME           ilgins  --  catch illegal instruction trap
+.sp
+.ti 0
+SYNOPSIS       sys ilgins; arg  / ilgins = 33.
+.sp
+.ti 0
+DESCRIPTION    ilgins\b\b\b\b\b\b______
+allows a program to catch illegal instruction traps.
+If arg\b\b\b___
+is zero, the normal instruction trap handling is done:
+the process is terminated and a core image is produced.
+If arg\b\b\b___
+is a location within the program, control
+is passed to arg\b\b\b___ when the trap occurs.
+.sp
+This call is used to implement the floating point simulator,
+which catches and interprets 11/45 floating point
+instructions.
+.sp
+To return after catching the
+ilgins\b\b\b\b\b\b______
+trap, execute the rti\b\b\b___ instruction.
+.sp
+.ti 0
+SEE ALSO       PDP-11 manual
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/intr.2 b/man/man2/intr.2
new file mode 100644 (file)
index 0000000..0cf8a06
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'INTR (II)'3/15/72'INTR (II)'
+.ti 0
+NAME           intr  --  set interrupt handling
+.sp
+.ti 0
+SYNOPSIS       sys intr; arg  / intr = 27.
+.sp
+.ti 0
+DESCRIPTION    When arg\b\b\b___ is 0,
+interrupts (ASCII DELETE) are ignored.
+When arg\b\b\b___ is 1,
+interrupts cause their normal result, that is, force an exit\b\b\b\b____.
+When arg\b\b\b___ is a location within the program, control is
+transferred to that location when an interrupt occurs.
+.sp
+After an interrupt is caught, it is possible to resume
+execution by means of an rti\b\b\b___ instruction; however, great
+care must be exercised, since
+all I/O is terminated abruptly upon an interrupt.
+In particular, reads of the typewriter tend to return
+with 0 characters read, thus simulating an end of file.
+.sp
+.ti 0
+SEE ALSO       quit(II)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/kill.2 b/man/man2/kill.2
new file mode 100644 (file)
index 0000000..e59642b
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'KILL (II)'6/12/72'KILL (II)'
+.ti 0
+NAME           kill -- destroy process
+.sp
+.ti 0
+SYNOPSIS       (process number in r0)
+.br
+sys kill  / kill = 37.; not in assembler
+.sp
+.ti 0
+DESCRIPTION    kill\b\b\b\b____
+destroys a process, given its process number.
+The process leaves a core image.
+
+This call is restricted to the super-user,
+and is intended only to kill an otherwise
+unstoppable process.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    c-bit set
+if user is not the super-user, or if process does not exist.
+.sp
+.ti 0
+BUGS           Under
+strange circumstances, kill\b\b\b\b____ is ineffective.
diff --git a/man/man2/link.2 b/man/man2/link.2
new file mode 100644 (file)
index 0000000..bea9360
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'LINK (II)'3/15/72'LINK (II)'
+.ti 0
+NAME           link -- link to a file
+.sp
+.ti 0
+SYNOPSIS       sys link; name\d1\u; name\d2\u  / link = 9.
+.sp
+.ti 0
+DESCRIPTION    A link
+to name\b\b\b\b____\d1\u is created; the link has name name\b\b\b\b____\d2\u.
+Either name may be an arbitrary path name.
+.sp
+.ti 0
+SEE ALSO       link(I), unlink(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set when name\b\b\b\b____\d1\u
+cannot be found; when name\b\b\b\b____\d2\u
+already exists; when the directory of name\b\b\b\b____\d2\u
+cannot be written; when
+an attempt is made to link to a directory by a user other than the super-user.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/makdir.2 b/man/man2/makdir.2
new file mode 100644 (file)
index 0000000..bd145d6
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'MAKDIR (II)'3/15/72'MAKDIR (II)'
+.ti 0
+NAME           makdir  --  make a directory
+.sp
+.ti 0
+SYNOPSIS       sys  makdir; name; mode  / makdir = 14.
+.sp
+.ti 0
+DESCRIPTION    makdir\b\b\b\b\b\b______ creates an empty directory
+whose name is the null-terminated string pointed
+to by name\b\b\b\b____.
+The mode of the directory is mode\b\b\b\b____.
+The special entries "." and ".." are not present.
+.sp
+makdir\b\b\b\b\b\b______ may be invoked only by the super-user.
+.sp
+.ti 0
+SEE ALSO       mkdir(I)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit (c-bit)
+is set if the directory already exists
+or if the user is not the super-user.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/mdate.2 b/man/man2/mdate.2
new file mode 100644 (file)
index 0000000..a6331f6
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'MDATE (II)'3/15/72'MDATE (II)'
+.ti 0
+NAME           mdate  --  set modified date on file
+.sp
+.ti 0
+SYNOPSIS       (time to r0-r1)
+.br
+.nf
+sys mdate; file  / mdate = 30.
+.fi
+.sp
+.ti 0
+DESCRIPTION    File\b\b\b\b____
+is the address of a null-terminated string giving the
+name of a file.
+The modified time of the file is set to the time given in
+the r0-r1 registers.
+.sp
+This call is allowed only to the super-user
+or to the owner of the file.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    Error bit
+is set if the user is neither the owner nor the super-user or if the file cannot be found.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/mount.2 b/man/man2/mount.2
new file mode 100644 (file)
index 0000000..7f0a9e0
--- /dev/null
@@ -0,0 +1,38 @@
+.pa 1
+.he 'MOUNT (II)'3/15/72'MOUNT (II)'
+.ti 0
+NAME           mount  --  mount file system
+.sp
+.ti 0
+.nf
+SYNOPSIS       sys  mount; special; name  / mount = 21.
+.fi
+.sp
+.ti 0
+DESCRIPTION    mount\b\b\b\b\b_____
+announces to the system that a removable file system has
+been mounted on special file special\b\b\b\b\b\b\b_______;
+from now on, references to file name\b\b\b\b____ will refer to
+the root file on the newly mounted file system.
+Special\b\b\b\b\b\b\b_______ and name\b\b\b\b____ are pointers to null-terminated strings
+containing the appropriate path names.
+
+Name\b\b\b\b____ must exist already.  If it had contents,
+they are inaccessible while the file system
+is mounted.
+.sp
+.ti 0
+SEE ALSO       mount(I), umount(II)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit
+(c-bit) set if: special\b\b\b\b\b\b\b_______ is inaccessible; name\b\b\b\b____
+does not exist;
+special\b\b\b\b\b\b\b_______ is already mounted;
+name\b\b\b\b____ is not on the RF;
+there are already four special files mounted.
+.sp
+.ti 0
+BUGS           At most
+four removable devices can be mounted at a time.
+This call should be restricted to the super-used.
diff --git a/man/man2/nice.2 b/man/man2/nice.2
new file mode 100644 (file)
index 0000000..a4fe2ba
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'NICE (II)'3/15/72'NICE (II)'
+.ti 0
+NAME           nice -- set program in low priority
+.sp
+.ti 0
+SYNOPSIS       sys nice  / nice = 34.
+.sp
+.ti 0
+DESCRIPTION    The
+currently executing process is set into
+the lowest priority execution queue.
+Background jobs that execute a very long
+time should do this.
+Once done,
+there is no way to restore
+a process to normal
+priority.
+.sp
+.ti 0
+SEE ALSO       formerly known as "hog"
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/open.2 b/man/man2/open.2
new file mode 100644 (file)
index 0000000..475eb76
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'OPEN (II)'3/15/72'OPEN (II)'
+.ti 0
+NAME           open  --  open for reading or writing
+.sp
+.ti 0
+SYNOPSIS       sys open; name; mode  / open = 5.
+.br
+(descriptor in r0)
+.sp
+.ti 0
+DESCRIPTION    open\b\b\b\b____ opens the file name\b\b\b\b____ for reading
+(if mode\b\b\b\b____ is 0) or writing (if mode\b\b\b\b____ is non-zero).
+name\b\b\b\b____ is the address of a string of ASCII characters representing
+a path name, terminated by a null character.
+.sp
+The file descriptor should be saved for subsequent calls
+to read (or write) and close.
+.sp
+In both the read and write case the file pointer
+is set to the beginning of the file.
+.sp
+.ti 0
+SEE ALSO       creat(II), read(II), write(II), close(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set if the file does not exist,
+if one of the necessary directories
+does not exist or is unreadable, if the file is not
+readable (resp. writable), or if 10 files are open.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/pipe.2 b/man/man2/pipe.2
new file mode 100644 (file)
index 0000000..7c16131
--- /dev/null
@@ -0,0 +1,51 @@
+.pa 1
+.he 'PIPE (II)'1/15/73'PIPE (II)'
+.ti 0
+NAME           pipe -- create a pipe
+.sp
+.ti 0
+SYNOPSIS       sys pipe        / pipe = 42.; not in assembler
+.br
+(file descriptor in r0)
+.sp
+.ti 0
+DESCRIPTION    The
+pipe\b\b\b\b____
+system call
+creates an I/O mechanism called a pipe.
+The file descriptor returned can
+be used in both read and write operations.
+When the pipe is written,
+the data is buffered up to 504 bytes
+at which time the writing process is suspended.
+A read on the pipe will pick up the buffered data.
+.sp
+It is assumed that after the
+pipe\b\b\b\b____ has been set up,
+two (or more)
+cooperating processes
+(created by subsequent fork\b\b\b\b____ calls)
+will pass data through the
+pipe with read\b\b\b\b____ and write\b\b\b\b\b_____ calls.
+
+The shell has a syntax
+to set up a linear array of processes
+connected by pipes.
+.sp
+Read calls on an empty
+pipe (no buffered data) with only one end
+(no synonymous file
+descriptors resulting from fork\b\b\b\b____ or dup\b\b\b___)
+return an end-of-file.
+Write calls under similar conditions are ignored.
+
+.ti 0
+SEE ALSO       sh(I), read(II), write(II), fork(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error
+bit (c-bit) is set if
+10 files are already open.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/quit.2 b/man/man2/quit.2
new file mode 100644 (file)
index 0000000..9fe46fc
--- /dev/null
@@ -0,0 +1,24 @@
+.pa 1
+.he 'QUIT (II)'3/15/72'QUIT (II)'
+.ti 0
+NAME           quit  --  turn off quit signal
+.sp
+.ti 0
+SYNOPSIS       sys quit; flag  / quit = 26.
+.sp
+.ti 0
+DESCRIPTION    When flag\b\b\b\b____ is 0, this call disables
+quit signals from the typewriter (ASCII FS).
+When flag\b\b\b\b____ is non-zero, quits are re-enabled,
+and cause execution to cease and a core image to be produced.
+.sp
+Quits should be turned off only with due consideration.
+.sp
+.ti 0
+SEE ALSO       intr(II)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/read.2 b/man/man2/read.2
new file mode 100644 (file)
index 0000000..e06998f
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'READ (II)'3/15/72'READ (II)'
+.ti 0
+NAME           read  --  read from file
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys read; buffer; nbytes  / read = 3.
+.br
+(nread in r0)
+.sp
+.ti 0
+DESCRIPTION    A file descriptor is a word
+returned from a successful open\b\b\b\b____ or creat\b\b\b\b\b_____ call.
+.sp
+Buffer\b\b\b\b\b\b______ is the location of nbytes\b\b\b\b\b\b______ contiguous
+bytes into which the input will be placed.  It is not guaranteed
+that all nbytes\b\b\b\b\b\b______ bytes will be read; for example
+if the file refers to a typewriter at most one line
+will be returned.
+In any event the number of characters read is returned
+in r0.
+.sp
+If r0 returns with value 0, then
+end-of-file has been reached.
+.sp
+.ti 0
+SEE ALSO       open(II), creat(II)
+.sp
+.ti 0
+DIAGNOSTICS    As mentioned,
+r0 is 0 on return when the end of the file has been reached.
+If the read was other\ 6wise unsuccessful
+the error bit (c-bit) is set.  Many conditions,
+can generate an error:
+physical I/O errors, bad buffer address,
+preposterous nbytes\b\b\b\b\b\b______, file descriptor not that of
+an input file.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/rele.2 b/man/man2/rele.2
new file mode 100644 (file)
index 0000000..357e92b
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'RELE (II)'3/15/72'RELE (II)'
+.ti 0
+NAME           rele  --  release processor
+.sp
+.ti 0
+SYNOPSIS       sys rele  / rele = 0;  not in assembler
+.sp
+.ti 0
+DESCRIPTION    This call
+causes the process to be swapped out immediately if
+another process wants to run.
+Its main reason for being is internal
+to the system, namely to implement timer-runout swaps.
+However, it can be used beneficially by programs
+which wish to loop for some reason without
+consuming more processor time than necessary.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/seek.2 b/man/man2/seek.2
new file mode 100644 (file)
index 0000000..7c6e670
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'SEEK (II)'3/15/72'SEEK (II)'
+.ti 0
+NAME           seek  --  move read/write pointer
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys seek; offset; ptrname  / seek = 19.
+.a
+.sp
+.ti 0
+DESCRIPTION    The file
+descriptor refers to a file open for reading or writing.
+The read (resp. write) pointer for the file is set as follows:
+.in +3
+.sp
+if ptrname\b\b\b\b\b\b\b_______ is 0, the pointer is set to offset\b\b\b\b\b\b______.
+.sp
+if ptrname\b\b\b\b\b\b\b_______
+is 1, the pointer is set to its current location plus offset\b\b\b\b\b\b______.
+.sp
+if ptrname\b\b\b\b\b\b\b_______ is 2, the pointer is set to the size of the
+file plus offset\b\b\b\b\b\b______.
+.sp
+.in -3
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set for an undefined file descriptor.
+.sp
+.ti 0
+BUGS           A file
+can conceptually be as large
+as 2**20 bytes.
+Clearly only 2**16 bytes can be addressed by
+seek\b\b\b\b____.
+The problem is most acute on the
+large special files.
diff --git a/man/man2/setuid.2 b/man/man2/setuid.2
new file mode 100644 (file)
index 0000000..640f633
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'SETUID (II)'3/15/72'SETUID (II)'
+.ti 0
+NAME           setuid  --  set process ID
+.sp
+.ti 0
+SYNOPSIS       (process ID in r0)
+.br
+sys setuid  / setuid = 23.
+.sp
+.ti 0
+DESCRIPTION    The user ID of the current process is set to
+the argument in r0.
+Both the effective and the real user ID are set.
+This call is only permitted to the super-user
+or if r0 is the real user ID.
+.sp
+.ti 0
+SEE ALSO       getuid(II)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit
+(c-bit) is set as indicated.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/sleep.2 b/man/man2/sleep.2
new file mode 100644 (file)
index 0000000..d74b8f2
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'SLEEP (II)'9/4/72'SLEEP (II)'
+.ti 0
+NAME           sleep -- stop execution for interval
+.sp
+.ti 0
+SYNOPSIS       (seconds in r0)
+.br
+sys sleep  / sleep = 35.; not in assembler
+.sp
+.ti 0
+DESCRIPTION    The
+current process is suspended from execution
+for the number of seconds specified
+by the contents of register 0.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           Due to the
+implementation,
+the sleep interval is only
+accurate to 256 60ths of a
+second (4.26 sec).
+Even then, the process is placed
+on a low priority queue and must be
+scheduled.
diff --git a/man/man2/stat.2 b/man/man2/stat.2
new file mode 100644 (file)
index 0000000..d15cca1
--- /dev/null
@@ -0,0 +1,77 @@
+.pa 1
+.he 'STAT (II)'3/15/72'STAT (II)'
+.ti 0
+NAME           stat  --  get file status
+.sp
+.ti 0
+SYNOPSIS       sys stat; name; buf  / stat = 18.
+.sp
+.ti 0
+DESCRIPTION    name\b\b\b\b____ points to a null-terminated string naming
+a file; buf\b\b\b___ is the address of a 34(10) byte buffer
+into which information is placed concerning the file.
+It is unnecessary to have any
+permissions at all with respect to the file, but all directories
+leading to the file must be readable.
+.sp
+After stat\b\b\b\b____, buf\b\b\b___ has the following format:
+.sp
+.nf
+buf, +1                i-number
+.br
++2,+3          flags (see below)
+.br
++4             number of links
+.br
++5             user ID of owner
+.br
++6,+7          size in bytes
+.br
++8,+9          first indirect block or contents block
+.br
+.li
+...
+.br
++22,+23                eighth indirect block or contents block
+.br
++24,+25,+26,+27        creation time
+.br
++28,+29,+30,+31        modification time
+.br
++32,+33                unused
+.fi
+.sp
+The flags are as follows:
+.sp
+.in +3
+.nf
+100000 used (always on)
+040000 directory
+.nf
+020000 file has been modified (always on)
+.fi
+010000 large file
+.br
+000040 set user ID
+.br
+000020 executable
+.br
+000010 read, owner
+.br
+000004 write, owner
+.br
+000002 read, non-owner
+.br
+000001 write, non-owner
+.sp
+.in -3
+.fi
+.ti 0
+SEE ALSO       stat(I), fstat(II)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit (c-bit)
+is set if the file cannot be found.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/stime.2 b/man/man2/stime.2
new file mode 100644 (file)
index 0000000..c9b521d
--- /dev/null
@@ -0,0 +1,24 @@
+.pa 1
+.he 'STIME (II)'3/15/72'STIME (II)'
+.ti 0
+NAME           stime  --  set time
+.sp
+.ti 0
+SYNOPSIS       (time in r0-r1)
+.br
+sys stime    / stime = 25.
+.sp
+.ti 0
+DESCRIPTION    stime\b\b\b\b\b_____
+sets the system's idea of the time and date.
+Only the super-user may use this call.
+.sp
+.ti 0
+SEE ALSO       date(I), time(II)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit (c-bit)
+set if user is not the super-user.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/stty.2 b/man/man2/stty.2
new file mode 100644 (file)
index 0000000..eafb34a
--- /dev/null
@@ -0,0 +1,94 @@
+.pa 1
+.he 'STTY (II)'6/12/72'STTY (II)'
+.tr |
+.ti 0
+NAME           stty  --  set mode of typewriter
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys stty; arg  / stty = 31.
+.br
+.li
+...
+.ti -6
+arg:  dcrsr; dctsr; mode
+.sp
+.ti 0
+DESCRIPTION    stty\b\b\b\b____
+sets mode bits for a typewriter whose file descriptor
+is passed in r0.
+First, the system delays until the typewriter is quiescent.
+Then, the argument dcrsr\b\b\b\b\b_____ is placed into the type\ 6wri\ 6ter's
+receiver control and status register,
+and dctsr\b\b\b\b\b_____ is placed in the transmitter control and status register.
+The DC-11 manual must be consulted for the format of these
+words.
+For the purpose of this call, the most important ro\b^le of
+these arguments is to adjust to the speed of the typewriter.
+.sp
+The mode\b\b\b\b____ argument contains several bits which determine the
+system's treatment of the typewriter:
+.sp
+.in +3
+.nf
+200  even parity allowed on input (e. g. for M37s)
+100  odd parity allowed on input
+040  raw mode: wake up on all characters
+020  map CR into LF; echo LF or CR as LF-CR
+010  echo (full duplex)
+004  map upper case to lower on input (e. g. M33)
+002  echo and print tabs as spaces
+001  inhibit all function delays (e. g. CRTs)
+.fi
+.in -3
+.sp
+.fi
+Characters with the wrong parity, as determined by bits 200 and
+100, are ignored.
+.sp
+In raw mode, every character is passed back immediately
+to the program.  No erase or kill processing is done;
+the end-of-file character (EOT), the interrupt character
+(DELETE) and the quit character (FS) are not treated specially.
+.sp
+Mode 020 causes input carriage returns to be turned into
+new-lines;
+input of either CR or LF causes LF-CR both to
+be echoed
+(used for GE TermiNet 300's and other terminals without the newline function).
+.sp
+Additional bits in the high order byte of the mode argument
+are used to indicate that the terminal is an IBM|2741
+and to specify 2741 modes.
+These mode bits are:
+.sp
+.in+8
+.ll+6
+.ti-6
+|400  terminal is an IBM|2741
+.ti-6
+1000  the 2741 has the transmit interrupt feature (currently ignored)
+.ti-6
+2000  use correspondence code conversion on output
+.ti-6
+4000  use correspondence code conversion on input (currently ignored)
+.sp
+.in -8
+.ll-6
+Normal input and output code conversion
+for 2741s is EBCDIC (e. g. 963 ball and corresponding keyboard).
+The presence of the transmit interrupt feature permits
+the system to do read-ahead while no output is in progress.
+In 2741 mode, the low order bits 331 are ignored.
+.ti0
+.sp
+SEE ALSO       stty(I), gtty(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set if the file descriptor does not refer to a type\ 6writer.
+.sp
+.ti 0
+BUGS           This call should be used with care.
+.tr ||
diff --git a/man/man2/sync.2 b/man/man2/sync.2
new file mode 100644 (file)
index 0000000..6a06efb
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'SYNC (II)'6/12/72'SYNC (II)'
+.ti 0
+NAME           sync -- update super-block
+.sp
+.ti 0
+SYNOPSIS       sys sync  / sync = 36.; not in assembler
+.sp
+.ti 0
+DESCRIPTION    sync\b\b\b\b____
+causes the super block for all file systems to be written out.
+It is only necessary on systems in which
+this writing may be delayed
+for a long time, i.e., those which
+incorporate hardware protection facilities.
+
+It should be used by programs which examine a file system,
+for example check, df, tm, etc.
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/time.2 b/man/man2/time.2
new file mode 100644 (file)
index 0000000..ca41e35
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'TIME (II)'3/15/72'TIME (II)'
+.ti 0
+NAME           time  --  get time of year
+.sp
+.ti 0
+SYNOPSIS       sys time  / time = 13.
+.br
+(time r0-r1)
+.sp
+.ti 0
+DESCRIPTION    time\b\b\b\b____
+returns the time since 00:00:00, Jan. 1, 1972, measured
+in sixtieths of a second.
+The high order word is in the r0 register and the low order
+is in the r1.
+.sp
+.ti 0
+SEE ALSO       date(I), mdate(II)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           The time
+is stored in 32 bits.
+This guarantees a crisis every
+2.26 years.
diff --git a/man/man2/times.2 b/man/man2/times.2
new file mode 100644 (file)
index 0000000..0f8cefe
--- /dev/null
@@ -0,0 +1,68 @@
+.pa 1
+.he 'TIMES(II)'2/10/73'TIMES(II)'
+.ti 0
+NAME           times -- get process times
+.sp
+.ti 0
+.nf
+SYNOPSIS       sys  times; buffer  / times = 43.; not in assembler
+.br
+.fi
+.li
+...
+.ti -8
+buffer:        .=.+[24.*3]
+.sp
+.ti 0
+DESCRIPTION    times\b\b\b\b\b_____
+returns time-accounting information
+for the system as a whole, for the current process,
+and for the terminated child processes
+of the current process.
+All the times are 2-word (32-bit) numbers, and the
+unit of measurement is 1/60 second.
+
+After the call, the buffer will appear as follows:
+
+buffer:
+.br
+system:
+       .=.+4           / absolute time
+       .=.+4           / total system time
+       .=.+4           / total swap time
+       .=.+4           / other I/O wait time
+       .=.+4           / idle time
+       .=.+4           / total user time
+
+process:
+       .=.+4           / (ignore)
+       .=.+4           / time in system
+       .=.+4           / (ignore)
+       .=.+4           / I/O wait time
+       .=.+4           / (ignore)
+       .=.+4           / processor time
+
+child:
+       .=.+24.
+
+The format of the "child" times is the same as
+that for the process times; the numbers are
+the sum of the times for all terminated direct
+or indirect descendants of the current process.
+
+The "absolute" time returned is the same as that
+given by time(II).
+The "total system times" are times since the last cold
+boot.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       time(II), time(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/umount.2 b/man/man2/umount.2
new file mode 100644 (file)
index 0000000..6a2e6aa
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'UMOUNT (II)'3/15/72'UMOUNT (II)'
+.ti 0
+NAME           umount  -- dismount file system
+.sp
+.ti 0
+.nf
+SYNOPSIS       sys umount; special  / umount = 22.
+.fi
+.sp
+.ti 0
+DESCRIPTION    umount\b\b\b\b\b\b______
+announces to the system that special
+file special\b\b\b\b\b\b\b_______ is no longer to contain
+a removable file system.
+The file associated with the special
+file reverts to its ordinary interpretation (see mount\b\b\b\b\b_____).
+
+The user must take
+care that all activity on the file system has ceased.
+.sp
+.ti 0
+SEE ALSO       umount(I), mount(II)
+.sp
+.ti 0
+DIAGNOSTICS    Error bit
+(c-bit) set if
+no
+file system was mounted on the special file.
+.sp
+.ti 0
+BUGS           Use
+of this call should
+be restricted to the super-user.
diff --git a/man/man2/unlink.2 b/man/man2/unlink.2
new file mode 100644 (file)
index 0000000..45ef7a0
--- /dev/null
@@ -0,0 +1,33 @@
+.pa 1
+.he 'UNLINK (II)'3/15/72'UNLINK (II)'
+.ti 0
+NAME           unlink  --  remove directory entry
+.sp
+.ti 0
+SYNOPSIS       sys unlink; name  / unlink = 10.
+.sp
+.ti 0
+DESCRIPTION    Name\b\b\b\b____
+points to a null-terminated string.
+Unlink\b\b\b\b\b\b______
+removes the entry for the file pointed to by name\b\b\b\b____
+from its directory.
+If this entry was the last link to the file,
+the contents of the file are freed and the file is destroyed.
+If, however, the file was open in any process, the actual
+destruction is delayed until it is closed, even though
+the directory entry has disappeared.
+.sp
+.ti 0
+SEE ALSO       rm(I), rmdir(I), link(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set to indicate that the file does not
+exist or that its directory cannot be written.
+Write permission is not required on the file itself.
+It is also illegal to unlink a directory
+(except for the super-user).
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man2/wait.2 b/man/man2/wait.2
new file mode 100644 (file)
index 0000000..1c76ef1
--- /dev/null
@@ -0,0 +1,59 @@
+.pa 1
+.he 'WAIT (II)'9/4/72'WAIT (II)'
+.ti 0
+NAME           wait  --  wait for process to die
+.sp
+.ti 0
+SYNOPSIS       sys wait  / wait = 7.
+.br
+(process ID in r0)
+.br
+(termination status/user status in r1)
+.sp
+.ti 0
+DESCRIPTION    wait\b\b\b\b____
+causes its caller to delay until one of its child
+processes terminates.
+If any child has died since the last wait\b\b\b\b____, return is immediate;
+if there are no children, return is immediate with
+the error bit set.
+In the case of several children several wait\b\b\b\b____s are needed
+to learn of all the deaths.
+.sp
+If the error bit is not set on return,
+the r1 high byte contains the low byte of the
+child process r0 when it terminated.
+The r1 low byte contains the termination status
+of the process from the following list:
+.sp
+   0   exit
+   1   bus error
+   2   illegal instruction
+   3   trace trap
+   4   IOT trap
+   5   power fail trap
+   6   EMT trap
+   7   bad system call
+   8   PIR interrupt
+   9   floating point exception
+  10   memory violation
+  11   quit
+  12   interrupt
+  13   kill (see kill(II))
+  14   User I/O (not currently possible)
+ +16   core image produced
+.sp
+.ti 0
+SEE ALSO       exit(II), fork(II)
+.sp
+.ti 0
+DIAGNOSTICS    error bit
+(c-bit) on if no children not previously waited for.
+.sp
+.ti 0
+BUGS           A child
+which dies, but is never
+waited for consumes
+a slot in the process table.
+When this table is full,
+the system is effectively hung.
diff --git a/man/man2/write.2 b/man/man2/write.2
new file mode 100644 (file)
index 0000000..6a8d2dd
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'WRITE (II)'3/15/72'WRITE (II)'
+.ti 0
+NAME           write  --  write on file
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+sys write; buffer; nbytes  / write = 4.
+.br
+(number written in r0)
+.sp
+.ti 0
+DESCRIPTION    A file descriptor is a word returned from a
+successful open\b\b\b\b____ or creat\b\b\b\b\b_____ call.
+.sp
+buffer\b\b\b\b\b\b______ is the address of nbytes\b\b\b\b\b\b______ contiguous
+bytes which are written on the output file.
+The number of characters actually written is returned in r0.
+It should be regarded as an error
+if this is not the same as requested.
+.sp
+Writes which are multiples
+of 512 characters long and begin on a 512-byte boundary
+are more efficient than any others.
+.sp
+.ti 0
+SEE ALSO       creat(II), open(II)
+.sp
+.ti 0
+DIAGNOSTICS    The error bit
+(c-bit) is set on an error: bad descriptor, buffer address, or
+count; physical I/O errors.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/atan.3 b/man/man3/atan.3
new file mode 100644 (file)
index 0000000..543c8ed
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he 'ATAN, ATAN2 (III)'1/15/73'ATAN, ATAN2 (III)'
+.ti 0
+NAME           atan -- arc tangent function
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,atan[2]
+.sp
+.ti 0
+DESCRIPTION    The
+atan entry returns the arc tangent
+of fr0 in fr0.
+The range is -\ eJ\ f/2 to \ eJ\ f/2.
+.sp
+The atan2 entry returns the arc tangent
+of fr0/fr1 in fr0.
+The range is -\ eJ\ f to \ eJ\ f.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    there is no error return
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/atof.3 b/man/man3/atof.3
new file mode 100644 (file)
index 0000000..07d5961
--- /dev/null
@@ -0,0 +1,43 @@
+.pa 1
+.he 'ATOF (III)'1/15/73'ATOF (III)'
+.ti 0
+NAME           atof -- ascii to floating
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,atof; subr
+.sp
+.ti 0
+DESCRIPTION    atof\b\b\b\b____
+will convert an ascii stream to a floating
+number returned in fr0.
+
+The subroutine subr\b\b\b\b____
+(supplied by the caller)
+is called on r5 for each character of the
+ascii stream.
+subr\b\b\b\b____ should return the character in r0.
+The first character not used in the conversion
+is left in r0.
+.sp
+The only numbers recognized are:  an optional minus
+sign followed by a string of digits optionally containing
+one decimal point, then followed optionally by the
+letter "e" followed by a signed integer.
+.sp
+The subroutine subr\b\b\b\b____ must not disturb any registers.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       Calls atoi (III)
+.sp
+.ti 0
+DIAGNOSTICS    There are none; overflow results in a very large
+number and garbage characters terminate the scan.
+.sp
+.ti 0
+BUGS           The
+routine should accept initial "+", initial blanks, and "E" for "e".
+
+Overflow should be signalled with the carry bit.
diff --git a/man/man3/atoi.3 b/man/man3/atoi.3
new file mode 100644 (file)
index 0000000..9db8535
--- /dev/null
@@ -0,0 +1,43 @@
+.pa 1
+.he 'ATOI (III)'1/15/73'ATOI (III)'
+.ti 0
+NAME           atoi -- ascii to integer
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,atoi; subr
+.sp
+.ti 0
+DESCRIPTION    atoi\b\b\b\b____
+will convert an ascii stream to a binary
+number returned in r1.
+
+The subroutine subr\b\b\b\b____
+(supplied by the caller)
+is called on r5 for each character of the
+ascii stream.
+subr\b\b\b\b____ should return the character in r0.
+The first character not used in the conversion
+is left in r0.
+.sp
+The numbers recognized are:  an optional minus sign
+followed by a string of digits.
+.sp
+The subroutine subr\b\b\b\b____ must not disturb any registers.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    There are none;
+the routine charges on regardless of consequences; see BUGS.
+.sp
+.ti 0
+BUGS           It
+pays no attention to overflow - you get what\ 6ever the machine
+instructions mul and div happen to leave in the low order half
+- in fact, the carry bit should be set and isn't.
+.sp
+The routine should accept initial "+" and initial blanks.
diff --git a/man/man3/compar.3 b/man/man3/compar.3
new file mode 100644 (file)
index 0000000..3fc488d
--- /dev/null
@@ -0,0 +1,43 @@
+.pa 1
+.he 'COMPAR (III)'1/15/73'COMPAR (III)'
+.ti 0
+NAME           compar -- default comparison routine for qsort
+.sp
+.ti 0
+SYNOPSIS       jsr pc,compar
+.sp
+.ti 0
+DESCRIPTION    Compar is the default comparison routine
+called by qsort and is separated out so that the user can
+supply his own comparison.
+.sp
+The routine is called with the width (in bytes) of
+an element in r3 and it compares byte-by-byte the element
+pointed to by r0 with the element pointed to by r4.
+.sp
+Return is via the condition codes,
+which are tested by the instructions "blt" and "bgt".
+.a
+That is, in the absence of overflow, then the 
+condition (r0) < (r4) should leave the Z-bit off and N-bit
+on while (r0) > (r4) should leave Z and N off.
+Still another way of putting it is that  for elements
+of length 1 the instruction
+
+       cmpb    (r0),(r4)
+
+suffices.
+.sp
+Only r0 is changed by the call.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       qsort (III)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           It could be recoded to run faster.
diff --git a/man/man3/crypt.3 b/man/man3/crypt.3
new file mode 100644 (file)
index 0000000..a6b0546
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'CRYPT (III)'1/15/73'CRYPT (III)'
+.ti 0
+NAME           crypt -- password encoding
+.sp
+.ti 0
+SYNOPSIS       mov $key,r0
+.br
+jsr pc,crypt
+.sp
+.ti 0
+DESCRIPTION    On entry, r0 should point to a string of
+characters terminated by an ASCII NULL.  The routine
+performs an operation on the key which is difficult to invert
+(i.e. encrypts it) and leaves the resulting eight bytes
+of ASCII alphanumerics in a global cell called "word".
+.sp
+Login uses this result as a password.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       passwd(I),passwd(V), login(I)
+.sp
+.ti 0
+DIAGNOSTICS    there are none; garbage is accepted.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/ctime.3 b/man/man3/ctime.3
new file mode 100644 (file)
index 0000000..a0c2514
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'CTIME (III)'1/15/73'CTIME (III)'
+.ti 0
+NAME           ctime  --  convert date and time to ASCII
+.sp
+.ti 0
+SYNOPSIS       sys     time
+.br
+mov    $buffer,r2
+.br
+jsr    pc,ctime
+.br
+.sp
+.ti 0
+DESCRIPTION    The output buffer
+is 16 characters long and
+the time has the format
+.sp
+     Oct  9 17:32:24\\0
+.sp
+The input time must be in the r0 and r1 registers in the form
+returned by sys\b\b\b___ time\b\b\b\b____.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       ptime(III), time(II)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           The routine must be reassembled for leap year.
+.br
+Dec 31 is followed by Dec 32 and so on.
diff --git a/man/man3/ddsput.3 b/man/man3/ddsput.3
new file mode 100644 (file)
index 0000000..b84a058
--- /dev/null
@@ -0,0 +1,82 @@
+.pa 1
+.he 'DDSPUT, DDSINIT (III)'1/15/73'DDSPUT, DDSINIT (III)'
+.ti 0
+NAME           ddsput -- put a character on display data set
+.sp
+.ti 0
+SYNOPSIS       (file descriptor in r0)
+.br
+jsr    pc,ddsinit
+
+.br
+(character in r0)
+.br
+jsr    pc,ddsput
+.sp
+.ti 0
+DESCRIPTION    These routines
+provide an interface to the Display Data Set, a peculiar
+device which can be called by Picturephone sets and which
+will display some of the ASCII character set and certain
+other graphics on the Picturephone screen.
+
+If the DC11 or other interface hardware is not already
+set up to talk to the Display Data Set, the ddsinit\b\b\b\b\b\b\b_______
+entry should be called with the appropriate file descriptor in r0.
+On the only known DDS attached to UNIX, the associated special file
+is called "/dev/ttyc".
+ddsinit\b\b\b\b\b\b\b_______ also clears the display.
+
+Thereafter, characters may be displayed
+by calling ddsput\b\b\b\b\b\b______.
+To the extent possible, ddsput\b\b\b\b\b\b______ simulates an ordinary terminal.
+Characters falling to the right of the 22X22 screen
+area are ignored; the 23rd line on the screen causes
+the screen to be erased and that line to be put at the top
+of the new display.
+Certain ASCII characters are interpreted specially as follows:
+
+.in +5
+.ti -5
+FF   clear screen, go to top left
+.ti -5
+HT   expand to right number of spaces
+.ti -5
+DC1  treat as reverse line feed (move N)
+.ti -5
+DC2  move cursor 1 place right (move E)
+.ti -5
+DC3  forward line feed (move S)
+.ti -5
+DC4  backspace 1 position (move W)
+.ti -5
+SO   enter graph mode
+.ti -5
+SI   leave graph mode
+.ti -5
+CR   put cursor at start of current line
+
+.in -5
+Graph mode allows display of the non-ASCII characters and
+will be described when hell freezes over.
+
+Lower-case ASCII alphabetics are mapped into upper case.
+Several ASCII non-alphabetic graphics
+are unavailable as well.  Also the lower right circle of
+the "%" character is missing.
+Also one of the circuit cards in the DDS has a crack in it and
+sometimes it doesn't work.
+All in all,
+it is best to avoid this device.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       AT&T writeup on DDS
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           yes
diff --git a/man/man3/ecvt.3 b/man/man3/ecvt.3
new file mode 100644 (file)
index 0000000..753307f
--- /dev/null
@@ -0,0 +1,47 @@
+.pa 1
+.he 'ECVT, FCVT (III)'1/15/73'ECVT, FCVT (III)'
+.ti 0
+NAME           ecvt, fcvt -- output conversion
+.sp
+.ti 0
+SYNOPSIS       jsr pc,ecvt
+.sp
+or
+.sp
+jsr pc,fcvt
+.sp
+.ti 0
+DESCRIPTION    Ecvt
+is called with a floating point number in fr0.
+.sp
+On exit, the number has been converted into a
+string of ascii digits in a buffer pointed to by r0.
+The number of digits produced is controlled
+by a global variable "_ndigits".
+
+Moreover, the position of the decimal point is
+contained in r2: r2=0 means the d.p. is at the
+left hand end of the string of digits;
+r2>0 means the d.p. is within or to the right
+of the string.
+
+The sign of the number is indicated by r1 (0 for +; 1 for -).
+
+The low order digit has suffered decimal rounding
+(i. e. may have been carried into).
+.sp
+Fcvt is identical to ecvt, except that the correct digit
+has had decimal rounding for F-style output of the number
+of digits specified by "_ndigits".
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       ftoa(III)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/exp.3 b/man/man3/exp.3
new file mode 100644 (file)
index 0000000..43f56f3
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'EXP (III)'1/15/73'EXP (III)'
+.ti 0
+NAME           exp -- exponential function
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,exp
+.sp
+.ti 0
+DESCRIPTION    The
+exponential of fr0 is returned in fr0.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    If
+the result is not representable, the
+c-bit is set
+and the largest positive number is returned.
+.sp
+Zero is returned if the result would underflow.
+.sp
+.ti 0
+BUGS           ---
diff --git a/man/man3/ftoa.3 b/man/man3/ftoa.3
new file mode 100644 (file)
index 0000000..be2061a
--- /dev/null
@@ -0,0 +1,39 @@
+.pa 1
+.he 'FTOA (III)'1/15/73'FTOA (III)'
+.ti 0
+NAME           ftoa -- floating to ascii conversion
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,ftoa; subr
+.sp
+.ti 0
+DESCRIPTION    ftoa\b\b\b\b____
+will convert the floating point number in fr0
+into ascii in the form
+
+   [-]ddddd.dd*
+
+if possible, otherwise in the form
+
+   [-]d.dddddddde\b_[-]dd*.
+.sp
+For each character generated by ftoa,
+the subroutine subr\b\b\b\b____ (supplied by the caller) is called on
+register r5 with the character in r0.
+.sp
+The number of digits can be changed by changing the value
+of "_ndigits" in ecvt (default is 10.).
+.sp
+The subroutine subr\b\b\b\b____ must not disturb any registers.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       ecvt(III), itoa(III)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/ftoo.3 b/man/man3/ftoo.3
new file mode 100644 (file)
index 0000000..cebd1b3
--- /dev/null
@@ -0,0 +1,32 @@
+.pa 1
+.he 'FTOO (III)'1/15/73'FTOO (III)'
+.ti 0
+NAME           ftoo -- floating to octal conversion
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,ftoo; subr
+.sp
+.ti 0
+DESCRIPTION    ftoo wil convert the floating point number
+in fr0 into ascii in the conventional octal form
+
+   000000;000000;000000;000000
+.sp
+For each character generated by ftoo, the subroutine
+subr\b\b\b\b____
+(supplied by the caller) is called on register r5
+with the character in r0.
+.sp
+The subroutine subr\b\b\b\b____ must not disturb any registers.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/gerts.3 b/man/man3/gerts.3
new file mode 100644 (file)
index 0000000..2738ac2
--- /dev/null
@@ -0,0 +1,43 @@
+.pa 1
+.he 'CONNECT, GERTS (III)'3/15/72'CONNECT, GERTS (III)'
+.ti 0
+NAME           connect, gerts -- Gerts communication over 201
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,connect
+.br
+(error return)
+.a
+.br
+.li
+...
+
+jsr    r5,gerts; fc; oc; ibuf; obuf
+.br
+(error return)
+.br
+.li
+...
+.sp
+other entry points:  gcset, gout
+.sp
+.ti 0
+DESCRIPTION    The
+GCOS GERTS interface is so bad that
+a description here is inappropriate.
+Anyone needing to use this interface should
+seek divine guidance.
+.sp
+.ti 0
+FILES          /dev/dn0, /dev/dp0
+.br
+kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       dn(IV), dp(IV), HIS documentation
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/getc.3 b/man/man3/getc.3
new file mode 100644 (file)
index 0000000..7a1557a
--- /dev/null
@@ -0,0 +1,59 @@
+.pa 1
+.he 'GETC, GETW, FOPEN (III)'3/15/72'GETC, GETW, FOPEN (III)'
+.ti 0
+NAME           getw, getc, fopen  --  buffered input
+.sp
+.ti 0
+SYNOPSIS       mov     $filename,r0
+.br
+jsr    r5,fopen; iobuf
+
+jsr    r5,getc; iobuf
+.br
+(character in r0)
+
+jsr    r5,getw; iobuf
+.br
+(word in r0)
+.sp
+.ti 0
+DESCRIPTION    These routines are used to provide a buffered input
+facility.
+iobuf\b\b\b\b\b_____ is the address of a 518(10) byte buffer area whose
+contents are maintained by these routines.  Its format is:
+.sp
+.nf
+ioptr: .=.+2           / file descriptor
+       .=.+2           / characters left in buffer
+       .=.+2           / ptr to next character
+       .=.+512.        / the buffer
+.sp
+.fi
+fopen\b\b\b\b\b_____ may be called initially to open the file.  On return,
+the error bit (c-bit) is set if the open failed.
+If fopen\b\b\b\b\b_____ is never called, get\b\b\b___ will read from the standard
+input file.
+.sp
+getc\b\b\b\b____ returns the next byte from the file in r0.  The
+error bit is set on end of file or a read error.
+.sp
+getw\b\b\b\b____ returns the next word in r0.  getc\b\b\b\b____ and getw\b\b\b\b____
+may be used alternately; there are no odd/even
+problems.
+.sp
+iobuf\b\b\b\b\b_____ must be provided by the user; it must be on a word boundary.
+
+To reuse the same buffer for another file, it is sufficient
+to close the original file and call fopen\b\b\b\b\b_____ again.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       open(II), read(II), putc(III)
+.sp
+.ti 0
+DIAGNOSTICS    c-bit set on EOF or error
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/hypot.3 b/man/man3/hypot.3
new file mode 100644 (file)
index 0000000..2b477a7
--- /dev/null
@@ -0,0 +1,35 @@
+.pa 1
+.he 'HYPOT (III)'6/12/72'HYPOT (III)'
+.ti 0
+NAME           hypot -- calculate hypotenuse
+.sp
+.ti 0
+SYNOPSIS       movf    a,fr0
+.br
+movf   b,fr1
+.br
+jsr    r5,hypot
+.br
+movf   fr0,...
+.sp
+.ti 0
+DESCRIPTION    The
+square root of fr0*fr0 + fr1*fr1
+is returned in fr0.
+The calculation is done in such a way
+that overflow will not occur unless
+the answer is not representable in floating point.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       sqrt(III)
+.sp
+.ti 0
+DIAGNOSTICS    The
+c-bit is set if the result cannot
+be represented.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/itoa.3 b/man/man3/itoa.3
new file mode 100644 (file)
index 0000000..1c7a7db
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'ITOA (III)'3/15/72'ITOA (III)'
+.ti 0
+NAME           itoa -- integer to ascii conversion
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,itoa; subr
+.sp
+.ti 0
+DESCRIPTION    itoa\b\b\b\b____
+will convert the number in r0
+into ascii decimal preceded
+by a - sign if appropriate.
+For each character generated by itoa,
+the subroutine subr\b\b\b\b____ (supplied by the caller) is called on
+register r5 with the character in r0.
+.sp
+The subroutine subr\b\b\b\b____ must not disturb any registers.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/log.3 b/man/man3/log.3
new file mode 100644 (file)
index 0000000..37e0fc8
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'LOG (III)'3/15/72'LOG (III)'
+.ti 0
+NAME           log -- logarithm (base e)
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,log
+.sp
+.ti 0
+DESCRIPTION    The
+logarithm (base e) of fr0 is returned in fr0.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    The error bit (c-bit)
+is set if the input argument is less than or
+equal to zero and the result is set to the largest
+negative number.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/mesg.3 b/man/man3/mesg.3
new file mode 100644 (file)
index 0000000..f44f6e5
--- /dev/null
@@ -0,0 +1,25 @@
+.pa 1
+.he 'MESG (III)'3/15/72'MESG (III)'
+.ti 0
+NAME           mesg  --  write message on typewriter
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,mesg; <Now is the time\\0>; .even
+.sp
+.ti 0
+DESCRIPTION    mesg\b\b\b\b____
+writes the string immediately following its call onto
+the standard output file.
+The string must be terminated by an ASCII NULL byte.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/nlist.3 b/man/man3/nlist.3
new file mode 100644 (file)
index 0000000..5c67d5e
--- /dev/null
@@ -0,0 +1,62 @@
+.pa 1
+.he 'NLIST (III)'6/12/72'NLIST (III)'
+.ti 0
+NAME           nlist -- get entries from name list
+.sp
+.ti 0
+SYNOPSIS       jsr r5,nlist; file; list
+.br
+.li
+...
+.br
+.ti -6
+file: <file name\\0>; .even
+.br
+.ti -6
+list:
+.br
+<name1xxx>; type1; value1
+.br
+<name2xxx>; type2; value2
+.br
+.li
+...
+.br
+0
+.sp
+.ti 0
+DESCRIPTION    nlist\b\b\b\b\b_____
+will examine the name list in
+the given assembler output file
+and selectively extract a
+list of values.
+The name list consists of
+a list of 8-character names (null padded)
+each followed by two words.
+The list is terminated with a zero.
+Each name is looked up in the name list of
+the file.
+If the name is found, the type and value of the
+name are placed in the two words following
+the name.
+If the name is not found, the type entry is set to -1.
+.sp
+This subroutine is useful for
+examining the system name list kept in
+the file /sys/sys/unix.
+In this way programs can obtain system 'magic'
+numbers that are up to date.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       a.out(V)
+.sp
+.ti 0
+DIAGNOSTICS    All
+type entries are set to -1 if the file cannot be found
+or if it is not a valid namelist.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/pow.3 b/man/man3/pow.3
new file mode 100644 (file)
index 0000000..528ddec
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'POW (III)'1/15/73'POW (III)'
+.ti 0
+NAME           pow -- floating exponentiation x^y
+.sp
+.ti 0
+SYNOPSIS       movf    x,fr0
+.br
+movf   y,fr1
+.br
+jsr    pc,pow
+.br
+movf   fr0,...
+.sp
+.ti 0
+DESCRIPTION    The
+value of x^y (i.e. x\uy\d) is returned in fr0.
+
+0^x returns zero for all x.
+
+(-x)^y returns a result only if y is an integer.
+
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       exp(III), log(III)
+.sp
+.ti 0
+DIAGNOSTICS    The
+carry bit is set on return in case of overflow or in case of
+0^0 or
+(-x)^y for y non-integer.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/ptime.3 b/man/man3/ptime.3
new file mode 100644 (file)
index 0000000..5f6c7f7
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'PTIME (III)'3/15/72'PTIME (III)'
+.ti 0
+NAME           ptime  --  print date and time
+.sp
+.ti 0
+SYNOPSIS       sys     time
+.br
+mov    file,r2
+.br
+jsr    pc,ptime
+.sp
+.ti 0
+DESCRIPTION    ptime\b\b\b\b\b_____ prints the date and time in the form
+.sp
+     Oct  9 17:20:33\
+.sp
+on the file whose file descriptor is in r2.
+The string is 15 characters long.
+The time to be printed
+must be placed in the r0 and r1 registers
+in the form returned by sys\b\b\b___ time\b\b\b\b____.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       time(II), ctime(III) (used to do the conversion)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           see ctime
diff --git a/man/man3/putc.3 b/man/man3/putc.3
new file mode 100644 (file)
index 0000000..9a14bf8
--- /dev/null
@@ -0,0 +1,60 @@
+.pa 1
+.he 'PUTC,PUTW,FCREAT,FLUSH (III)'6/12/72'PUTC,PUTW,FCREAT,FLUSH (III)'
+.ti 0
+NAME           putc, putw, fcreat, flush  --  buffered output
+.sp
+.ti 0
+SYNOPSIS       mov     $filename,r0
+.br
+jsr    r5,fcreat; iobuf
+
+(get byte in r0)
+.br
+jsr    r5,putc; iobuf
+
+(get word in r0)
+.br
+jsr    r5,putw; iobuf
+.sp
+jsr    r5,flush; iobuf
+.sp
+.ti 0
+DESCRIPTION    fcreat\b\b\b\b\b\b______ creates
+the given file (mode 17) and sets up the buffer iobuf\b\b\b\b\b_____ (size 518(10) bytes);
+putc\b\b\b\b____ and putw\b\b\b\b____ write a byte or word respectively
+onto the file;
+flush\b\b\b\b\b_____ forces the contents of the buffer to be written, but
+does not close the file.
+The format of the buffer is:
+.sp
+.nf
+iobuf: .=.+2           / file descriptor
+       .=.+2           / characters unused in buffer
+       .=.+2           / ptr to next free character
+       .=.+512.        / buffer
+.sp
+.fi
+fcreat\b\b\b\b\b\b______ sets the error bit (c-bit) if the 
+file creation failed; none of the other routines
+return error information.
+.sp
+Before terminating, a program should call
+flush\b\b\b\b\b_____ to force out the last of the output.
+.sp
+The user must supply iobuf\b\b\b\b\b_____, which should begin on a word boundary.
+
+To write a new file using the same buffer, it
+suffices to call flush\b\b\b\b\b_____, close the file,
+and call fcreat\b\b\b\b\b\b______ again.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       creat(II), write(II), getc(III)
+.sp
+.ti 0
+DIAGNOSTICS    error bit possible on fcreat\b\b\b\b\b\b______ call
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/qsort.3 b/man/man3/qsort.3
new file mode 100644 (file)
index 0000000..54ddebe
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'QSORT (III)'6/12/72'QSORT (III)'
+.ti 0
+NAME           qsort -- quicker sort
+.sp
+.ti 0
+SYNOPSIS       (base of data in r1)
+.br
+(end+1 of data in r2)
+.br
+(element width in r3)
+.br
+jsr pc,qsort
+.sp
+.ti 0
+DESCRIPTION    qsort\b\b\b\b\b_____
+is an implementation
+of the quicker sort algorithm.
+It is designed to sort equal length
+elements.
+Registers r1 and r2 delimit the region of
+core containing the array of byte strings to be sorted:
+r1 points to the start of the first string, r2 to the first
+location above the last string.
+Register r3 contains the length of each string.
+r2-r1 should be a multiple of r3.
+On return, r0, r1, r2, r3, r4 are destroyed.
+.sp
+The routine compar (q.v.) is called to compare elements
+and may be replaced by the user.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       compar(III)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           It scribbles on r4.
diff --git a/man/man3/rand.3 b/man/man3/rand.3
new file mode 100644 (file)
index 0000000..d502db7
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he 'RAND (III)'1/15/73'RAND (III)'
+.ti 0
+NAME           rand -- random number generator
+.sp
+.ti 0
+SYNOPSIS       jsr pc,srand    /to initialize
+.br
+jsr pc,rand    /to get a random number
+.sp
+.ti 0
+DESCRIPTION    The routine uses a multiplicative congruential
+random number generator to return successive pseudo-random
+numbers in r0 in the range from 1 to 2^15-1.
+.sp
+The generator is reinitialized by calling srand with 1 in r0.
+.sp
+It can be set to a random starting point by calling
+srand with whatever you like in r0,
+for example the result left in r1 from sys\b\b\b___ time\b\b\b\b____.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+WARNING                The author of this routine has been writing
+random-number generators for many years and has never been
+known to write one that worked.
diff --git a/man/man3/salloc.3 b/man/man3/salloc.3
new file mode 100644 (file)
index 0000000..39f9ff6
--- /dev/null
@@ -0,0 +1,160 @@
+.pa 1
+.he 'SALLOC (III)'6/15/72'SALLOC (III)'
+.ti 0
+.nf
+NAME           salloc -- string manipulation routines
+.fi
+.sp
+.ti 0
+.nf
+SYNOPSIS       (get size in r0)
+.br
+jsr    pc,allocate
+.sp
+(get source pointer in r0,
+destination pointer in r1)
+jsr    pc,copy
+.sp
+jsr    pc,wc
+.sp
+(all following instructions assume r1 contains pointer)
+
+jsr    pc,release
+
+(get character in r0)
+jsr    pc,putchar
+.sp
+jsr    pc,lookchar
+(character in r0)
+
+jsr    pc,getchar
+(character in r0)
+
+(get character in r0)
+jsr    pc,alterchar
+
+(get position in r0)
+jsr    pc,seekchar
+
+jsr    pc,backspace
+(character in r0)
+
+(get word in r0)
+jsr    pc,putword
+
+jsr    pc,lookword
+(word in r0)
+
+jsr    pc,getword
+(word in r0)
+
+(get word in r0)
+jsr    pc,alterword
+
+jsr    pc,backword
+(word in r0)
+
+jsr    pc,length
+(length in r0)
+
+jsr    pc,position
+(position in r0)
+
+jsr    pc,rewind
+
+jsr    pc,create
+
+jsr    pc,fsfile
+
+jsr    pc,zero
+
+.fi
+.ti 0
+DESCRIPTION    This package is a complete set of routines
+for dealing with almost arbitrary
+length strings of words and bytes.
+The strings are stored on a disk file, so the sum of
+their lengths can be considerably larger than
+the available core.
+
+For each string there is a header of four words, namely
+a write pointer, a read pointer and pointers to the beginning and end of
+the block containing the string.
+Initially the read and write pointers point to the beginning of the string.
+All routines that refer to a string require the header address in r1.
+Unless the string is destroyed by the call,
+upon return r1 will point to the same string, although
+the string may have grown to the extent that it had to be
+be moved.
+
+.ul
+allocate
+obtains a string of the requested size and returns
+a pointer to its header in r1.
+.sp
+release\b\b\b\b\b\b\b_______ releases a string back to free storage.
+.sp
+putchar\b\b\b\b\b\b\b_______ and putword\b\b\b\b\b\b\b_______ write a byte or word respectively into the string
+and advance the write pointer.
+
+.ul
+lookchar
+and
+.ul
+lookword
+read
+a byte or word respectively from the string but do not advance the read pointer.
+
+getchar\b\b\b\b\b\b\b_______ and getword\b\b\b\b\b\b\b_______ read a byte or word respectively from the string and advance the read pointer.
+
+alterchar\b\b\b\b\b\b\b\b\b_________ and alterword\b\b\b\b\b\b\b\b\b_________ write a byte or word respectively into the string where the read pointer
+is pointing and advance the read pointer.
+
+backspace\b\b\b\b\b\b\b\b\b_________ and backword\b\b\b\b\b\b\b\b________ read the last byte or word written and decrement the write pointer.
+
+All write operations will automatically get a larger block if the current block is exceeded.
+All read operations return with the error bit set if attempting to read beyond the write pointer.
+.sp
+seekchar\b\b\b\b\b\b\b\b________ moves the read pointer to the offset specified in r0.
+
+length\b\b\b\b\b\b______ returns the current length of the string (beginning pointer to write pointer) in r0.
+
+position\b\b\b\b\b\b\b\b________ returns the current offset of the read pointer in r0.
+
+rewind\b\b\b\b\b\b______ moves the read pointer to the beginning of the string.
+
+create\b\b\b\b\b\b______ returns the read and write pointers to the beginning of the string.
+
+fsfile\b\b\b\b\b\b______ moves the read pointer to the current position of the write pointer.
+
+zero\b\b\b\b____ zeros the whole string and sets the write pointer to the beginning of the string.
+
+copy\b\b\b\b____ copies the string whose header pointer is in r0 to the string whose header pointer is in
+r1.
+Care should be taken in using the copy instruction since r1 will be changed if the contents of the source string
+is bigger than the destination string.
+
+wc\b\b__ forces the contents of the internal buffers and the header blocks to be written on disc.
+.sp
+.ti 0
+FILES          The allocator is in
+/lib/libs.a;
+the -s\b\b__ option to ld\b\b__ will link edit
+references to the allocator.
+
+alloc.d is the temporary file used to contain
+the strings.
+
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "error in copy" if a disk write error occurs during the execution of the copy instruction.
+"error in allocator" if any routine is called with a bad header pointer.
+"Cannot open output file" if file alloc.d cannot be created or opened.
+"Out of space" if there's no available block of the requested size or no headers available for a new block.
+.sp
+.fi
+.in16
+.ti 0
+BUGS           --
diff --git a/man/man3/sin.3 b/man/man3/sin.3
new file mode 100644 (file)
index 0000000..80bdddb
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'SIN, COS (III)'3/15/72'SIN, COS (III)'
+.ti 0
+NAME           sin, cos -- sine cosine
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,sin (cos)
+.sp
+.ti 0
+DESCRIPTION    The
+sine (cosine) of fr0 in radians
+is returned in fr0.
+.sp
+The magnitude of the argument should be checked
+by the caller to make sure the result is meaningful.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    there are none
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/sqrt.3 b/man/man3/sqrt.3
new file mode 100644 (file)
index 0000000..425886c
--- /dev/null
@@ -0,0 +1,24 @@
+.pa 1
+.he 'SQRT (III)'3/15/72'SQRT (III)'
+.ti 0
+NAME           sqrt -- square root function
+.sp
+.ti 0
+SYNOPSIS       jsr     r5,sqrt
+.sp
+.ti 0
+DESCRIPTION    The
+square root of fr0 is returned in fr0.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    The c-bit is
+set on negative arguments and 0 is returned.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/switch.3 b/man/man3/switch.3
new file mode 100644 (file)
index 0000000..c6ccccb
--- /dev/null
@@ -0,0 +1,44 @@
+.pa 1
+.he 'SWITCH (III)'3/15/72'SWITCH (III)'
+.ti 0
+NAME           switch  --  switch on value
+.sp
+.ti 0
+SYNOPSIS       (switch value in r0)
+.br
+jsr    r5,switch; swtab
+.br
+(not-found return)
+.br
+.li
+...
+.ti -7
+swtab: val1; lab1;
+.br
+.li
+...
+.br
+valn; labn
+.br
+.li
+..;  0
+.sp
+.ti 0
+DESCRIPTION    switch\b\b\b\b\b\b______
+compares the value of r0 against each of the val\di\u; if
+a match is found, control is transferred to the corresponding
+lab\di\u (after popping the stack once).
+If no match has been found by the time a null lab\di\u
+occurs, switch\b\b\b\b\b\b______ returns.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man3/ttyn.3 b/man/man3/ttyn.3
new file mode 100644 (file)
index 0000000..9c9d239
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he 'TTYN (III)'1/15/73'TTYN (III)'
+.ti 0
+NAME           ttyn -- return name of current tty
+.sp
+.ti 0
+SYNOPSIS       jsr pc,ttyn
+.sp
+.ti 0
+DESCRIPTION    The routine hunts up the name of the
+input tty attached to the process (one byte from the set
+{012345678abc} at present) and returns it in r0.
+.sp
+"x" is returned if no genuine input tty is attached to the process.
+.sp
+.ti 0
+FILES          kept in /lib/liba.a
+.sp
+.ti 0
+SEE ALSO       fstat(II)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man4/dc.4 b/man/man4/dc.4
new file mode 100644 (file)
index 0000000..b161f0e
--- /dev/null
@@ -0,0 +1,214 @@
+.pa 1
+.he 'DC (IV)'6/12/72'DC (IV)'
+.tr |
+.ti 0
+NAME           dc -- DC-11 communications interfaces
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+The special files
+/dev/tty0, /dev/tty1, ...
+refer to the
+DC11 asynchronous communications interfaces.
+At the moment there are ten of them, but the number is subject
+to change.
+
+When one of these files is opened, it causes
+the process to wait until a connection is established.
+(In practice, however, user's programs seldom open these
+files; they are opened by init\b\b\b\b____ and become a user's standard
+input and output file.)
+The very first type\ 6writer file open in a process becomes
+the control\b\b\b\b\b\b\b_______ type\b\b\b\b____\ 6writer\b\b\b\b\b\b______
+for that process.  The control type\ 6writer plays a special
+role in handling quit or interrupt signals, as discussed
+below.
+The control type\ 6writer is inherited by a child process during a fork\b\b\b\b____.
+
+A terminal associated with one of these files ordinarily
+operates in full-duplex mode.  Char\ 6ac\ 6ters may be typed at any time,
+even while output is occurring, and are only lost when the
+system's char\ 6ac\ 6ter input buffers become completely
+choked, which is rare,
+or when the user has accumulated the maximum allowed number of
+input characters which have not yet been read by some program.
+Currently this limit is 150 characters.
+When this is happening the character "#" is echoed for every lost
+input character.
+
+When first opened,
+the interface mode is
+ASCII characters;
+150 baud;
+even parity only accepted;
+10 bits/character (one stop bit);
+and newline action character.
+The system delays transmission after sending certain function characters.
+Delays for horizontal tab, newline, and form feed are calculated for
+the Teletype Model 37;
+the delay for carriage return is calculated for the GE TermiNet|300.
+Most of these operating states can be changed
+by using the system call stty(II).
+In particular
+the following hardware states are program settable independently
+for input and output (see DC11 manual):
+134.5, 150, 300, or 1200 baud;
+one or two stop bits on output;
+and 5, 6, 7, or 8 data bits/character.
+In addition, the following software modes can be invoked:
+acceptance of even parity, odd parity, or both;
+a raw mode in which all characters may be read one at a time;
+a carriage return (CR) mode in which
+CR is mapped into newline on input and
+either CR or line feed (LF) cause echoing of
+the sequence LF-CR;
+mapping of upper case letters into lower case;
+suppression of echoing;
+suppression of delays after function characters;
+the printing of tabs as spaces;
+and setting the system to handle IBM|2741s.
+See getty(VII) for the way that terminal speed and type are
+detected.
+
+Normally, type\ 6writer input is processed in units of lines.
+This means that a program attempting
+to read will be suspended until an entire line has been
+typed.  Also, no matter how many char\ 6ac\ 6ters are requested
+in the read call, at most one line will be returned.
+It is not however necessary to read a whole line at
+once; any number of char\ 6ac\ 6ters may be
+requested in a read, even one, without losing information.
+
+During input, erase and kill processing is normally
+done.
+The char\ 6ac\ 6ter "#" erases the
+last char\ 6ac\ 6ter typed, except that it will not erase
+beyond the beginning of a line or an EOT.
+The char\ 6ac\ 6ter "@" kills the entire
+line up to the point where it was typed, but not beyond an EOT.  Both these
+char\ 6ac\ 6ters operate on a keystroke basis independently
+of any backspacing or tabbing that may have been done.
+Either "@" or "#" may be entered literally by preceding
+it by "\\";
+the erase or kill character remains, but the
+"\\" disappears.
+
+It is possible to use raw mode in which
+the program
+reading is awakened on each character.
+In raw mode, no erase or kill processing is done;
+and the EOT, quit and interrupt characters
+are not treated specially.
+
+The ASCII EOT char\ 6ac\ 6ter may be used to generate an end of file
+from a type\ 6writer.
+When an EOT is received, all the char\ 6ac\ 6ters
+waiting to be read are immediately passed to
+the program, without waiting for a new-line.
+Thus if there are no char\ 6ac\ 6ters waiting, which
+is to say the EOT occurred at the beginning of a line,
+zero char\ 6ac\ 6ters will be passed back, and this is
+the standard end-of-file signal.
+The EOT is not passed on except in raw mode.
+
+When the carrier signal from the dataset drops (usually
+because the user has hung up his terminal) any read
+returns with an end-of-file indication.
+Thus programs which read a type\ 6writer and test for
+end-of-file on their input
+can terminate appropriately when
+hung up on.
+
+Two char\ 6ac\ 6ters have a special meaning when typed.
+The ASCII DEL char\ 6ac\ 6ter (sometimes called "rub\ 6out")
+is the interrupt\b\b\b\b\b\b\b\b\b_________ signal.
+When this char\ 6ac\ 6ter is received from a given type\ 6writer,
+a search is made for all processes which have this type\ 6writer
+as their control type\ 6writer,
+and which have not informed the system that they wish
+to ignore interrupts.
+If there is more than one such process, one of these is
+selected, for practical purposes at random.
+The process is either forced to exit
+or a trap is simulated to an agreed-upon location
+in the process.
+See intr(II).
+
+The ASCII char\ 6ac\ 6ter FS is the quit\b\b\b\b____ signal.
+Its treatment is identical to the interrupt signal
+except that unless the receiving process has
+made other arrangements it will not only be terminated
+but a core image file will be generated.
+See quit(II).
+The character is not passed on except in raw mode.
+
+Output is prosaic compared to input.
+When one or more
+char\ 6ac\ 6ters are written, they are actually transmitted
+to the terminal as soon as previously-written char\ 6ac\ 6ters
+have finished typing.
+Input characters are echoed by putting them in the output queue
+as they arrive.
+When a process produces char\ 6ac\ 6ters more rapidly than they can be typed,
+it will be suspended when its output queue exceeds some limit.
+When the queue has drained down to some threshold
+the program is resumed.
+Even-parity is always generated on output.
+The EOT character is not transmitted to prevent terminals
+which respond to it from being hung up.
+.sp
+The system will handle IBM|2741 terminals.
+See getty(VII) for the way that 2741s are detected.
+In 2741 mode,
+the hardware state
+is:
+134.5 baud;
+one output stop bit;
+and 7 bits/character.
+Because the 2741 is inherently half-duplex,
+input is not echoed.
+Proper function delays are provided.
+For 2741s without a feature known as "transmit interrupt"
+it is not possible to collect input ahead of the time that
+a program reads the typewriter,
+because once the keyboard has been enabled there is no way
+to send further output to the 2741.
+It is currently
+assumed that the feature is absent;
+thus the keyboard is unlocked only when some program reads.
+The interrupt signal (normally ASCII DEL) is simulated
+when the 2741 "attention" key is pushed to generate either
+a 2741 style EOT or a break.
+It is not possible to generate anything corresponding to
+the end-of-file EOT or the quit signal.
+Currently IBM EBCDIC is default for input and output;
+correspondence code output is settable (see stty(I)).
+.tr ||
+The full ASCII character set is not available:
+"[", "]", "{", "}", "~", are missing on input and are printed as blank on output;
+"c\b|" is used for "\\";
+"\ e_\ f" for "^";
+" " for both "'" and"`"on output;
+and " " maps into "'" on input.
+.tr |
+Similar mappings occur with correspondence code output.
+.sp
+.in 16
+.ti 0
+FILES          /dev/tty[01234567ab]    113B dataphones
+.br
+/dev/ttyc              display data set
+.br
+/dev/ttyd              113B with /dev/dn1
+.sp
+.ti 0
+SEE ALSO       kl(IV), getty(VII)
+.sp
+.ti 0
+BUGS           The
+primarily Model 37 oriented delays
+may not be appropriate
+for all other ASCII terminals.
+.tr ||
diff --git a/man/man4/dn.4 b/man/man4/dn.4
new file mode 100644 (file)
index 0000000..d6ee9f8
--- /dev/null
@@ -0,0 +1,35 @@
+.pa 1
+.he 'DN (IV)'3/15/72'DN (IV)'
+.ti 0
+NAME           dn -- dn-11 ACU interface
+.sp
+.ti 0
+DESCRIPTION    dn?\b\b\b___
+is a write-only file.
+Bytes written on dn?\b\b\b___ must be
+ASCII as follows:
+
+   0-9 dial 0-9
+    :  dial *
+    ;  dial #
+    =  end-of-number
+
+The entire telephone number must be
+presented in a single write\b\b\b\b\b_____ system call.
+
+It is recommended that an end-of-number
+code be given even though only one of the
+ACU's (113C) actually requires it.
+.sp
+.ti 0
+FILES          /dev/dn0        connected to 801 with dp0
+.br
+/dev/dn1       connected to 113C with ttyd
+.br
+/dev/dn2       not currently connected
+.sp
+.ti 0
+SEE ALSO       dp(IV), dc(IV), write(II)
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man4/dp.4 b/man/man4/dp.4
new file mode 100644 (file)
index 0000000..f35898c
--- /dev/null
@@ -0,0 +1,32 @@
+.pa 1
+.he 'DP (IV)'3/15/72'DP (IV)'
+.ti 0
+NAME           dp -- dp-11 201 data-phone interface
+.sp
+.ti 0
+DESCRIPTION    dp?\b\b\b___
+is a 201 data-phone interface file.
+read\b\b\b\b____ and write\b\b\b\b\b_____ calls to dp?\b\b\b___
+are limited to a maximum of 400 bytes.
+Each write call is sent as a single record.
+Seven bits from each byte
+are written along with an eighth odd parity
+bit.
+The sync must be user supplied.
+Each read call returns characters received from a
+single record.
+Seven bits are returned unaltered; the eighth bit
+is set if the byte was not received in odd parity.
+A 20 second time out is set and a zero byte
+record is returned if nothing is received in that time.
+.sp
+.ti 0
+FILES          /dev/dp0        201 dataphone used to call GCOS
+.sp
+.ti 0
+SEE ALSO       dn(IV), gerts(III)
+.sp
+.ti 0
+BUGS           The dp\b\b__ file is
+GCOS oriented.
+It should be more flexible.
diff --git a/man/man4/kl.4 b/man/man4/kl.4
new file mode 100644 (file)
index 0000000..1a7dd06
--- /dev/null
@@ -0,0 +1,41 @@
+.pa 1
+.he 'KL (IV)'3/15/72'KL (IV)'
+.ti 0
+NAME           kl -- KL-11/TTY-33 console typewriter
+.sp
+.ti 0
+DESCRIPTION    tty\b\b\b___
+(as distinct from tty?\b\b\b\b____)
+refers to the console
+typewriter hard-wired to the PDP-11 via a KL-11 interface.
+
+Generally, the disciplines involved in dealing with tty\b\b\b___
+are similar to those for tty?\b\b\b\b____ and section
+dc(IV) should be consulted.
+The following differences are salient:
+
+The system calls stty\b\b\b\b____ and gtty\b\b\b\b____ do not apply to this
+device.
+It cannot be placed in raw mode; on input, upper case letters
+are always mapped into lower case letters;
+a carriage return is echoed when a line-feed is typed.
+
+The quit character is not FS (as with tty?\b\b\b\b____) but
+is generated by the key labelled "alt mode."
+
+By appropriate
+console switch settings, it is possible to cause
+UNIX to
+come up as a single-user system
+with I/O on this device.
+.sp
+.ti 0
+FILES          /dev/tty
+.br
+/dev/tty8      synonym for /dev/tty
+.sp
+.ti 0
+SEE ALSO       dc(IV), init(VII)
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man4/mem.4 b/man/man4/mem.4
new file mode 100644 (file)
index 0000000..1942556
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'MEM (IV)'3/15/72'MEM (IV)'
+.ti 0
+NAME           mem  --  core memory
+.sp
+.ti 0
+DESCRIPTION    mem\b\b\b___
+is a special file that is an image of the core memory
+of the computer.
+It may be used, for example, to examine,
+and even to patch the system using the debugger.
+
+Mem\b\b\b___ is a byte-oriented file; its bytes are numbered
+0 to 65,535.
+
+If a non-existent memory location is
+referenced, the user
+suffers the resultant bus error.
+
+Memory referenced through
+the file is treated with movb\b\b\b\b____ instructions.
+Certain device registers do not implement
+DATOB cycles to odd addresses.
+Other registers react strangely to this
+addressing.
+.sp
+.ti 0
+FILES          /dev/mem
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man4/pc.4 b/man/man4/pc.4
new file mode 100644 (file)
index 0000000..461788e
--- /dev/null
@@ -0,0 +1,38 @@
+.pa 1
+.he 'PC (IV)'3/15/72'PC (IV)'
+.ti 0
+NAME           pc  --  PC-11 paper tape reader/punch
+.sp
+.ti 0
+DESCRIPTION    ppt\b\b\b___
+refers to the PC-11 paper tape reader or punch,
+depending on whether it is read or written.
+
+When ppt\b\b\b___ is opened for writing, a 100-char\ 6ac\ 6ter leader
+is punched.
+Thereafter each byte written is punched on
+the tape.  No editing of the char\ 6ac\ 6ters
+is performed.
+When the file is closed, a 100-char\ 6ac\ 6ter trailer is punched.
+
+When ppt\b\b\b___ is opened for reading, the process
+waits until tape is placed in the reader and the reader
+is on-line.
+Then requests to read cause the char\ 6ac\ 6ters read
+to be passed back to the program, again without
+any editing.
+This means that several null leader characters
+will usually appear at the beginning of the file.
+Likewise several nulls are likely to appear at the end.
+End-of-file is generated when the tape runs out.
+
+Seek calls for this file are meaningless.
+.sp
+.ti 0
+FILES          /dev/ppt
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man4/rf.4 b/man/man4/rf.4
new file mode 100644 (file)
index 0000000..134889b
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he 'RF (IV)'3/15/72'RF (IV)'
+.ti 0
+NAME           rf  --  RF11-RS11 fixed-head disk file
+.sp
+.ti 0
+DESCRIPTION    This file refers to the
+concatenation of both RS-11 disks.
+It may be either read or written, although writing is inherently
+very dangerous, since
+a file system resides there.
+
+The disk contains 2048 256-word blocks,
+numbered 0 to 2047.
+Like the other block-structured devices (TC, RK)
+this file is addressed in blocks, not bytes.
+This has two consequences:
+seek\b\b\b\b____ calls refer to block numbers, not byte numbers;
+and sequential reading or writing always advance the read
+or write pointer by at least one block.
+Thus successive reads of 10 characters from this file
+actually read the first 10 characters from successive
+blocks.
+.sp
+.ti 0
+FILES          /dev/rf0
+.sp
+.ti 0
+SEE ALSO       tc(IV), rk(IV)
+.sp
+.ti 0
+BUGS           The fact that this device
+is addressed in terms of blocks, not bytes, is extremely
+unfortunate.  It is due entirely to the fact that
+read and write pointers (and consequently the arguments
+to seek\b\b\b\b____) are single-precision
+numbers.
diff --git a/man/man4/rk.4 b/man/man4/rk.4
new file mode 100644 (file)
index 0000000..5943231
--- /dev/null
@@ -0,0 +1,28 @@
+.pa 1
+.he 'RK (IV)'3/15/72'RK (IV)'
+.ti 0
+NAME           rk  --  RK-11/RK03 (or RK05) disk
+.sp
+.ti 0
+DESCRIPTION    rk?\b\b\b___
+refers to an entire RK03 disk as a single sequentially-addressed
+file.
+Its 256-word blocks are numbered 0 to 4871.
+Like the RF disk and the tape files, its
+addressing is block-oriented.
+Consult the rf(IV) section.
+.sp
+.ti 0
+FILES          /dev/rk0        user available drive
+.br
+/dev/rk1       /usr file system
+.br
+/dev/rk2       /sys file system
+.br
+/dev/rk3       /crp file system
+.sp
+.ti 0
+SEE ALSO       rf(IV), tc(IV)
+.sp
+.ti 0
+BUGS           See rf(IV)
diff --git a/man/man4/tc.4 b/man/man4/tc.4
new file mode 100644 (file)
index 0000000..6576c60
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'TC (IV)'3/15/72'TC (IV)'
+.ti 0
+NAME           tc -- TC-11/TU56 DECtape
+.sp
+.ti 0
+DESCRIPTION    The
+files tap0 ... tap7 refer to the
+TC-11/TU56 DECtape drives 0 to 7.
+Since the logical drive number can be manually set,
+all eight files exist even though at present there are fewer
+physical drives.
+
+The 256-word blocks on a standard DECtape are numbered 0 to 577.
+However, the system makes no assumption about this number;
+a block can be read or written if it exists on the
+tape and not otherwise.
+An error is returned if a transaction
+is attempted for a block which does not exist.
+
+Addressing on the tape files, like that on the
+RK and RF disks, is block-oriented.
+.sp
+.ti 0
+FILES          /dev/tap?
+.sp
+.ti 0
+SEE ALSO       rf(IV), tap(I)
+.sp
+.ti 0
+BUGS           see rf(IV)
diff --git a/man/man4/tm.4 b/man/man4/tm.4
new file mode 100644 (file)
index 0000000..470af7b
--- /dev/null
@@ -0,0 +1,38 @@
+.pa 1
+.he 'TM (IV)'6/12/72'TM (IV)'
+.ti 0
+NAME           tm -- TM-11/TU-10 magtape interface
+.sp
+.ti 0
+DESCRIPTION    mt?\b\b\b___
+is the DEC TU10/TM11 magtape.
+When opened for reading or writing,
+the magtape is rewound.
+A tape consists of a
+series of 512 byte records terminated by an
+end-of-file.
+Reading less than 512 bytes
+causes the rest of a record to be ignored.
+Writing less than a record causes
+null padding to 512 bytes.
+When the magtape is closed
+after writing,
+an end-of-file is written.
+.sp
+Seek has no effect on the magtape.
+The magtape can only be opened once at
+any instant.
+.sp
+.ti 0
+FILES          /dev/mt0        selected drive 0
+.sp
+.ti 0
+SEE ALSO       mt(I)
+.sp
+.ti 0
+BUGS           Seek
+should work on the magtape.
+Also, a provision of having the tape open for
+reading and writing should exist.
+A multi-file and multi-reel facility should
+be incorporated.
diff --git a/man/man4/vt.4 b/man/man4/vt.4
new file mode 100644 (file)
index 0000000..a74d00c
--- /dev/null
@@ -0,0 +1,230 @@
+.pa 1
+.he 'VT (IV)'2/11/73'VT (IV)'
+.ti 0
+NAME           vt -- 11/20 (vt01) interface
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+The file vt0\b\b\b___ provides
+the interface to a PDP 11/20 which
+runs both a VT01A-controlled Tektronix 611
+storage display,
+and a Federal Screw Works (Vocal Interface Division)
+voice synthesizer.
+The inter-computer interface is
+a pair of DR-11C word interfaces.
+
+Although the display has essentially only two commands,
+namely "erase screen" and "display point", the 11/20 program
+will draw points, lines, and arcs, and print
+text on the screen.
+The 11/20 can also type information
+on the attached 33 TTY and generate utterances via the
+voice synthesizer.
+
+This special file operates in two basic modes, selected
+by bit 2 (octal 04) on the 11/20's console switches.
+If this bit is on at the opening of the file,
+all bytes written on the file are interpreted as ASCII characters
+and written on the screen.
+The screen has 33 lines (1/2 a standard page).
+The file simulates a 37 TTY: the control characters
+NL, CR, BS, and TAB are interpreted correctly.
+It also interprets the usual escape sequences
+for forward and reverse half-line motion and for
+full-line reverse.
+Greek is not available yet.
+Normally, when the screen is full (i.e. the 34th line is started)
+the screen is erased before starting a new page.
+To allow perusal of the displayed text, it is usual to
+assert bit 0 of the console switches (octal 01).
+As explained below, this causes the program to
+pause before erasing until one of the attached pushbuttons
+is depressed.
+
+If bit 2 of the switches is down, the display is in graphic
+mode.
+In this case bytes written on the file
+are interpreted as display and vocal
+commands.
+Each command consists of a single byte usually followed
+by parameter bytes.
+Often the parameter bytes represent
+points in the plotting area.
+Each point coordinate consists of 2 bytes
+interpreted as a 2's complement 16-bit number.
+The plotting area itself measures (+\b_03777)X(+\b_03777)
+(numbers in octal);
+that is, 12 bits of precision.
+Attempts to plot
+points outside the screen limits are ignored.
+
+The graphic and sonic commands are:
+
+.in +5
+.ti -5
+order (1); 1 parameter byte
+.br
+The parameter indicates a subcommand, possibly followed
+by subparameter bytes, as follows:
+.in +5
+
+.ti -5
+erase (1)
+.br
+The screen is erased.
+This action may be delayed, as explained below,
+until a pushbutton is depressed.
+
+.ti -5
+label (2); several subparameter bytes
+.br
+The following bytes up to a null character
+are taken as a label and typed on the console TTY.
+One of the console switches gives labels
+a special interpretation, as explained below.
+
+.ti -5
+.nf
+display label (3); several subparameter bytes
+.fi
+.br
+The following bytes up to a null byte are printed
+as ASCII text on the screen.
+The origin of the text is the last previous point
+plotted; or the upper left hand of the screen if there were none.
+
+.in -5
+.ti -5
+point (2); 4 parameter bytes
+.br
+The 4 parameter bytes are taken as a pair of coordinates
+representing a point to be plotted.
+
+.ti -5
+line (3); 8 parameter bytes
+.br
+The parameter bytes are taken as 2 pairs of coordinates
+representing the ends of a line segment which is plotted.
+Only the portion lying within the screen is displayed.
+
+.ti -5
+frame (4); 1 parameter byte
+.br
+The parameter byte is taken as a number of sixtieths of a second;
+an externally-available lead is asserted for that time.
+Typically the lead is connected to
+an automatic camera
+which advances its film and opens the
+shutter for the specified time.
+
+.ti -5
+circle (5); 6 parameter bytes
+.br
+The parameter bytes are taken as a coordinate pair representing
+the origin, and a word representing the radius of a circle.
+That portion of the circle which lies within the screen is plotted.
+
+.ti -5
+arc (6); 12 parameter bytes
+.br
+The first 4 parameter bytes are taken to be a coordinate-pair
+representing the center of a circle.
+The next 4 represent a coordinate-pair specifying a point
+on this circle.
+The last 4 should represent another point on the
+circle.
+An arc is drawn counter-clockwise from the first circle point
+to the second.
+If the two points are the same, the whole circle is drawn.
+For the second point, only the smaller in magnitude
+of its two coordinates is significant;
+the other is used only to find the quadrant of the end of the arc.
+In any event only points within the screen limits are
+plotted.
+
+.ti -5
+dot-line (7); at least 6 parameter bytes
+.br
+The first 4 parameter bytes are taken
+as a coordinate-pair representing the origin
+of a dot-line.
+The next byte is taken as a signed
+x-increment.
+The next byte is an unsigned word-count,
+with "0" meaning "256".
+The indicated
+number of words is picked up.
+For each bit in each word a point is plotted
+which is visible if the bit is "1", invisible
+if not.
+High-order bits are plotted first.
+Each successive point (or non-point) is offset
+rightward by the given x-increment.
+
+.ti -5
+speak(8); several parameter bytes
+.br
+The following bytes up to a null byte are taken
+to represent phonemes which are fed to
+the voice synthesizer.
+vsp(VII) gives the encoding.
+
+.in -5
+The 3 low-order console switches of the 11/20
+modify the operation of the display as follows.
+
+Bit 2 (octal 04) is examined at the time the display
+file is opened (more precisely, when the first byte
+is written after an open); as indicated,
+when on\b\b__ it selects character mode, otherwise graphic
+mode.
+
+Bit 1 (octal 02)
+determines whether TTY labels are to be interpreted.
+Unless this bit is on\b\b__, labels are ignored.
+(except to terminate skip mode, see below).
+
+Bit 0 (octal 01) determines
+whether the display will pause before erasing
+the screen;
+if off\b\b\b___ there will be no pause.
+.a
+If bit 0 is on\b\b__, the erase will occur
+and displaying will resume only when one of the
+16 pushbuttons is depressed.
+
+There is a box with 16 pushbuttons connected
+to the 11/20.
+Their state is at all times available in the 11/45
+by executing the csw\b\b\b___ system call (II).
+They are used by the 11/20 when it is pausing
+before an erase.
+14 of the buttons merely serve to allow the display
+to continue.
+If, however, button 7
+is pushed,
+the display will ignore commands up to the
+next erase command, then ring the TTY console's bell,
+thereby skipping an entire picture.
+
+If button 8 is depressed,
+the display will ignore commands up to the next TTY label
+(whether or not its typing is suppressed) before
+resuming the displays.
+Thus a sequence of frames may be skipped.
+.sp
+.in 16
+.ti 0
+FILES          /dev/vt0
+.sp
+.ti 0
+SEE ALSO       csw(II), vsp(VII)
+.sp
+.ti 0
+BUGS           Two
+users using vt0 simultaneously
+can interfere with each other,
+e.g. plot phonemes or speak display coordinates.
diff --git a/man/man5/a.out.5 b/man/man5/a.out.5
new file mode 100644 (file)
index 0000000..15cc5e8
--- /dev/null
@@ -0,0 +1,150 @@
+.pa 1
+.he 'A.OUT (V)'3/15/72'A.OUT (V)'
+.ti 0
+.nf
+NAME           a.out  --   assembler and link editor output
+.fi
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+a.out\b\b\b\b\b_____
+is the output file of the assembler as\b\b__ and the link editor ld\b\b__.
+In both cases, a.out\b\b\b\b\b_____ may be executed provided there
+were no errors and no unresolved external references.
+.sp
+This file has four sections:
+a header, the program and data text, a symbol table, and relocation bits
+(in that order).
+The last two may be empty
+if the program was loaded
+with the "-s" option
+of ld\b\b__ or if the symbols and relocation have been
+removed by strip\b\b\b\b\b_____.
+
+The header always contains 8 words:
+
+.in +6
+.ti -3
+1  A magic number (407(8))
+.ti -3
+2  The size of the program text segment
+.ti -3
+3  The size of the initialized data segment
+.ti -3
+4  The size of the uninitialized (bss) segment
+.ti -3
+5  The size of the symbol table
+.ti -3
+6  The entry location (always 0 at present)
+.ti -3
+7  The stack size required (0 at present)
+.ti -3
+8  A flag indicating relocation bits have been suppressed
+
+.in -6
+The sizes of each segment are in bytes but are even.
+The size of the header is not included in any of the other sizes.
+
+When a file produced by the assembler or loader is
+loaded into core for execution, three segments are
+set up: the text segment, the data segment,
+and the bss (uninitialized data) segment,
+in that order.
+The text segment begins at the lowest
+location in the core image; the header is not loaded.
+The data segment begins immediately after the text
+segment, and the bss segment immediately after
+the data segment.
+The bss segment is initialized by 0's.
+In the future the text segment will be write-protected
+and shared.
+
+The start of the text segment in the file is 20(8);
+the start of the data segment is 20+S\e9t\e8 (the size of the text)
+the start of the relocation information is 20+S\e9t\e8+S\e9d\e8;
+the start of the symbol table is 20+2(S\e9t\e8+S\e9d\e8) if the
+relocation information is present, 20+S\e9t\e8+S\e9d\e8 if not.
+
+The symbol table consists of 6-word entries.  The first
+four contain the ASCII name of the symbol, null-padded.
+The next word is a flag indicating the type of symbol.
+The following values are possible:
+
+   00  undefined symbol
+   01  absolute symbol
+   02  text segment symbol
+   03  data segment symbol
+   04  bss segment symbol
+   40  undefined external (.globl) symbol
+   41  absolute external symbol
+   42  text segment external symbol
+   43  data segment external symbol
+   44  bss segment external symbol
+
+Values other than those given above may
+occur if the user has defined some of his own instructions.
+
+The last word of a symbol table entry contains the value of the symbol.
+
+If the symbol's type is undefined external,
+and the value field is non-zero,
+the symbol is interpreted by the loader ld\b\b__ as
+the name of a common region
+whose size is indicated by the value of the
+symbol.
+
+The value of a word in the text or data portions which is not
+a reference to an undefined external symbol
+is exactly that value which will appear in core
+when the file is executed.
+If a word in the text or data portion
+involves a reference to an undefined external symbol,
+as indicated by the relocation bits
+for that word,
+then the value of the word as stored in the file
+is an offset from the associated external symbol.
+When the file is processed by the
+link editor and the external symbol becomes
+defined, the value of the symbol will
+be added into the word in the file.
+
+If relocation
+information is present, it amounts to one word per
+word of program text or initialized data.
+There is no relocation information if the "suppress relocation"
+flag in the header is on.
+
+Bits 3-1 of a relocation word indicate the segment referred
+to by the text or data word associated with the relocation
+word:
+
+.in +6
+.ti -4
+00  indicates the reference is absolute
+.ti -4
+02  indicates the reference is to the text segment
+.ti -4
+04  indicates the reference is to the data segment
+.ti -4
+06  indicates the reference is to the bss segment
+.ti -4
+10  indicates the reference is to an undefined external symbol.
+
+.in -6
+Bit 0 of the relocation word indicates if on\b\b__ that the
+reference is relative to the pc (e.g. "clr x");
+if off\b\b\b___, the reference is to the actual symbol (e.g.,
+"clr *$x").
+
+The remainder of the relocation word (bits 15-4)
+contains a symbol number in the case of external
+references, and is unused otherwise.
+The first symbol is numbered 0, the second 1, etc.
+.sp
+.in 16
+.ti 0
+SEE ALSO       as\b\b__,
+.ul
+ld, strip, nm, un(I)
diff --git a/man/man5/ar.5 b/man/man5/ar.5
new file mode 100644 (file)
index 0000000..c5287fe
--- /dev/null
@@ -0,0 +1,55 @@
+.pa 1
+.he 'ARCHIVE (V)'3/15/72'ARCHIVE (V)'
+.ti 0
+NAME           archive (library) file format
+.sp
+.ti 0
+DESCRIPTION    The
+archive command ar\b\b__ is used to combine several files into
+one.
+Archives are used mainly as libraries to be searched
+by the link-editor ld\b\b__.
+
+A file produced by ar\b\b__
+has a "magic number" at the start,
+followed by the constituent files, each preceded by a file header.
+The magic number is
+177555(8)
+(it was chosen to be unlikely to occur anywhere else).
+The header of each file is 16 bytes long:
+
+.in +5
+.ti -3
+0-7
+.br
+file name, null padded on the right
+
+.ti -3
+8-11
+.br
+Modification time of the file
+
+.ti -3
+12
+.br
+User ID of file owner
+
+.ti -3
+13
+.br
+file mode
+
+.ti -3
+14-15
+.br
+file size
+
+.in -5
+If the file is an odd number of bytes long, it is padded
+with a null byte, but the size in the header is correct.
+
+Notice there is no provision for empty areas in an archive
+file.
+.sp
+.ti 0
+SEE ALSO       ar\b\b__, ld\b\b__
diff --git a/man/man5/core.5 b/man/man5/core.5
new file mode 100644 (file)
index 0000000..c65f8da
--- /dev/null
@@ -0,0 +1,57 @@
+.pa 1
+.he 'CORE (V)'2/7/73'CORE (V)'
+.ti 0
+NAME           format of core image
+.sp
+.ti 0
+DESCRIPTION    UNIX
+writes out a core image of a terminated
+process when any of various errors occur.
+See wait\b\b\b\b____(II) for the list of reasons;
+the most common are memory violations, illegal
+instructions, bus errors, and user-generated
+quit signals.
+
+The core image is called "core" and is written in the process's
+working directory (provided it can be; normal
+access controls apply).
+
+The size and structure of the core image file
+depend to some extent on which system is involved.
+In general there is a 512-byte area
+at the end which contains the system's per-process
+data for that process.
+(64 bytes in older systems).  The
+remainder represents the actual contents of
+the user's core area when the core image
+was written.
+In the current system,
+this area is variable in size in that only the locations
+from user 0 to the program break, plus the stack, are
+dumped.
+
+When any fatal trap occurs,
+all the useful registers are stored on the stack.
+In the current system, which has relocation and protection
+hardware, the stack used is the system
+stack, which is kept in the per-process area;
+in older systems,
+there is only one stack, and it is located in the
+user's core area.
+
+The actual format of the information is complicated
+because it depends on what hardware is present (EAE,
+floating-point option),
+whether single- or double-precision
+floating mode is in effect,
+and also involves relocating addresses in the
+system's address space.
+A guru will have to be consulted
+if enlightenment is required.
+
+In general the debugger
+db(I) should
+be used to deal with core images.
+
+.ti 0
+SEE ALSO       db(I), wait(II)
diff --git a/man/man5/dir.5 b/man/man5/dir.5
new file mode 100644 (file)
index 0000000..c2c41e2
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'DIRECTORY (V)'3/15/72'DIRECTORY (V)'
+.ti 0
+NAME           format of directories
+.sp
+.ti 0
+DESCRIPTION    A direc\ 6tory
+behaves exactly like an ordinary file, save that no
+user may write into a directory.
+The fact that a file is a directory is indicated by
+a bit in the flag word of its i-node entry.
+
+Directory entries are 10 bytes long.
+The first word is the i-number of the file represented
+by the entry, if non-zero; if zero, the entry is empty.
+
+Bytes 2-9 represent the (8-character)
+file name, null padded on the right.
+These bytes are not cleared for empty slots.
+
+By convention, the first two entries in each directory
+are for "." and "..".  The first is an entry for the
+directory itself.  The second is for the parent
+directory.
+The meaning of ".." is modified for the root directory
+of the master file system and for the root directories of removable
+file systems.
+In the first case, there is no parent, and in the second,
+the system does not permit off-device references.
+Therefore in both cases ".." has the
+same meaning as ".".
+.sp
+.ti 0
+SEE ALSO       file system (V)
diff --git a/man/man5/fs.5 b/man/man5/fs.5
new file mode 100644 (file)
index 0000000..0d52b71
--- /dev/null
@@ -0,0 +1,147 @@
+.pa 1
+.he 'FILE SYSTEM (V)'3/15/72'FILE SYSTEM (V)'
+.ti 0
+NAME           format of file system
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+Every
+file system storage volume
+(e.g. RF disk, RK disk, DECtape reel)
+has a common format for certain vital information.
+
+Every such volume is divided into a certain number
+of 256 word (512 byte) blocks.  Blocks 0 and 1 are
+collectively known as the super\b\b\b\b\b_____-block\b\b\b\b\b_____ for the device;
+they define its extent and contain an i-node map
+and a free-storage map.
+The first word
+contains the number of bytes in the free-storage
+map; it is always even.
+It is followed by the map.
+There is one bit for each block on the device; the bit is "1"
+if the block is free.
+Thus if the
+number of free-map bytes is n\b_, the blocks on the device
+are numbered 0 through 8n\b_-1.
+The free-map count is followed by the free map
+itself.
+The bit for block k\b_ of the device
+is in byte k\b_/8 of the map; it is offset k\b_(mod 8) bits from the right.
+Notice that bits exist for the superblock and the i-list,
+even though they are never allocated or freed.
+
+After the free map is a word containing the byte count
+for the i-node map.  It too is always even.
+I-numbers below 41(10) are reserved
+for special files, and are
+never allocated; the first bit in the i-node
+free map refers to i-number 41.
+Therefore the byte number in the i-node map
+for i-node i\b_ is (i\b_-41)/8.
+It is offset (i\b_-41) (mod 8) bits from the right; unlike
+the free map, a "0" bit indicates an available i-node.
+
+I-numbers begin at 1, and the storage for i-nodes
+begins at block 2.
+Also, i-nodes are 32 bytes long, so 16 of them fit into a block.
+Therefore, i-node i\b_ is located in block (i\b_+31)/16 of
+the file system, and begins 32\u.\d((i\b_+31)(mod 16)) bytes
+from its start.
+
+There is always one file system which is always mounted;
+in standard UNIX it resides on the RF disk.
+This device is also used for swapping.
+On the primary file system device, there are
+several pieces of information following that previously
+discussed.
+There are two words with the calendar time
+(measured since 00:00 Jan 1, 1972);
+two words with the time spent executing in the system;
+two words with the time spent waiting for I/O on the RF and RK
+disks; two words with the time spent executing in a user's
+core; one byte with the count of errors on the RF
+disk; and one byte with the count of errors on the RK disk.
+All the times are measured in sixtieths of a second.
+
+I-node 41(10) is reserved for the root directory of the
+file system.
+No i-numbers other than this one and those from
+1 to 40 (which represent special files) have a built-in
+meaning.
+Each i-node represents one file.
+The format of an i-node is as follows, where the
+left column represents the offset from the beginning
+of the i-node:
+.sp
+.nf
+.in +3
+0-1    flags (see below)
+2      number of links
+3      user ID of owner
+4-5    size in bytes
+6-7    first indirect block or contents block
+.li
+...
+20-21  eighth indirect block or contents block
+22-25  creation time
+26-29  modification time
+30-31          unused
+.fi
+.sp
+.ti -3
+The flags are as follows:
+.sp
+.nf
+100000 i-node is allocated
+040000 directory
+020000 file has been modified (always on)
+010000 large file
+000040 set user ID on execution
+000020 executable
+000010 read, owner
+000004 write, owner
+000002 read, non-owner
+000001 write, non-owner
+.sp
+.in -3
+.fi
+The allocated bit (flag 100000) is believed even
+if the i-node map says the i-node is free;
+thus corruption of the map may cause i-nodes
+to become unallocatable, but will not cause active
+nodes to be reused.
+
+Byte number n\b_ of a file is accessed as follows:
+n\b_ is divided by 512 to find its logical block number (say b\b_)
+in the file.
+If the file is small (flag 010000 is 0),
+then b\b_ must be less than 8, and the physical block
+number corresponding to b\b_ is the b\b_th entry
+in the address portion of the i-node.
+
+Even if the file is large, b\b_ will be less than
+128 (128*512 = 2^16).
+The first number in the i-node address
+portion
+gives the physical block number of the indirect block.
+b\b_ is doubled
+to give a byte offset in the indirect block
+and the word there found is the physical address of
+the block corresponding to b\b_.
+
+For block b\b_ in a file to exist, it
+is not necessary that all blocks less than b\b_ exist.
+A zero block number either in the address words of
+the i-node or in an indirect block indicates that the
+corresponding block has never been allocated.
+Such a missing block reads as if it contained all zero words.
+
+.in 16
+.ti 0
+BUGS           Two blocks are not enough to handle
+the i- and free-storage maps for an RP02
+disk pack, which contains around 10 million words.
+.sp
diff --git a/man/man5/passwd.5 b/man/man5/passwd.5
new file mode 100644 (file)
index 0000000..23f5587
--- /dev/null
@@ -0,0 +1,33 @@
+.pa 1
+.he 'PASSWD (V)'12/11/72'PASSWD (V)'
+.ti 0
+NAME           passwd  --  password file
+.sp
+.ti 0
+DESCRIPTION    passwd\b\b\b\b\b\b______
+contains for each user the
+following information:
+
+   name (login name, contains no upper case)
+   encrypted password
+   numerical user ID
+   GCOS job number and box number
+   initial working directory
+   program to use as Shell
+
+This is an ASCII file.  Each field within each user's entry
+is separated from the next by a colon.
+The job and box numbers are separated by a comma.
+Each user is separated from the next by a new-line.
+If the password field is null, no password is demanded;
+if the Shell field is null, the Shell itself
+is used.
+
+This file resides in directory /etc.
+Because of the encrypted
+passwords, it can and does have general read
+permission and can be used, for example,
+to map numerical user ID's to names.
+.sp
+.ti 0
+SEE ALSO       login(I), crypt(III), passwd(I)
diff --git a/man/man5/tap.5 b/man/man5/tap.5
new file mode 100644 (file)
index 0000000..2bc1171
--- /dev/null
@@ -0,0 +1,68 @@
+.pa 1
+.he 'TAP (V)'6/12/72'TAP (V)'
+.ti 0
+NAME           tap -- DEC/mag tape formats
+.sp
+.ti 0
+DESCRIPTION    The
+DECtape command tap\b\b\b___ and
+the magtape command mt\b\b__
+dump and extract files to and
+from their respective tape media.
+The formats of these tapes are the same except
+that magtapes have larger directories.
+.sp
+Block zero of the tape is not used.
+It is available to contain a boot program to be
+used in a stand-alone environment.
+This has proved valuable for DEC diagnostic programs.
+.sp
+Blocks 1 through 24
+for DECtape (1 through 146 for magtape)
+contain a directory of the tape.
+There are 192 (resp. 1168) entries in the directory;
+8 entries per block;
+64 bytes per entry.
+Each entry has the following format:
+.sp
+.in +3
+path name      32 bytes
+.br
+mode           1 byte
+.br
+uid            1 byte
+.br
+size           2 bytes
+.br
+time modified  4 bytes
+.br
+tape address   2 bytes
+.br
+unused         20 bytes
+.br
+check sum      2 bytes
+.sp
+.in -3
+The path name entry is the path name of the
+file when put on the tape.
+If the pathname starts with a zero word,
+the entry is empty.
+It is at most 32 bytes long and ends in a null byte.
+Mode, uid, size and time modified
+are the same as described under i-nodes (see file system (V))
+The tape address is the tape block number of the start of
+the contents of the file.
+Every file
+starts on a block boundary.
+The file occupies (size+511)/512 blocks
+of continuous tape.
+The checksum entry has a value such that
+the sum of the 32 words of the directory entry is zero.
+.sp
+Blocks 25 (resp. 147) on are available for file storage.
+.sp
+A fake entry (see mt(I), tap(I))
+has a size of zero.
+.sp
+.ti 0
+SEE ALSO       filesystem(V), mt(I), tap(I)
diff --git a/man/man5/utmp.5 b/man/man5/utmp.5
new file mode 100644 (file)
index 0000000..8b50684
--- /dev/null
@@ -0,0 +1,23 @@
+.pa 1
+.he 'UTMP (V)'3/15/72'UTMP (V)'
+.ti 0
+NAME           /tmp/utmp  -- user information
+.sp
+.ti 0
+DESCRIPTION    This
+file allows one to discover information about who is currently
+using UNIX.
+The file is binary; each entry is 16(10) bytes long.
+The first eight bytes contain a user's login name or
+are null if the table slot is unused.
+The low order byte of the next word contains the last
+character of a typewriter name.
+The next two words contain the user's login time.
+The last word is unused.
+
+This file resides in directory /tmp.
+.sp
+.ti 0
+SEE ALSO       /etc/init, which maintains the file;
+.br
+who(I), which interprets it.
diff --git a/man/man5/wtmp.5 b/man/man5/wtmp.5
new file mode 100644 (file)
index 0000000..5e840a6
--- /dev/null
@@ -0,0 +1,21 @@
+.pa 1
+.he 'WTMP (V)'3/15/72'WTMP (V)'
+.ti 0
+NAME           /tmp/wtmp  -- user login history
+.sp
+.ti 0
+DESCRIPTION    This
+file records all logins and logouts.
+Its format is exactly like utmp(V) except that
+a null user name indicates a logout on the associated
+typewriter, and the typewriter name 'x' indicates
+that UNIX was rebooted at that point.
+
+Wtmp is maintained by login(I) and init(VII).
+Neither of these programs creates the file,
+so if it is removed record-keeping is turned off.
+
+This file resides in directory /tmp.
+.sp
+.ti 0
+SEE ALSO       init(VII), login(I), acct(VIII), swtmp(VIII)
diff --git a/man/man6/bc.6 b/man/man6/bc.6
new file mode 100644 (file)
index 0000000..c0cdc8f
--- /dev/null
@@ -0,0 +1,62 @@
+.pa 1
+.he 'BC (VI)'6/12/72'BC (VI)'
+.ti 0
+NAME           bc -- B interpreter
+.sp
+.ti 0
+SYNOPSIS       bc\b\b__ [ -c\b\b__ ] sfile\d1\u.b\b\b__ ... ofile\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    bc\b\b__
+is the UNIX B interpreter.
+It accepts three types of arguments:
+
+Arguments whose names end with ".b" are assumed to be
+B source programs; they are compiled, and
+the object program is left on the file sfile\d1\u.o (i.e.
+the file whose name is that of the source with ".o" substituted
+for ".b").
+
+Other arguments (except for "-c") are assumed
+to be either loader flag arguments, or B-compatible
+object programs, typically produced by an earlier bc\b\b__ run,
+or perhaps libraries of B-compatible routines.
+These programs, together with the results of any
+compilations specified, are loaded (in the order
+given) to produce an executable program with name
+a.out\b\b\b\b\b_____.
+
+The "-c" argument suppresses the loading phase, as does
+any syntax error in any of the routines being compiled.
+.sp
+The language itself is described in [1].
+.sp
+The future of B is uncertain.
+The language has been totally eclipsed by the
+newer, more powerful, more compact, and faster
+language C.
+.sp
+.ti 0
+FILES          file.b                  input file
+.nf
+a.out                  loaded output
+b.tmp1                 temporary (deleted)
+b.tmp2                 temporary (deleted)
+/usr/lang/bdir/b[ca]   translator
+/usr/lang/bdir/brt[12] runtime initialization
+/usr/lib/libb.a                builtin functions, etc.
+/usr/lang/bdir/bilib.a interpreter library
+.fi
+.sp
+.ti 0
+SEE ALSO       [1] K. Thompson; MM-72-1271-1; Users' Reference to B.
+.br
+cc(I)
+.sp
+.ti 0
+DIAGNOSTICS    see [1].
+.sp
+.ti 0
+BUGS           Certain
+external initializations are illegal.
+(In particular: strings and addresses of externals.)
diff --git a/man/man6/bj.6 b/man/man6/bj.6
new file mode 100644 (file)
index 0000000..e10a5b1
--- /dev/null
@@ -0,0 +1,84 @@
+.pa 1
+.he 'BJ (VI)'3/15/72'BJ (VI)'
+.ti 0
+NAME           bj -- the game of black jack
+.sp
+.ti 0
+SYNOPSIS       /usr/games/bj
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+bj\b\b__
+is a serious attempt at
+simulating the dealer
+in the game of black jack (or twenty-one)
+as might be found in Reno.
+The following rules apply:
+.sp
+.in +3
+The bet is $2 every hand.
+.sp
+A player 'natural' (black jack) pays $3.
+A dealer natural loses $2.
+Both dealer and player naturals
+is a 'push' (no money exchange).
+.sp
+If the dealer has an ace up,
+the player is allowed to make an 'insurance'
+bet against the chance of a dealer natural.
+If this bet is not taken, play resumes as normal.
+If the bet is taken, it is a side bet
+where the player wins $2 if the dealer has
+a natural and loses $1 if the dealer does not.
+.sp
+If the player is dealt two cards
+of the same value, he is allowed to
+'double'.
+He is allowed to play two
+hands, each with one of these cards.
+(The bet is doubled also; $2 on each hand.)
+.sp
+If a dealt hand
+has a total of ten or eleven,
+the player may 'double down'.
+He may double the bet ($2 to $4)
+and receive exactly one more card on that hand.
+.sp
+Under normal play,
+the player may 'hit' (draw a card)
+as long as his total is not over twenty-one.
+If the player 'busts' (goes over twenty-one),
+the dealer wins the bet.
+.sp
+When the player 'stands' (decides not to hit),
+the dealer hits until he attains
+a total of seventeen or more.
+If the dealer busts, the player wins the bet.
+.sp
+If both player and dealer stand,
+the one with the largest total wins.
+A tie is a push.
+.sp
+.in -3
+The machine deals and keeps score.
+The following questions will be asked at
+appropriate times.
+Each question is
+answered by y\b_ followed by a new line for 'yes',
+or just new line for 'no'.
+.sp
+?              (means, "do you want a hit?")
+.br
+Insurance?
+.br
+Double down?
+.sp
+Every time the deck is shuffled,
+the dealer so states and the 'action' (total bet)
+and 'standing' (total won or loss)
+is printed.
+To exit, hit the interrupt key (DEL)
+and the action and standing will be printed.
+.in 16
diff --git a/man/man6/ptx.6 b/man/man6/ptx.6
new file mode 100644 (file)
index 0000000..c79ba8b
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'PTX (VI)'3/15/72'PTX (VI)'
+.ti 0
+NAME           ptx --  permuted index
+.sp
+.ti 0
+SYNOPSIS       ptx\b\b\b___ input output
+.sp
+.ti 0
+DESCRIPTION    ptx\b\b\b___
+generates a permuted index from file input\b\b\b\b\b_____ on file output\b\b\b\b\b\b______.
+It has three phases: the first does the permutation, generating
+one line for each keyword in an input line.  The
+keyword is rotated to the front.
+The permuted file is then
+sorted.
+Finally the sorted lines are rotated so the keyword
+comes at the middle of the page.
+
+input\b\b\b\b\b_____ should be edited to remove useless lines.
+The following words are suppressed:  "a", "and", "as",
+"is", "for", "of", "on", "or", "the", "to", "up".
+
+The index for this manual was generated using ptx\b\b\b___.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sort(I)
+.sp
+.ti 0
+DIAGNOSTICS    some
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man6/yacc.6 b/man/man6/yacc.6
new file mode 100644 (file)
index 0000000..2abc64a
--- /dev/null
@@ -0,0 +1,43 @@
+.pa 1
+.he 'YACC (VI)'1/20/73'YACC (VI)'
+.ti 0
+NAME           yacc -- yet another compiler compiler
+.sp
+.ti 0
+SYNOPSIS       _____________\b\b\b\b\b\b\b\b\b\b\b\b\b/crp/scj/yacc  [ <grammar ]
+.sp
+.ti 0
+DESCRIPTION    Yacc converts a context-free grammar into a set of
+tables for a simple automaton which executes an LR(1) parsing
+algorithm.
+The tables are provided in readable form on the standard output
+and in b-compiler format on file actn.b; the program
+/crp/scj/bpar.b will parse strings using the actn.b file.
+.sp
+If your grammar is too big for yacc, you may
+try /crp/scj/bigyacc,
+some of whose size limits are
+larger, and others smaller.
+.sp
+.ti 0
+FILES          actn.b          output tables
+.br
+actn.tmp       temporary storage
+.br
+Note that these files are created in the invoker's
+directory.
+The file actn.tmp is only created by /crp/scj/bigyacc
+(see above).
+.sp
+.ti 0
+SEE ALSO       Yacc manual, by scj (available from ek);
+"LR Parsing", by A. V. Aho and S. C. Johnson, to be published.
+.sp
+.ti 0
+DIAGNOSTICS    There are various diagnostics, but only
+one can be obtained in each run.
+.sp
+.ti 0
+BUGS           The maximum number of terminal and non-terminal symbols
+is 50 each, and this is not checked.  There are
+undoubtedly other bugs too.
diff --git a/man/man7/ascii.7 b/man/man7/ascii.7
new file mode 100644 (file)
index 0000000..ee88395
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he 'ASCII (VII)'6/12/72'ASCII (VII)'
+.ti 0
+NAME           ascii  --  map of ASCII character set
+.sp
+.ti 0
+SYNOPSIS       cat\b\b\b___ /usr/pub/ascii\b\b\b\b\b\b\b\b\b\b\b\b\b\b______________
+.sp
+.ti 0
+DESCRIPTION    ascii\b\b\b\b\b_____
+is a map of the ASCII character set, to be printed as needed.
+It contains:
+.in -16
+.nf
+
+|000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel|
+|010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si |
+|020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb|
+|030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us |
+|040 sp |041  ! |042  " |043  # |044  $ |045  % |046  & |047  ' |
+|050  ( |051  ) |052  * |053  + |054  , |055  - |056  . |057  / |
+|060  0 |061  1 |062  2 |063  3 |064  4 |065  5 |066  6 |067  7 |
+|070  8 |071  9 |072  : |073  ; |074  < |075  = |076  > |077  ? |
+|100  @ |101  A |102  B |103  C |104  D |105  E |106  F |107  G |
+|110  H |111  I |112  J |113  K |114  L |115  M |116  N |117  O |
+|120  P |121  Q |122  R |123  S |124  T |125  U |126  V |127  W |
+|130  X |131  Y |132  Z |133  [ |134  \\ |135  ] |136  ^ |137  _ |
+|140  ` |141  a |142  b |143  c |144  d |145  e |146  f |147  g |
+|150  h |151  i |152  j |153  k |154  l |155  m |156  n |157  o |
+|160  p |161  q |162  r |163  s |164  t |165  u |166  v |167  w |
+|170  x |171  y |172  z |173  { |174  | |175  } |176  ~ |177 del|
+
+.fi
+.in +16
+.sp
+.ti 0
+FILES          found in /usr/pub
diff --git a/man/man7/dpd.7 b/man/man7/dpd.7
new file mode 100644 (file)
index 0000000..41a0f6f
--- /dev/null
@@ -0,0 +1,75 @@
+.pa 1
+.he 'DPD (VII)'3/15/72'DPD (VII)'
+.ti 0
+NAME           dpd -- spawn data phone daemon
+.sp
+.ti 0
+SYNOPSIS       /etc/dpd\b\b\b\b\b\b\b\b________
+.sp
+.ti 0
+DESCRIPTION    dpd\b\b\b___
+is the 201 data phone daemon.
+It is designed to submit jobs to
+the Honeywell 6070 computer via the gerts
+interface.
+.sp
+dpd\b\b\b___ uses the directory /usr/dpd\b\b\b\b\b\b\b\b________.
+The file lock\b\b\b\b____ in that directory is used
+to prevent two daemons from becoming active.
+After the daemon has successfully set the lock,
+it forks and the main path exits, thus
+spawning the daemon.
+/usr/dpd\b\b\b\b\b\b\b\b________ is scanned for any file
+beginning with df\b\b__.
+Each such file is submitted as a job.
+Each line of a job file must begin with a key
+character to specify what to do with the remainder
+of the line
+.sp
+.in +3
+S\b_ directs dpd to generate a unique snumb card.
+This card is generated by incrementing the first
+word of the file /usr/dpd/snumb\b\b\b\b\b\b\b\b\b\b\b\b\b\b______________
+and converting that to decimal concatenated with
+the station ID.
+.sp
+L\b_ specifies that the remainder of the line is to
+be sent as a literal.
+.sp
+B\b_ specifies that the rest of the line
+is a file name. That file is to
+be sent as binary cards.
+.sp
+F\b_ is the same as B\b_ except a form feed is prepended to the file.
+.sp
+U\b_ specifies that the rest of the line
+is a file name.
+After the job has been transmitted,
+the file is unlinked.
+.sp
+.in -3
+Any error encountered will cause the daemon to
+drop the call, wait up to 20 minutes and start over.
+This means that an improperly constructed
+df\b\b__ file may cause the same job to be submitted
+every 20 minutes.
+.sp
+While waiting, the
+daemon checks to
+see that the lock\b\b\b\b____ file still exists.
+If the lock\b\b\b\b____ is gone, the
+daemon will exit.
+.sp
+.ti 0
+FILES          /dev/dn0,
+/dev/dp0,
+/usr/dpd/*
+.sp
+.ti 0
+SEE ALSO       opr(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man7/getty.7 b/man/man7/getty.7
new file mode 100644 (file)
index 0000000..358aad5
--- /dev/null
@@ -0,0 +1,75 @@
+.pa 1
+.he '12/11/72''GETTY (VII)'
+.tr |
+.ti 0
+.nf
+NAME           getty  -- set typewriter mode and get user's name
+.fi
+.sp
+.ti 0
+SYNOPSIS       /etc/getty
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+getty\b\b\b\b\b_____
+is invoked
+by init (VII)
+immediately after a typewriter is opened
+following a dial-in.
+The user's login name is read and the login(I) command
+is called with this name as an argument.
+While reading this name getty\b\b\b\b\b_____
+attempts to adapt the system to the speed and type of terminal
+being used.
+.sp
+getty\b\b\b\b\b_____ initially sets the speed of the interface to 150 baud,
+specifies that raw mode is to be used (break on every character),
+that echo is to be suppressed, and either parity
+allowed.
+It types the "login:" message
+(which includes the characters which put the 37 Teletype
+terminal into full-duplex and unlock its keyboard).
+Then the user's name is read, a character at a time.
+If a null character is received, it is assumed to be the result
+of the user pushing the "break" ("interrupt") key.
+The speed is then
+changed to 300 baud and the "login:" is typed again,
+this time with the appropriate
+sequence which puts a GE TermiNet 300 into full-duplex.
+This sequence is acceptable to other 300 baud terminals also.
+If a subsequent null character is received,
+the speed is changed again.
+The general approach is to cycle through a set of speeds in
+response to null characters caused by breaks.
+The sequence at this installation is 150, 300, and 134.5 baud.
+.sp
+Detection of IBM|2741s is accomplished while the speed is
+set to 150 baud.
+The user sends a 2741 style "eot"
+character by pushing the attention key or by typing return;
+at 150 baud, this character looks like the ascii "~" (174\e98\e8).
+Upon receipt of the "eot", the system is set to operate 2741s
+and a "login: " message is typed.
+
+The user's name is terminated by a new-line or
+carriage-return character.
+The latter results in the system being set to
+to treat carriage returns appropriately (see stty(II)).
+
+The user's name is scanned to see if
+it contains any lower-case alphabetic characters; if not,
+and if the name is nonempty, the
+system is told to map any future upper-case characters
+into the corresponding lower-case characters.
+Thus UNIX is usable from upper-case-only terminals.
+
+Finally, login is called with the user's name as argument.
+.sp
+.in 16
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       init(VII), login(I), stty(II)
diff --git a/man/man7/glob.7 b/man/man7/glob.7
new file mode 100644 (file)
index 0000000..b158355
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'GLOB (VII)'6/15/72'GLOB (VII)'
+.ti 0
+NAME           glob  --  generate command arguments
+.sp
+.ti 0
+SYNOPSIS       /etc/glob
+.sp
+.ti 0
+DESCRIPTION    glob\b\b\b\b____
+is used to expand arguments to the shell containing "*", '[', or
+"?".  It is passed the argument list
+containing the metacharacters; glob\b\b\b\b____
+expands the list and calls the command itself.
+The actions of glob\b\b\b\b____ are detailed in
+the Shell writeup.
+.sp
+.ti 0
+FILES          found in /etc/glob
+.sp
+.ti 0
+SEE ALSO       sh(I)
+.sp
+.ti 0
+DIAGNOSTICS    "No match", "No command", "No directory"
+.sp
+.ti 0
+BUGS           If any of
+'*', '[', or '?' occurs both quoted and unquoted in the
+original command line,
+even the quoted metacharacters are expanded.
+
+glob\b\b\b\b____ gives the "No match" diagnostic only if
+no arguments at all result.
+This is never the case if there is any
+argument without a metacharacter.
diff --git a/man/man7/greek.7 b/man/man7/greek.7
new file mode 100644 (file)
index 0000000..cd40901
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he 'GREEK (VII)'10/31/72'GREEK (VII)'
+.ti 0
+NAME           greek -- graphics for extended ascii type box
+.sp
+.ti 0
+SYNOPSIS       cat\b\b\b___ /usr/pub/greek\b\b\b\b\b\b\b\b\b\b\b\b\b\b______________
+.sp
+.ti 0
+DESCRIPTION    greek\b\b\b\b\b_____
+gives the mapping
+from ascii
+to the "shift out" graphics in effect between SO and SI 
+on model 37 teletypes
+with a 128-character type box.
+It contains:
+
+.nf
+alpha     \ eA\ f  A  |  beta     \ eB\ f  B  |  gamma    \ e\\\ f  \\
+GAMMA     \ eG\ f  G  |  delta    \ eD\ f  D  |  DELTA    \ eW\ f  W
+epsilon   \ eS\ f  S  |  zeta     \ eQ\ f  Q  |  eta      \ eN\ f  N
+theta     \ eT\ f  T  |  THETA    \ eO\ f  O  |  lambda   \ eL\ f  L
+LAMBDA    \ eE\ f  E  |  mu       \ eM\ f  M  |  nu       \ e@\ f  @
+xi        \ eX\ f  X  |  pi       \ eJ\ f  J  |  PI       \ eP\ f  P
+rho       \ eK\ f  K  |  sigma    \ eY\ f  Y  |  SIGMA    \ eR\ f  R
+tau       \ eI\ f  I  |  phi      \ eU\ f  U  |  PHI      \ eF\ f  F
+psi       \ eV\ f  V  |  PSI      \ eH\ f  H  |  omega    \ eC\ f  C
+OMEGA     \ eZ\ f  Z  |  nabla    \ e[\ f  [  |  not      \ e_\ f  _
+partial   \ e]\ f  ]  |  integral \ e^\ f  ^  |
+.fi
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       ascii (VII)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man7/init.7 b/man/man7/init.7
new file mode 100644 (file)
index 0000000..70c6f22
--- /dev/null
@@ -0,0 +1,75 @@
+.pa 1
+.he 'INIT (VII)'6/15/72'INIT (VII)'
+.ti 0
+NAME           init  --  process control initialization
+.sp
+.ti 0
+SYNOPSIS       /etc/init
+.sp
+.ti 0
+DESCRIPTION
+.in 8
+init\b\b\b\b____
+is invoked inside UNIX as the last step in the boot procedure.
+Generally its role is to create a process for each
+typewriter on which a user may log in.
+
+First, init\b\b\b\b____ checks
+to see if the console switches contain 173030.
+(This number is likely to vary between
+systems.)
+If so, the console typewriter tty\b\b\b___ is opened for reading
+and writing and the shell is invoked immediately.
+This feature is used to bring up a test system, or one
+which does not contain DC-11 communications interfaces.
+When the system is brought up in this way, the getty\b\b\b\b\b_____
+and login\b\b\b\b\b_____ routines mentioned below and described elsewhere are not needed.
+
+Otherwise, init\b\b\b\b____ does some housekeeping: the mode of
+each DECtape file is changed to 17 (in case the system
+crashed during a tap\b\b\b___ command);
+directory /usr is mounted
+on the RK0 disk;
+directory /sys is mounted on the RK1 disk.
+Also a data-phone daemon
+is spawned to restart any jobs being sent.
+
+Then init\b\b\b\b____ forks several times to create a process
+for each typewriter mentioned in an internal table.
+Each of these processes opens the appropriate typewriter
+for reading and writing.  These channels thus
+receive file descriptors 0 and 1, the standard input and
+output.
+Opening the typewriter will usually involve a delay,
+since the open\b\b\b\b____ is not completed until someone
+is dialled in (and carrier established) on the channel.
+Then the process executes the program /etc\b\b\b___/getty\b\b\b\b\b_____
+(q.v.).
+getty\b\b\b\b\b_____ will read the user's name and invoke login\b\b\b\b\b_____ (q.v.)
+to log in the user and execute the shell.
+
+Ultimately the shell will terminate
+because of an end-of-file either
+typed explicitly or generated as a result of hanging up.
+The main path of init\b\b\b\b____, which has been waiting
+for such an event,
+wakes up and removes the appropriate entry from the
+file utmp\b\b\b\b____, which records current users, and
+makes an entry in wtmp\b\b\b\b____, which maintains a history
+of logins and logouts.
+Then the appropriate typewriter is reopened and getty\b\b\b\b\b_____
+reinvoked.
+.sp
+.in 16
+.ti 0
+FILES          /dev/tap?,
+/dev/tty, /dev/tty?, /tmp/utmp, /tmp/wtmp
+.sp
+.ti 0
+SEE ALSO       login(I), login(VII), getty(VII), sh(I), dpd(VII)
+.sp
+.ti 0
+DIAGNOSTICS    none possible
+.sp
+.ti 0
+BUGS           none possible
diff --git a/man/man7/msh.7 b/man/man7/msh.7
new file mode 100644 (file)
index 0000000..bbf3910
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'MSH (VII)'6/15/72'MSH (VII)'
+.ti 0
+NAME           msh  --  mini-shell
+.sp
+.ti 0
+SYNOPSIS       /etc/msh
+.sp
+.ti 0
+DESCRIPTION    msh\b\b\b___
+is a heavily simplified version of the Shell.
+It reads one line from the standard
+input file, interprets it as a command, and calls the command.
+
+The mini-shell supports few of the advanced features
+of the Shell; none of the following characters is special:
+
+   > < $ \\ ; &
+
+However, "*", "[", and "?" are recognized and glob\b\b\b\b____ is called.
+The main use of msh\b\b\b___ is to provide a command-executing
+facility for various interactive sub-systems.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sh(I), glob(VII)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man7/tabs.7 b/man/man7/tabs.7
new file mode 100644 (file)
index 0000000..df39857
--- /dev/null
@@ -0,0 +1,30 @@
+.pa 1
+.he 'TABS (VII)'6/15/72'TABS (VII)'
+.ti 0
+NAME           tabs  --  set tab stops
+.sp
+.ti 0
+SYNOPSIS       cat /usr/pub/tabs
+.sp
+.ti 0
+DESCRIPTION    When
+printed on a suitable terminal, this file
+will set tab stops every 8 columns.
+Suitable terminals include the Teletype model 37 and
+the GE TermiNet 300.
+.sp
+These tab stop settings are
+desirable because UNIX assumes them
+in calculating delays.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man7/vsp.7 b/man/man7/vsp.7
new file mode 100644 (file)
index 0000000..57315f4
--- /dev/null
@@ -0,0 +1,61 @@
+.pa 1
+.he 'VSP (VII)'2/2/73'VSP (VII)'
+.ti 0
+NAME           vsp -- voice synthesizer code
+.sp
+.ti 0
+SYNOPSIS       cat /usr/pub/vsp
+.sp
+.ti 0
+DESCRIPTION    vsp\b\b\b___
+contains a list of phonemes understood by the voice
+synthesizer on device vt\b\b__.
+Phonemes are usually written in the form
+
+.ce
+comma inflection phoneme
+.sp
+The inflection and the phoneme codes are or-ed together.
+The phoneme codes are as follows (numbers in octal).
+
+.nf
+.in 6
+0  = 300  strong inflection    p  = 32   p\b_enny p\b_ound
+1  = 200                       a0 = 33   co\b_ntact ca\b_r
+2  = 100                       a1 = 52   co\b_nnect
+3  = 000  weak inflection      ai = 37   na\b_me ca\b_me
+                               aj = 71   na\b_mely
+aw = 02   aw\b\b__ful law\b\b__            s  = 40   s\b_even s\b_ix
+ie = 03   zer\b\b__o                     d  = 41   d\b_o d\b_iet
+e0 = 04   e\b_nter me\b_t                f  = 42   f\b_our f\b_ive
+e1 = 76   se\b_ven                      g  = 43   g\b_et g\b_rand
+e2 = 77   seve\b_n                      h  = 44   h\b_ello h\b_ow
+er = 05   weather\b\b__          j  = 45   j\b_udge edg\b_e
+th = 06   th\b\b__ree th\b\b__ick          k  = 46   c\b_ame lock\b_
+dh = 07   th\b\b__is th\b\b__en            l  = 47   hell\b\b__o l\b_ight
+yu = 27   u\b_se you\b_          oo = 50   loo\b\b__k boo\b\b__k
+iu = 10   u\b_nite                      ou = 51   goo\b\b__d shou\b\b__d
+ju = 11   ne\b_w yo\b_u          ng = 53   ring\b\b__ ang\b\b__le
+o0 = 31   o\b_nly no\b_          z  = 55   z\b_ero haz\b_y
+o1 = 12   hello\b_                      sh = 56   sh\b\b__ow sh\b\b__ip
+o2 = 13   no\b_tice             ch = 57   ch\b\b__air ch\b\b__ime
+u0 = 14   bu\b_t mu\b_st         v  = 60   sev\b_en ev\b_en
+u1 = 15   u\b_ncle                      b  = 61   b\b_all b\b_ed
+u2 = 16   stirru\b_p            n  = 62   n\b_in\b_e seven\b_
+u3 = 34   app_le ab_le         m  = 63   m\b_ile m\b_en
+ae = 21   ca\b_t sa\b_t          iy = 66   lie\b\b__
+ea = 20   a\b_ntenna            zh = 70   az\b_ure pleas\b_ure
+w  = 22   w\b_on w\b_ish         ih = 72   statio\b\b__n conditio\b\b__n
+ee = 23   three\b\b__                    ay = 36   may\b_ lay\b_
+r  = 24   r\b_adio r\b_adar\b_
+t  = 25   t\b_wo t\b_ime         -0 = 35   long space
+ey = 26   sixty\b_ eighty\b_             -1 = 17
+i0 = 30   si\b_x mi\b_x          -2 = 01
+i1 = 64   i\b_nept i\b_nside             -3 = 74   short delay
+i2 = 65   crypti\b_c stati\b_c
+.in 16
+.fi
+
+.sp
+.ti 0
+SEE ALSO       speak(I), vt(IV)
diff --git a/man/man8/20boot.8 b/man/man8/20boot.8
new file mode 100644 (file)
index 0000000..893cb16
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he '20BOOT (VIII)'1/25/73'20BOOT (VIII)'
+.ti 0
+NAME           20boot -- install new 11/20 system
+.sp
+.ti 0
+SYNOPSIS       20boot\b\b\b\b\b\b______ [ x\b_ ]
+.sp
+.ti 0
+DESCRIPTION    This
+shell command file copies the current version
+of the 11/20 program used to run the VT01 display
+onto the /dev/vt0 file.
+
+If no argument is given, the 11/20 program should be executing
+but idle; the 11/20 program is sent preceded by a
+"reboot" command.
+If an argument is given, the 11/20 should
+have been restarted at its ROM location
+777300.
+.sp
+.ti 0
+FILES          /dev/vt0;
+.br
+/sys/mdec/20.o (11/20 program)
+.sp
+.ti 0
+SEE ALSO       vt0 (IV)
+.sp
+.ti 0
+DIAGNOSTICS    --
diff --git a/man/man8/acct.8 b/man/man8/acct.8
new file mode 100644 (file)
index 0000000..fe5bebb
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he 'ACCT (VIII)'1/20/73'ACCT (VIII)'
+.ti 0
+NAME           acct -- login accounting
+.sp
+.ti 0
+SYNOPSIS       acct\b\b\b\b____ [ -w\b\b__ wtmp ] [ -p\b\b__ ] [ -d\b\b__ ] people
+.sp
+.ti 0
+DESCRIPTION    acct\b\b\b\b____
+produces a printout giving
+connect time
+for each user who has logged in
+during the life of the current wtmp\b\b\b\b____ file.
+A total is also produced.
+-w\b\b__ is used to specify an alternate wtmp file.
+-p\b\b__ prints individual totals; without this option,
+only totals are printed.
+-d\b\b__ causes a printout for each midnight to midnight
+period.
+The people\b\b\b\b\b\b______ argument will limit the
+printout to only the specified login names.
+If no wtmp file is given,
+/usr/adm/wtmp\b\b\b\b\b\b\b\b\b\b\b\b\b_____________
+is used.
+.sp
+.ti 0
+FILES          /usr/adm/wtmp
+.sp
+.ti 0
+SEE ALSO       init(VII), login(I), wtmp(V).
+.sp
+.ti 0
+DIAGNOSTICS    "Cannot open 'wtmp'" if argument is unreadable.
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man8/bproc.8 b/man/man8/bproc.8
new file mode 100644 (file)
index 0000000..fd4f5a7
--- /dev/null
@@ -0,0 +1,235 @@
+.pa 1
+.he 'BOOT PROCEDURES (VIII)'2/6/73'BOOT PROCEDURES (VIII)'
+.ti 0
+NAME           bos, maki, vcboot, msys, et\b\b__ al\b\b__.
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+On
+the RF disk, the highest 16K words are
+reserved for stand-alone programs.
+These 16K words are allocated as follows:
+.sp
+bos            (1K)
+.br
+Warm UNIX      (7K)
+.br
+Cold UNIX      (8K)
+.sp
+The program bos\b\b\b___ (Bootstrap Operating System)
+examines the console switches and executes
+one of several internal programs depending on the setting.
+The following settings are currently recognized:
+.sp
+.in +8
+.ti -8
+???    Will read Warm UNIX from
+the RF into core location 0 and transfer to 600.
+.sp
+.ti -8
+1      Will read Cold UNIX from the
+RF into core location 0 and transfer to 600.
+.sp
+.ti -8
+10     Will dump all of memory
+from core location 0 onto DECtape drive 7
+and then halt.
+.sp
+.ti -8
+20     Will read 256 words from RK0 into
+core 0 and transfer to zero.
+This is the procedure to boot
+DOS from an RK.
+.sp
+.ti -8
+40     This is the same as 10 above, but
+instead of halting, UNIX warm is loaded.
+.sp
+.ti -8
+0      Will load a standard UNIX binary paper tape
+into core location 0 and transfer to 0.
+.sp
+.ti -8
+77500  Will load the standard DEC absolute and binary
+loaders and transfer to 77500.
+.sp
+.in 8
+All manual methods of booting the system involve
+manipulation of the console switches.
+In order for this to be possible,
+the panel must be unlocked
+and the machine must be halted.
+Also, remember that at the time UNIX comes up,
+the console switches must contain 773030
+for a single-user system; anything else gives
+a multi-user system.
+
+There are four temperatures of boots.
+They are:
+
+.in +4
+Hot boot: restart the system without refreshing
+its code, that is simply by transferring to
+its start.
+The only use for this procedure is if the
+system has been patched and one doesn't wish
+to redo the patches.
+The procedure is:
+
+       600 in switches
+       Load address
+       (773030 in switches for single-user system)
+       start
+
+Warm boot: refresh system code from the RF disk, but
+the "panic" routine must be in core.
+Best for general use if it works, since
+outstanding I/O
+is cleaned up.
+Procedure:
+
+       602 in switches
+       load address
+       (773030 in switches for single-user system)
+       start  (flushes any I/O, then executes bos\b\b\b___)
+
+Cool boot: RF disk is OK, but nothing in core.
+Procedure:
+
+       UTIL DECtape on drive 0
+       773030 in switches
+       load address
+       (602 in switches for multi-user system)
+       start
+       type "boot" on console tty to load bos\b\b\b___
+
+Cold boot: nothing in core, nothing on RF.
+Best to have an expert around for this
+one.
+Procedure:
+
+       INIT DECtape on drive 0
+       773030 in switches
+       load address
+       1 in switches
+       start
+       (machine halts. last chance to preserve RF!)
+       773030 in switches
+       continue
+       (reads in basic files)
+
+UNIX is then up, but for various reasons, one should
+do a warm boot (single user) right away.
+At this point also, one might
+consider whether the INIT tape UNIX is the
+latest version.
+If there is reason for doubt,
+mount the /sys disk pack, change to directory
+/sys/sys, do "msys u unix", and reboot.
+Then get the /bin-/etc-/lib tape which contains
+the rest of of the RF disk,
+and do an "mt x".
+Conceivably, "create errors" due to lack of some
+directories will occur; make the directories,
+then try again.
+Set the date correctly; the system starts off
+at time 0.
+
+At this point UNIX is in full operation and
+can be rebooted for
+a multi-user system.
+.sp
+.in 8
+Here is what happens during a cold boot:
+the INIT tape contains a program called
+.ul
+vcboot.
+The ROM program reads vcboot
+from the tape into
+core location 0 and transfers to it.
+vcboot then reads 16K words from
+the DECtape (blocks 1-32)
+and copies the data to the highest 16K words of
+the RF.
+Thus this initializes the read-only part of the RF.
+vcboot then reads in bos\b\b\b___ and executes it.
+bos\b\b\b___ reads in Cold UNIX and executes that.
+Cold UNIX halts for a last chance before
+it completely initializes the RF file system.
+When continue is pressed,
+Cold UNIX initializes the RF.
+It then reads the DECtape for initialization files
+starting from block 33.
+Normal operation then commences
+with the execution of "/etc/init".
+.sp
+The INIT tape is made by the program maki\b\b\b\b____
+running under UNIX.
+maki\b\b\b\b____ writes vcboot\b\b\b\b\b\b______ on block 0 of
+.ul
+/dev/tap7.
+It then copies the RF 16K words (using
+.ul
+/dev/rf0)
+onto blocks 1 thru 32.
+It has internally a list of files to
+be copied from block 33 on.
+This list follows:
+.sp
+.nf
+.in +8
+/etc/init
+/bin/chmod
+/bin/date
+/bin/login
+/bin/ls
+/bin/mkdir
+/etc/mount
+/bin/sh
+/bin/tap
+/bin/mt
+.in -8
+.fi
+.sp
+Thus this is the set of programs available after a cold boot.
+init\b\b\b\b____ and sh\b\b__ are mandatory.
+For multi-user UNIX,
+getty\b\b\b\b\b_____ and login\b\b\b\b\b_____ are also necessary.
+mkdir\b\b\b\b\b_____ is necessary due to a bug in tap\b\b\b___.
+mt\b\b__, tap\b\b\b___ and mount\b\b\b\b\b_____ are useful to
+bring in new files.
+As soon as possible, date\b\b\b\b____ should be done.
+That leaves ls\b\b__ and chmod\b\b\b\b\b_____ as frosting.
+.sp
+The last link in this incestuous
+daisy chain is the program msys\b\b\b\b____.
+.sp
+   msys\b\b\b\b____ char file
+.sp
+will copy the file file\b\b\b\b____ onto the
+RF read only slot specified by the character char\b\b\b\b____.
+Char is taken from the following set:
+.sp
+   b\b_ bos
+   u\b_ Warm UNIX
+   1\b_ Cold UNIX
+.sp
+.in 16
+.ti 0
+FILES          /dev/rf0,
+/dev/tap?
+.sp
+.ti 0
+SEE ALSO       init(VII),
+tap(I),
+sh(I),
+mkdir(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           This
+section is very configuration dependent.
diff --git a/man/man8/check.8 b/man/man8/check.8
new file mode 100644 (file)
index 0000000..9f6e030
--- /dev/null
@@ -0,0 +1,50 @@
+.pa 1
+.he 'CHECK (VIII)'1/20/73'CHECK (VIII)'
+.ti 0
+NAME           check -- file system consistency check
+.sp
+.ti 0
+SYNOPSIS       check\b\b\b\b\b_____ [ filesystem [ blockno\e91\e8 ... ] ]
+.sp
+.ti 0
+DESCRIPTION    check\b\b\b\b\b_____
+will examine a file system,
+build a bit map of used blocks,
+and compare this bit map against
+the bit map maintained on the file system.
+If the file system is not specified,
+a check of all
+of the normally mounted file systems
+is performed.
+Output includes the number of files on the file system,
+the number of these that are 'large', the number
+of indirect blocks,
+the number
+of used blocks, and the number of free blocks.
+.sp
+check\b\b\b\b\b_____ works by examining the i-nodes
+on the file system and is entirely
+independent of its directory hierarchy.
+The file system may be,
+but need not be, mounted.
+
+.ti 0
+FILES          /dev/rf?,
+/dev/rk?,
+/dev/rp?
+.sp
+.ti 0
+SEE ALSO       find(I), ds(I)
+.sp
+.ti 0
+DIAGNOSTICS    Diagnostics are produced for
+blocks missing, duplicated, and bad block addresses.
+Diagnostics are also produced for block numbers passed as parameters.
+In each case, the block number, i-number, and
+block class (i\b_ = inode, x\b_ indirect, f\b_ free) is printed.
+.sp
+.ti 0
+BUGS           The
+checking process is two pass in nature.
+If checking is done on an active file system,
+extraneous diagnostics may occur.
diff --git a/man/man8/chk.8 b/man/man8/chk.8
new file mode 100644 (file)
index 0000000..54114b6
--- /dev/null
@@ -0,0 +1,21 @@
+.pa 1
+.he 'CHK (VIII)'1/20/73'CHK (VIII)'
+.ti 0
+NAME           chk -- check + dcheck
+.sp
+.ti 0
+SYNOPSIS       chk
+.sp
+.ti 0
+DESCRIPTION    This
+command file does a check\b\b\b\b\b_____ and a dcheck\b\b\b\b\b\b______ of all of the normally mounted
+file systems.
+.sp
+.ti 0
+FILES          /dev/[fkp]*
+.sp
+.ti 0
+SEE ALSO       check (VIII), dcheck (VIII)
+.sp
+.ti 0
+DIAGNOSTICS    see "SEE ALSO"
diff --git a/man/man8/clri.8 b/man/man8/clri.8
new file mode 100644 (file)
index 0000000..68ec27a
--- /dev/null
@@ -0,0 +1,41 @@
+.pa 1
+.he 'CLRI (VIII)'1/20/73'CLRI (VIII)'
+.ti 0
+NAME           clri -- clear i-node
+.sp
+.ti 0
+SYNOPSIS       clri i-number [ file system ]
+.sp
+.ti 0
+DESCRIPTION    clri\b\b\b\b____
+writes zeros on the 32 bytes occupied by the i-node
+numbered
+.ul
+i-number.
+If the
+.ul
+file system
+argument is given, the i-node resides on
+the given device, otherwise on a
+default file system.
+The file system argument
+must be a special file
+name referring to a device
+containing a file system.
+
+After clri\b\b\b\b____, any blocks
+in the affected file
+will show up as "missing" in a check\b\b\b\b\b_____ of
+the file system.
+
+Read and write permission is required on the specified
+file system device.
+The i-node becomes allocatable.
+
+The primary purpose of this routine
+is to remove a file which
+for some reason appears in no
+directory.
+.sp
+.ti 0
+DIAGNOSTICS    "error"
diff --git a/man/man8/dcheck.8 b/man/man8/dcheck.8
new file mode 100644 (file)
index 0000000..9f9d8ee
--- /dev/null
@@ -0,0 +1,44 @@
+.pa 1
+.he 'DCHECK (VIII)'1/20/73'DCHECK (VIII)'
+.ti 0
+NAME           dcheck -- directory consistency check
+.sp
+.ti 0
+SYNOPSIS       dcheck\b\b\b\b\b\b______ [ -l\b\b__ ] [ device ]
+.sp
+.ti 0
+DESCRIPTION    dcheck\b\b\b\b\b\b______
+builds an image of the directory hierarchy
+of the specified device
+by reading all its directories (using physical I/O
+guided by the i-nodes on the device).
+A list entry is made for
+each file encountered.
+A second pass reads the i-nodes and for
+each file compares the number of links
+specified in its i-node
+with the number of entries actually seen.
+All discrepancies are noted.
+.sp
+If no device is specified,
+a default device is assumed.
+.sp
+The argument -l\b\b__ causes a complete
+listing of the file names on the device
+in i-node order.
+.sp
+.ti 0
+FILES          /dev/rk?
+.sp
+.ti 0
+SEE ALSO       check(VIII)
+.sp
+.ti 0
+DIAGNOSTICS    inconsistent i-numbers,
+unnamed files,
+unreachable files,
+loops in directory "hierarchy".
+.sp
+.ti 0
+BUGS           Unreachable files and loops are
+discovered only under the "-l" option.
diff --git a/man/man8/dli.8 b/man/man8/dli.8
new file mode 100644 (file)
index 0000000..b63e9af
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he 'DLI (VIII)'3/15/72'DLI (VIII)'
+.ti 0
+NAME           dli -- load DEC binary paper tapes
+.sp
+.ti 0
+SYNOPSIS       dli output [input]
+.sp
+.ti 0
+DESCRIPTION    dli\b\b\b___
+will load a DEC binary paper tape
+into the output file.
+The binary format paper tape
+is read from the input file
+(/dev/ppt is default.)
+.sp
+.ti 0
+FILES          /dev/ppt
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    "checksum"
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man8/istat.8 b/man/man8/istat.8
new file mode 100644 (file)
index 0000000..d44f313
--- /dev/null
@@ -0,0 +1,35 @@
+.pa 1
+.he 'ISTAT (VIII)'1/20/73'ISTAT (VIII)'
+.ti 0
+NAME           istat  --  get inode status
+.sp
+.ti 0
+SYNOPSIS       istat\b\b\b\b\b_____ [ filesystem ] inumber\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    istat\b\b\b\b\b_____
+gives information about one or more i-nodes
+on the given file system or on /dev/rk0 if no file system
+is given.
+.sp
+The information is in exactly the same form
+as that for stat(I),
+except that mode letter "a" is
+used to indicate that the i-node is allocated,
+"u" that it is unallocated.
+.sp
+.ti 0
+FILES          /etc/uids,
+/dev/rk0
+.sp
+.ti 0
+SEE ALSO       stat(I), ls(I) (-l option)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           istat\b\b\b\b\b_____
+ignores any read error
+and pretends to give status even if the file system
+is not physically present.
diff --git a/man/man8/kill.8 b/man/man8/kill.8
new file mode 100644 (file)
index 0000000..0c6db3f
--- /dev/null
@@ -0,0 +1,36 @@
+.pa 1
+.he 'KILL (VIII)'1/20/73'KILL (VIII)'
+.ti 0
+NAME           kill -- terminate process with extreme prejudice
+.sp
+.ti 0
+SYNOPSIS       /usr/adm/kill\b\b\b\b\b\b\b\b\b\b\b\b\b_____________ processnumber
+.sp
+.ti 0
+DESCRIPTION    After ps\b\b__
+(q.v.) has given you the unique ID of a process, you can terminate
+it by this command.
+A core image is produced in the process's working directory.
+
+Only the super-user can exercise this privilege.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       ps (VIII)
+.sp
+.ti 0
+DIAGNOSTICS    yes
+.sp
+.ti 0
+BUGS           If the process
+has executed sys nice (II)
+and there is another process which has not, but
+which loops,
+the first process cannot be done in properly,
+since it has to be swapped in so as cooperate
+in its own murder.
+
+It would also be nice if ordinary people could
+kill their own processes.
diff --git a/man/man8/mount.8 b/man/man8/mount.8
new file mode 100644 (file)
index 0000000..278fe3a
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'MOUNT (VIII)'1/20/73'MOUNT (VIII)'
+.ti 0
+NAME           mount  --  mount file system
+.sp
+.ti 0
+SYNOPSIS       /etc/mount\b\b\b\b\b\b\b\b\b\b__________ special file
+.sp
+.ti 0
+DESCRIPTION    mount\b\b\b\b\b_____
+announces to the system that a removable file system
+is present on the device corresponding to special
+file special\b\b\b\b\b\b\b_______ (which must refer to a disk or possibly DECtape).
+The file\b\b\b\b____ must exist already; it
+becomes the name of the root of the newly mounted
+file system.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       umount(VIII)
+.sp
+.ti 0
+DIAGNOSTICS    "?",
+if the special file is already in use, cannot be read,
+or if file\b\b\b\b____ does not exist.
+.sp
+.ti 0
+BUGS           Should be usable only by the super-user.
+Mounting file systems full of garbage can crash the system.
diff --git a/man/man8/ps.8 b/man/man8/ps.8
new file mode 100644 (file)
index 0000000..fcab9ac
--- /dev/null
@@ -0,0 +1,77 @@
+.pa 1
+.he 'PS (VIII)'1/20/73'PS (VIII)'
+.ti 0
+NAME           ps -- process status
+.sp
+.ti 0
+SYNOPSIS       /usr/adm/ps [ -xlt\b\b\b\b____ ]
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+ps\b\b__
+prints certain facts about active
+processes.
+The information is columnar and consists of:
+
+.in +3
+The (numerical) ID of the user associated
+with the process;
+
+The last character of the control typewriter of the process
+or "x" if there is no control typewriter;
+"x" lines are suppressed unless the "x" option
+is given.
+
+The number of 512-byte disk blocks holding the core
+image of the process;
+
+The process's unique ID (only with "l" option)
+
+The number of hours (mod 100) and minutes of system, disk, and
+user-process time accumulated by the process and
+all its terminated descendants (only with "t" option)
+
+An educated guess as to the command line which caused the
+process to be created.
+
+.in -3
+Some caveats:
+
+The guess as to the command name and arguments is obtained by examining
+the process's stack.
+The process is entitled to destroy this information.
+Also, only processes whose core images are on disk have
+visible names.
+The ps\b\b__ command in particular
+does not, nor does any other process which happens to
+be in core at the same time.
+ps\b\b__ tries to overcome this limitation by spawning
+a subprocess designed to take up the other core
+slot, and is usually successful.
+Because ps\b\b__ examines a dynamically changing data structure,
+it can produce incorrect results, for example if
+a process's core image moves between the time
+ps\b\b__ gets its disk address and reads its stack.
+
+Besides its utility for simple spying,
+ps\b\b__ is the only plausible
+way to find the process number of someone you are trying
+to kill (VIII).
+.sp
+.in 16
+.ti 0
+FILES          /dev/rf0,
+/sys/sys/unix (to get magic numbers).
+.sp
+.ti 0
+SEE ALSO       kill (VIII)
+.sp
+.ti 0
+DIAGNOSTICS    "Bad RF", if
+a bad swap address turns up;
+various missing-file diagnostics.
+.sp
+.ti 0
+BUGS           As described.
diff --git a/man/man8/salv.8 b/man/man8/salv.8
new file mode 100644 (file)
index 0000000..cf9d808
--- /dev/null
@@ -0,0 +1,86 @@
+.pa 1
+.he 'SALV (VIII)'1/20/73'SALV (VIII)'
+.ti 0
+NAME           salv -- file system salvage
+.sp
+.ti 0
+SYNOPSIS       /etc/salv\b\b\b\b\b\b\b\b\b_________ filesystem [ -akfs\b\b\b\b\b_____ ]
+.sp
+.ti 0
+DESCRIPTION
+.br
+.in 8
+salv\b\b\b\b____
+will place a given file system
+in a consistent state with
+almost no loss of information.
+This is the first step in putting things
+together after a bad crash.
+Salv performs the following functions:
+.sp
+.in +3
+A valid free list is constructed.
+
+.in -3
+The previous step is always performed; the following steps
+are performed only if the "a" option is given.
+If the file system's only defect is missing blocks,
+"a" should not be specified.
+.in +3
+.sp
+All bad pointers in the file system are zeroed.
+.sp
+All duplicate pointers to the same block
+are resolved by changing one of the pointers
+to point at a new block containing a copy of the data.
+.sp
+Inodes (not directory entries) for special files
+are generated (mode 16).
+
+Files whose size is too large for the number of
+blocks they contain (after bad pointers are zeroed)
+have their size revised downward.
+
+.in -3
+The file system should be unmounted while it is
+being salvaged.
+In cases of extreme need the permanently mounted
+file system may be salvaged; in such a case
+the system must be rebooted before it
+has a chance to write out the old, bad super-block.
+
+The "k", "f", and "s" options
+tell salv what magic numbers to use to generate
+the size of the free list and the i-node map.
+"k" is default (RK disk); "f" is RF; "s" is RK with
+swap space on it.
+If salv is to be used away
+from the mother system its code should be cheked
+to verify the numbers.
+.sp
+After a salv, files may be safely created
+and removed without causing
+more trouble.
+If the "a" option had to be used,
+a dcheck (VIII) should be done to find the degree
+of the damage to the hierarchy.
+.sp
+.in 16
+.ti 0
+FILES          /dev/rk0
+.sp
+.ti 0
+SEE ALSO       check(I), ds(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           In
+only one (known) way does salv\b\b\b\b____ destroy information:
+if some random block appears to be an indirect block
+for a file,
+all "bad pointers" (for example, ASCII text) in it
+will be zeroed.  If
+the block also appears in another file, it may be
+scribbled on before it is copied.
diff --git a/man/man8/su.8 b/man/man8/su.8
new file mode 100644 (file)
index 0000000..99721bb
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he 'SU (VIII)'1/20/73'SU (VIII)'
+.ti 0
+NAME           su  --  become privileged user
+.sp
+.ti 0
+SYNOPSIS       su\b\b__
+.sp
+.ti 0
+DESCRIPTION    su
+allows one to become the super-user, who has
+all sorts of marvelous (and correspondingly dangerous) powers.
+In order for su to do its magic, the user must
+supply a password.
+If the password is correct, su
+will execute the shell with the UID set to
+that of the super-user.
+To restore normal UID privileges,
+type an end-of-file to the super-user shell.
+
+To remind the super-user of his responsibilities,
+the shell substitutes "#" for its usual prompt "%".
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       sh(I)
+.sp
+.ti 0
+DIAGNOSTICS    "Sorry" if password is wrong
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man8/swtmp.8 b/man/man8/swtmp.8
new file mode 100644 (file)
index 0000000..e19ed31
--- /dev/null
@@ -0,0 +1,24 @@
+.pa 1
+.he 'SWTMP (VIII)'2/11/73'SWTMP (VIII)'
+.ti 0
+NAME           swtmp -- update accounting file
+.sp
+.ti 0
+SYNOPSIS       swtmp\b\b\b\b\b_____
+.sp
+.ti 0
+DESCRIPTION    This
+shell sequence concatenates /tmp/wtmp onto /usr/adm/wtmp
+and truncates /tmp/wtmp.
+It should be used before
+using acct(VIII)
+and every so often in any case if accounting
+is to be maintained.
+.sp
+.ti 0
+FILES          /tmp/wtmp,
+/usr/adm/wtmp
+.sp
+.ti 0
+SEE ALSO       acct(VIII),
+wtmp(V)
diff --git a/man/man8/tm.8 b/man/man8/tm.8
new file mode 100644 (file)
index 0000000..4240c17
--- /dev/null
@@ -0,0 +1,48 @@
+.pa 1
+.he 'TM (VIII)'3/15/72'TM (VIII)'
+.ti 0
+NAME           tm  --  provide time information
+.sp
+.ti 0
+SYNOPSIS       tm\b\b__
+.sp
+.ti 0
+DESCRIPTION    tm\b\b__
+is used to provide timing information.
+Output like the following
+is given:
+.sp
+.in +5
+   tim 371:51:09     2:00.8
+   ovh  20:00:33       17.0
+   swp  13:43:20        4.6
+   dsk  27:14:35        4.5
+   idl 533:08:03     1:33.3
+   usr  24:53:50        1.2
+   der    0,  54     0,   0
+.sp
+.in -5
+The first column of numbers gives totals in the named categories
+since the last time the system was cold-booted;  the second
+column gives the changes since the last time tm\b\b__ was invoked.
+The top left number is badly truncated and should be ignored.
+ovh\b\b\b___ is time spent
+executing in the system;
+swp\b\b\b___ is time waiting for swap I/O;
+dsk\b\b\b___ is time spent waiting for
+file system disk I/O; idl\b\b\b___ is idle time; usr\b\b\b___ is user execution
+time; der\b\b\b___ is RF disk error count (left number) and RK disk error
+count (right number).
+
+.ti 0
+FILES          /dev/rf0 (for absolute times);
+/tmp/ttmp for differential timing history.
+.sp
+.ti 0
+SEE ALSO       time(I), file system(V)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
diff --git a/man/man8/umount.8 b/man/man8/umount.8
new file mode 100644 (file)
index 0000000..a69a5b8
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he 'UMOUNT (VIII)'1/20/73'UMOUNT (VIII)'
+.ti 0
+NAME           umount  --  dismount file system
+.sp
+.ti 0
+SYNOPSIS       /etc/umount\b\b\b\b\b\b\b\b\b\b\b___________ special
+.sp
+.ti 0
+DESCRIPTION    umount\b\b\b\b\b\b______
+announces to the system that the removable file system previously
+mounted on special file special\b\b\b\b\b\b\b_______ is to be removed.
+
+The user must take care not
+only that all I/O activity on the file system has ceased,
+but that no one has his current directory on it.
+
+Only the super-user may issue this command.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       mount(VIII)
+.sp
+.ti 0
+DIAGNOSTICS    "?"
+.sp
+.ti 0
+BUGS           This
+command is not, in fact, restricted to the super-user.
diff --git a/man/manx/as.1 b/man/manx/as.1
new file mode 100644 (file)
index 0000000..6d85e25
--- /dev/null
@@ -0,0 +1,331 @@
+.pa 1
+.he '1/15/73''AS (I)'
+.ti 0
+NAME           as -- assembler
+.sp
+.ti 0
+SYNOPSIS       as\b\b__ [ -\b_ ] name\e91\e8 ...
+.sp
+.ti 0
+DESCRIPTION    as\b\b__
+assembles the concatenation of name\d1\u, ....  as\b\b__
+is based on the DEC-provided assembler PAL-11R [1], although
+it was coded locally.
+Therefore, only the differences will be recorded.
+.sp
+If the optional first argument
+-\b_ is used,
+all undefined symbols in the assembly
+are treated as global.
+.sp
+Character changes are:
+.sp
+     for    use
+      @      *
+      #      $
+      ;      /
+.sp
+In as\b\b__, the character ";" is a logical new line; several operations
+may appear on one line if separated by ";".
+Several new expression operators have been provided:
+.sp
+     \\>     right shift (logical)
+     \\<     left shift
+     *      multiplication
+     \\/     division
+.nf
+     %      remainder (no longer means "register")
+     |      inclusive or
+.fi
+     !      one's complement
+     []     parentheses for grouping
+.nf
+     ^      result has value of left, type of right
+.sp
+.fi
+For example location 0 (relocatable) can be written "0^.";
+another way to denote register 2 is "2^r0".
+
+All of the preceding operators are binary; if
+a left operand is missing, it is taken
+to be 0.
+The "!" operator adds its left operand to the one's
+complement of its right operand.
+
+All operators evaluate left-to-right except for
+the effect of brackets; all operators have the
+same priority.
+
+There is a conditional assembly operation code different
+from that of PAL-11R (whose conditionals are not provided):
+.sp
+     .if expression
+     ...
+     .endif
+.sp
+If the expression\b\b\b\b\b\b\b\b\b\b__________ evaluates to non-zero, the section of
+code between the ".if" and the ".endif" is assembled; otherwise
+it is ignored.  ".if"s may be nested.
+.sp
+Temporary labels like those introduced by Knuth [2] may
+be employed.
+A temporary label is defined as follows:
+.sp
+     n:
+.sp
+where n\b_ is a digit 0 ... 9.  Symbols of the form "n\b_f" refer to the
+first label "n\b_:" following the use of the symbol; those
+of the form "n\b_b" refer to the last "n\b_:".  The same "n\b_" may
+be used many times.
+Labels of this form are less taxing both on the
+imagination of the programmer and on the symbol table space
+of the assembler.
+.sp
+The PAL-11R opcodes ".word", ".eot" and ".end" are redundant and are omitted.
+.sp
+The symbols
+.sp
+     r0 ... r5
+     fr0 ... fr5 (floating-point registers)
+     sp
+     pc
+     ..
+.sp
+are predefined with appropriate values.
+".." is the relocation constant and is added to
+each relocatable reference.
+On a PDP-11 with relocation hardware, its value is
+0; on most systems without protection,
+its value is 40000(8).
+.sp
+The new opcode "sys" is used to specify system
+calls.
+Names for system calls are predefined.
+See section (II).
+.sp
+The opcodes "bes" (branch on error set)
+and "bec" (branch on error clear)
+are defined to test the error status bit
+set on return from system calls.
+.sp
+Strings of characters may be assembled in a way more
+convenient than PAL-11's ".ascii" operation (which is,
+therefore, omitted).  Strings are included between the
+string quotes "<" and ">":
+.sp
+     <here is a string>
+.sp
+Escape sequences exist to enter non graphic
+and other difficult characters.  These sequences are
+also effective in single and double character constants introduced
+by single (') and double (") quotes respectively.
+.sp
+     use\b\b\b___  for\b\b\b___
+     \\n   newline (012)
+     \\0   NULL (000)
+     \\>   >
+     \\t   TAB (011)
+     \\a   ACK (006)
+     \\r   CR (015)
+     \\p   ESC (033)
+     \\\\   \\ (134)
+.sp
+as\b\b__ provides a primitive segmentation facility.
+There are three segments: text\b\b\b\b____, data\b\b\b\b____ and
+bss\b\b\b___.
+The text segment is ordinarily used for
+code.  The data segment is provided
+for initialized but variable data.
+The bss segment cannot be initialized, but
+symbols may be defined to lie within this 
+segment.
+In the future, it is expected that the
+text segment will be write-protected and sharable.
+Assembly begins in the text segment.
+The pseudo-operations
+
+       .text
+       .data
+       .bss
+
+cause the assembler
+to switch to the text, data, or bss segment respectively.
+Segmentation is useful at present
+for two reasons:
+Non-initialized
+tables and variables, if placed
+in the bss segment, occupy no space in the
+output file.
+Also, alternative use of the
+text and data segments provides a primitive
+dual location-counter feature.
+
+In the output file, all text-segment information comes
+first, followed by all data-segment information,
+and finally bss information.
+Within each segment, information appears in
+the order written.
+
+Note:
+since nothing explicit can be assembled
+into the bss segment, the usual appearance
+of this segment is in the following style:
+
+       .bss
+       var1:   .=.+2
+       tab1:   .=.+100.
+       ...
+
+That is, space is reserved but nothing explicit
+is placed in it.
+
+As is evident from the example, it is legal to
+assign to the location counter ".".
+It is also permissible in segments other than ".bss".
+The restriction is made, however,
+that the value so assigned must be defined
+in the first pass and it must be a value
+associated with the same segment as ".".
+
+The pseudo-op
+
+       .comm   symbol,expression
+
+makes symbol\b\b\b\b\b\b______ an undefined global symbol,
+and places the value of the expression in
+the value field of the symbol's definition.
+Thus the above declaration is equivalent to
+
+       .globl  symbol
+       symbol = expression ^ symbol
+
+The treatment of such a symbol by the loader ld(I)
+is as follows:
+If another routine in the same load defines the symbol to be an ordinary
+text, data, bss, or absolute symbol,
+that definition takes precedence and the symbol
+acts like a normal undefined external.
+If however no other routine defines the symbol, the loader
+defines it as an external bss-segment symbol
+and reserves n\b_ bytes after its location,
+where n\b_ is the value of the expression in the .comm
+operation.
+Thus ".comm x,100"
+effectively declares x to be a common region 100
+bytes long.
+Note: all such declarations for the same symbol
+in various routines should request the same amount
+of space.
+.sp
+The binary output of the assembler is placed on the file "a.out" in the
+current directory.
+a.out\b\b\b\b\b_____ also contains the symbol table from the assembly
+and relocation bits.
+The output of the assembler is executable immediately
+if the assembly was error-free and if there were no
+unresolved external references.
+The link editor ld\b\b__ may be used to combine several
+assembly outputs and resolve global symbols.
+.sp
+The assembler does not produce a listing of the source program.
+This is not a serious drawback; the debugger db\b\b__ discussed
+below is sufficiently powerful to render a printed
+octal translation of the source unnecessary.
+
+On the last pages of this section is a list of all the assembler's
+built-in symbols.
+In the case of instructions, the addressing modes
+are as follows:
+
+.nf
+       src, dst        source, destination
+       r               general register
+       fsrc,fdst       floating source, destination
+       fr              floating register
+       exp             expression
+
+.fi
+The names of certain 11/45 opcodes are different
+from those in the 11/45 manual
+to draw analogies with existing 11/20 instructions.
+..pa +2
+
+.ti 0
+FILES          /etc/as2        pass 2 of the assembler
+.br
+/tmp/atm1?     temporary
+.br
+/tmp/atm2?     temporary
+.br
+/tmp/atm3?     temporary
+.br
+a.out          object
+.sp
+.ti 0
+SEE ALSO       ld(I),
+nm(I),
+sh(I),
+un(I),
+db(I),
+a.out(V),
+[1] PAL-11R Assembler;
+DEC-11-ASDB-D,
+[2] Knuth,
+.ul
+The Art of Computer Programming,
+Vol. I; Fundamental Algorithms.,
+"UNIX Assembler Manual" (in preparation).
+.sp
+.ti 0
+DIAGNOSTICS    When
+an input file cannot be read, its name
+followed by a question mark is typed and assembly
+ceases.
+When syntactic or semantic errors occur, a single-character diagnostic is typed out
+together with the line number and the file name in which it
+occurred.  Errors in pass 1 cause cancellation of pass 2.
+The possible errors are:
+.sp
+.in +6
+.ti -6
+)  parentheses error
+.ti -6
+]  parentheses error
+.ti -6
+<  String not terminated properly
+.ti -6
+*  Indirection ("*\b_") used illegally
+.ti -6
+.li
+.  Illegal assignment to "."
+.ti -6
+A  error in A\b_ddress
+.ti -6
+B  B\b_ranch instruction is odd or too remote
+.ti -6
+E  error in E\b_xpression
+.ti -6
+F  error in local ("F\b_" or "b") type symbol
+.ti -6
+G  G\b_arbage (unknown) character
+.ti -6
+I  End of file inside an If\b\b__
+.ti -6
+M  M\b_ultiply defined symbol as label
+.ti -6
+O  O\b_dd-- word quantity assembled at odd address
+.ti -6
+P  P\b_hase error-- "." different in pass 1 and 2
+.ti -6
+R  R\b_elocation error
+.ti -6
+U  U\b_ndefined symbol
+.ti -6
+X  syntaX\b_ error
+.in -6
+.sp
+.ti 0
+BUGS           Symbol table overflow is not checked.
+.sp
+If "." is moved backwards by an odd number of bytes,
+relocation bits are corrupted.
diff --git a/man/manx/asmt.cat b/man/manx/asmt.cat
new file mode 100644 (file)
index 0000000..29141a1
--- /dev/null
@@ -0,0 +1,198 @@
+
+
+1/15/73                                                   AS (I)
+
+
+          Special variables:                 ilgins
+                                             nice
+               .
+               ..                       Double operand:
+
+          Register:                          mov     src,dst
+                                             movb       "
+               r0                            cmp        "
+               r1                            cmpb       "
+               r2                            bit        "
+               r3                            bitb       "
+               r4                            bic        "
+               r5                            bicb       "
+               sp                            bis        "
+               pc                            bisb       "
+               fr0                           add        "
+               fr1                           sub        "
+               fr2
+               fr3                      Branch:
+               fr4
+               fr5                           br
+                                             bne
+          System calls:                      beq
+                                             bge
+               exit                          blt
+               fork                          bgt
+               read                          ble
+               write                         bpl
+               open                          bmi
+               close                         bhi
+               wait                          blos
+               creat                         bvc
+               link                          bvs
+               unlink                        bhis
+               exec                          bec     (= bcc)
+               chdir                         bcc
+               time                          blo
+               makdir                        bcs
+               chmod                         bes     (= bcs)
+               chown
+               break                    Single operand:
+               stat
+               seek                          clr     dst
+               tell                          clrb     "
+               mount                         com      "
+               umount                        comb     "
+               setuid                        inc      "
+               getuid                        incb     "
+               stime                         dec      "
+               quit                          decb     "
+               intr                          neg      "
+               fstat                         negb     "
+               cemt                          adc      "
+               mdate                         adcb     "
+               stty                          sbc      "
+               gtty                          sbcb     "
+
+                             - 7 -
+
+
+
+
+
+1/15/73                                                   AS (I)
+
+
+               ror      "                    ash     src,r
+               rorb     "                    ashc    src,r
+               rol      "                    mul     src,r
+               rolb     "                    div     src,r
+               asr      "                    xor     r,dst
+               asrb     "                    sxt     dst
+               asl      "                    mark    exp
+               aslb     "                    sob     r,exp
+               jmp      "
+               swab     "               Specials
+               tst     src
+               tstb    src                   .byte
+                                             .even
+          Miscellaneous:                     .if
+                                             .endif
+               jsr     r,dst                 .globl
+               rts     r                     .text
+               sys     exp     (= trap)      .data
+                                             .bss
+          Flag-setting:                      .comm
+
+               clc
+               clv
+               clz
+               cln
+               sec
+               sev
+               sez
+               sen
+
+          Floating point ops:
+
+               cfcc
+               setf
+               setd
+               seti
+               setl
+               clrf    fdst
+               negf    fdst
+               absf    fdst
+               tstf    fsrc
+               movf    fsrc,fr (= ldf)
+               movf    fr,fdst (= stf)
+               movif   src,fr  (= ldcif)
+               movfi   fr,dst  (= stcfi)
+               movof   fsrc,fr (= ldcdf)
+               movfo   fr,fdst (= stcfd)
+               addf    fsrc,fr
+               subf    fsrc,fr
+               mulf    fscr,fr
+               divf    fsrc,fr
+               cmpf    fsrc,fr
+               modf    fsrc,fr
+
+          11/45 operations
+
+
+                             - 8 -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/man/manx/asmt.x b/man/manx/asmt.x
new file mode 100644 (file)
index 0000000..25eedca
--- /dev/null
@@ -0,0 +1,224 @@
+'pl132
+.pn 1
+.de hd
+'sp2
+.tl '1/15/73''AS (I)'
+'sp2
+'in16
+..
+.de im
+'sp10
+'in 46
+..
+.de fo
+'sp
+.tl ''- A% -''
+'bp
+..
+.wh 0 hd
+.wh 61 im
+.wh -6 fo
+.br
+.nf
+.ti-5
+Special variables:
+.sp
+.li 2
+.
+..
+.sp
+.ti -5
+Register:
+.sp
+r0
+r1
+r2
+r3
+r4
+r5
+sp
+pc
+fr0
+fr1
+fr2
+fr3
+fr4
+fr5
+.sp
+.ti -5
+System calls:
+.sp
+exit
+fork
+read
+write
+open
+close
+wait
+creat
+link
+unlink
+exec
+chdir
+time
+makdir
+chmod
+chown
+break
+stat
+seek
+tell
+mount
+umount
+setuid
+getuid
+stime
+quit
+intr
+fstat
+cemt
+mdate
+stty
+gtty
+ilgins
+nice
+.sp
+.ti -5
+Double operand:
+.sp
+mov    src,dst
+movb      "
+cmp       "
+cmpb      "
+bit       "
+bitb      "
+bic       "
+bicb      "
+bis       "
+bisb      "
+add       "
+sub       "
+.sp
+.ti -5
+Branch:
+.sp
+br
+bne
+beq
+bge
+blt
+bgt
+ble
+bpl
+bmi
+bhi
+blos
+bvc
+bvs
+bhis
+bec    (= bcc)
+bcc
+blo
+bcs
+bes    (= bcs)
+.sp
+.ne 5
+.ti-5
+Single operand:
+.sp
+clr    dst
+clrb    "
+com     "
+comb    "
+inc     "
+incb    "
+dec     "
+decb    "
+neg     "
+negb    "
+adc     "
+adcb    "
+sbc     "
+sbcb    "
+ror     "
+rorb    "
+rol     "
+rolb    "
+asr     "
+asrb    "
+asl     "
+aslb    "
+jmp     "
+swab    "
+tst    src
+tstb   src
+.sp
+.ti -5
+Miscellaneous:
+.sp
+jsr    r,dst
+rts    r
+sys    exp     (= trap)
+.sp
+.ti -5
+Flag-setting:
+.sp
+clc
+clv
+clz
+cln
+sec
+sev
+sez
+sen
+.sp
+.ti -5
+Floating point ops:
+.sp
+cfcc
+setf
+setd
+seti
+setl
+clrf   fdst
+negf   fdst
+absf   fdst
+tstf   fsrc
+movf   fsrc,fr (= ldf)
+movf   fr,fdst (= stf)
+movif  src,fr  (= ldcif)
+movfi  fr,dst  (= stcfi)
+movof  fsrc,fr (= ldcdf)
+movfo  fr,fdst (= stcfd)
+addf   fsrc,fr
+subf   fsrc,fr
+mulf   fscr,fr
+divf   fsrc,fr
+cmpf   fsrc,fr
+modf   fsrc,fr
+.sp
+.ti -5
+11/45 operations
+.sp
+ash    src,r
+ashc   src,r
+mul    src,r
+div    src,r
+xor    r,dst
+sxt    dst
+mark   exp
+sob    r,exp
+.sp
+.ti -5
+Specials
+.sp
+.li 9
+.byte
+.even
+.if
+.endif
+.globl
+.text
+.data
+.bss
+.comm
diff --git a/man/manx/basic.6 b/man/manx/basic.6
new file mode 100644 (file)
index 0000000..2d0c572
--- /dev/null
@@ -0,0 +1,32 @@
+.pa 1
+.he '3/15/72''BASIC (VI)'
+.ti 0
+NAME           basic -- DEC supplied BASIC
+.sp
+.ti 0
+SYNOPSIS       basic [file]
+.sp
+.ti 0
+DESCRIPTION    Basic
+is the standard BASIC V000 distributed
+as a stand alone program.
+The optional file argument is read before the console.
+See DEC-11-AJPB-D manual.
+.sp
+Since bas\b\b\b___ is smaller and faster,
+basic\b\b\b\b\b_____ is not maintained on line.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       bas
+.sp
+.ti 0
+DIAGNOSTICS    See manual
+.sp
+.ti 0
+BUGS           GOK
+.sp
+.ti 0
+OWNER          dmr
diff --git a/man/manx/cal.6 b/man/manx/cal.6
new file mode 100644 (file)
index 0000000..fce9eb7
--- /dev/null
@@ -0,0 +1,35 @@
+.pa 1
+.he '3/15/72''CAL (VI)'
+.ti 0
+NAME           cal -- print calendar
+.sp
+.ti 0
+SYNOPSIS       /usr/ken/cal year
+.sp
+.ti 0
+DESCRIPTION    Cal
+will print a calendar for the given year.
+The year can be between 0 (really 1 BC)
+and 9999.
+For years when
+several calendars were in vogue in
+different countries,
+the calendar of England (and therefore her colonies)
+is printed.
+.sp
+P.S. try cal of 1752.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          ken
diff --git a/man/manx/chash.1 b/man/manx/chash.1
new file mode 100644 (file)
index 0000000..fbe4e38
--- /dev/null
@@ -0,0 +1,44 @@
+.pa 1
+.he '6/13/1972''CHASH (I)'
+.fi
+.in16
+.ti 0
+NAME           chash  --  precompile a hash table for cref\b\b\b\b____
+.sp
+.fi
+.in16
+.ti 0
+SYNOPSIS       chash\b\b\b\b\b_____ file1 file2
+.sp
+.fi
+.in16
+.ti 0
+DESCRIPTION    CHASH
+takes symbols (character sequences; one per line) from
+file1\b\b\b\b\b_____ and compiles a hash table for the use of cref\b\b\b\b____.
+The table is written on file2\b\b\b\b\b_____.
+.sp
+A subroutine suitable for searching such a hash table
+is available from the author.
+.sp
+.fi
+.in16
+.ti 0
+FILES          ---
+.sp
+.fi
+.in16
+.ti 0
+SEE ALSO       cref(I)
+.sp
+.fi
+.in16
+.ti 0
+DIAGNOSTICS    ---
+.sp
+.fi
+.in16
+.ti 0
+BUGS           There
+can only be 199 symbols; they may total
+only 600 characters of text.
diff --git a/man/manx/das.6 b/man/manx/das.6
new file mode 100644 (file)
index 0000000..a9a293f
--- /dev/null
@@ -0,0 +1,27 @@
+.pa 1
+.he '3/15/72''DAS (VI)'
+.ti 0
+NAME           das -- disassembler
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    A PDP-11
+disassembler exists.
+Contact the owner for more information.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          ken
diff --git a/man/manx/dds.1 b/man/manx/dds.1
new file mode 100644 (file)
index 0000000..35023aa
--- /dev/null
@@ -0,0 +1,25 @@
+.pa 1
+.he 'Y''X'
+.ti 0
+NAME           X
+.sp
+.ti 0
+SYNOPSIS       X
+.sp
+.ti 0
+DESCRIPTION    X
+.sp
+.ti 0
+FILES          X
+.sp
+.ti 0
+SEE ALSO       X
+.sp
+.ti 0
+DIAGNOSTICS    X
+.sp
+.ti 0
+BUGS           X
+.sp
+.ti 0
+OWNER          X
diff --git a/man/manx/dpt.6 b/man/manx/dpt.6
new file mode 100644 (file)
index 0000000..9b1f3a4
--- /dev/null
@@ -0,0 +1,31 @@
+.pa 1
+.he '3/15/72''DPT (VI)'
+.ti 0
+NAME           dpt -- read DEC ASCII paper tape
+.sp
+.ti 0
+SYNOPSIS       dpt output [input]
+.sp
+.ti 0
+DESCRIPTION    dpt\b\b\b___
+reads the input file (/dev/ppt default)
+assuming the format is a DEC generated
+ASCII paper tape of an assembly language program.
+The output is a UNIX ASCII assembly program.
+.sp
+.ti 0
+FILES          /dev/ppt
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           Almost
+always a hand pass is required to get
+a correct output.
+.sp
+.ti 0
+OWNER          ken, dmr
diff --git a/man/manx/fptrap.3 b/man/manx/fptrap.3
new file mode 100644 (file)
index 0000000..489015c
--- /dev/null
@@ -0,0 +1,94 @@
+.pa 1
+.he '3/15/72''FPTRAP (III)'
+.ti 0
+NAME           fptrap  --  PDP-11/45 floating point simulator
+.sp
+.ti 0
+.nf
+SYNOPSIS       .globl fptrap
+.br
+sys ilgins; fptrap
+.fi
+.sp
+.ti 0
+DESCRIPTION    fptrap\b\b\b\b\b\b______
+is a package which picks up instructions which are illegal
+for the PDP-11/20, and if they correspond to 11/45 floating
+point instructions, simulates their operation.
+The following instructions are supported:
+
+       cfcc
+       setf
+       seti
+       setd
+       setl
+.      ldfps   src             (not in assembler)
+.      stfps   dst             (not in assembler)
+       clrf    fdst
+       tstf    fsrc
+       absf    fdst
+       negf    fdst
+       mulf    fsrc,fr
+       modf    fsrc,fr
+       addf    fsrc,fr
+       movf    fsrc,fr (=ldf)
+       movf    fr,fdst (=stf)
+       subf    fsrc,fr
+       cmpf    fsrc,fr
+       divf    fsrc,fr
+.nf
+.      movei   fr,dst  (=stexp)  (not in assembler)
+.      movie   src,fr  (=ldexp)  (not in assembler)
+       movfi   fr,dst  (=stcfi)
+       movif   src,fr  (=ldcif)
+       movfo   fr,fdst (=stcxy)
+       movof   fsrc,fr (=ldcyx)
+.fi
+
+Here src\b\b\b___ and dst\b\b\b___ stand for source and destination, fsrc\b\b\b\b____
+and fdst\b\b\b\b____ for floating source and destination, and fr\b\b__ for
+floating register.
+Notice that the names of several of the opcodes have changed.
+The only strange instruction
+is movf\b\b\b\b____, which turns into stf\b\b\b___ if its source
+operand is a floating register, and into ldf\b\b\b___ if not.
+.sp
+The simulator sets the floating condition codes
+on both ldf\b\b\b___ and stf\b\b\b___.
+The 11/45 hardware does not set
+the fcc on stf.
+
+Short and long format for both floating point numbers
+and integers is supported.  Truncation mode is always in effect.
+Traps for overflow and other arithmetic errors are not supported.
+Illegal instructions or addresses cause a simulated trap
+so that a core image is produced.
+
+The condition code bits are maintained correctly.
+
+For floating-point source operands, immediate mode ((pc)+) is
+not supported, since the PDP-11/45
+handbook is not clear on what to do about it.
+
+After an arithmetic error the result is generally
+meaningless.
+
+The arithmetic is always done in double-precision, so exact
+but unrounded results are to be expected in single-precision
+mode.  Double precision results are probably less correct
+than the hardware will be.
+
+The lower parts of the floating registers become meaningless
+during single-precision operations.
+.sp
+.ti 0
+FILES          kept in /usr/lib/liba.a
+.sp
+.ti 0
+SEE ALSO       PDP-11/45 handbook, ilgins(II)
+.sp
+.ti 0
+DIAGNOSTICS    trap, c-bit, v-bit
+.sp
+.ti 0
+BUGS           see above
diff --git a/man/manx/fstrip.1 b/man/manx/fstrip.1
new file mode 100644 (file)
index 0000000..8e89e8c
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he '10/24/72''FSTRIP (I)'
+.ti 0
+NAME           fstrip -- remove Fortran internal symbols
+.sp
+.ti 0
+SYNOPSIS       fstrip\b\b\b\b\b\b______ name\d1\u ...
+.sp
+.ti 0
+DESCRIPTION    Fortran output
+files occasionally refer to so
+many symbols that the debugger db\b\b__ (I) balks.
+.ul
+fstrip
+massages a Fortran output file to remove the symbols
+which are internal to Fortran.
+
+From the symbol tables contained in the files
+given as arguments,
+fstrip\b\b\b\b\b\b______ removes the symbols of the form "l#",
+where "l" is one of "t", "c", or "d", and "#" is
+a decimal number.
+
+The output of fstrip\b\b\b\b\b\b______ is unacceptable to the loader
+under any circumstances.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       fc(I)
+.sp
+.ti 0
+DIAGNOSTICS    yes, hopefully self-explanatory
+.sp
+.ti 0
+BUGS           --
diff --git a/man/manx/ident.5 b/man/manx/ident.5
new file mode 100644 (file)
index 0000000..c9d1dc0
--- /dev/null
@@ -0,0 +1,37 @@
+.pa 1
+.he '6/12/72''IDENT (V)'
+.ti 0
+NAME           ident -- IDENT card file
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    ident\b\b\b\b\b_____
+is a file used to generate GECOS $IDENT
+cards by the off-line print program opr(I).
+There is one entry per line in the following
+style:
+
+       05:m1234,m789,name
+
+which causes the following $IDENT card to be generated:
+
+       $       IDENT   m1234,m789,name
+
+.sp
+.ti 0
+FILES          kept
+in /etc/ident.
+.sp
+.ti 0
+SEE ALSO       opr(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          ken, dmr
diff --git a/man/manx/kbd.7 b/man/manx/kbd.7
new file mode 100644 (file)
index 0000000..5c5b7f7
--- /dev/null
@@ -0,0 +1,44 @@
+.pa 1
+.he '6/15/72''KBD (VII)'
+.ti 0
+NAME           kbd  --  keyboard map
+.sp
+.ti 0
+SYNOPSIS       cat /usr/pub/kbd
+.sp
+.ti 0
+DESCRIPTION    kbd\b\b\b___
+contains a map to the keyboard for model 37 Teletype
+terminals with the extended character set feature.
+If kbd\b\b\b___
+is printed on such a terminal, the following will appear:
+
+.nf
+.in -2
+<[1234567890-_]^\\ >qwertyuiop@ asdfghjkl;: zxcvbnm,./
+
+\ e<[1234567890-_]^\\ >          @          ;:        ,./\ f
+
+
+<{!"#$%&'() =_}~| >QWERTYUIOP` ASDFGHJKL+* ZXCVBNM,.?
+
+\ e<{ !"#$%&'() =_} ~ |  >QWERTYUIOP`  ASDFGHJKL+* ZXCVBNM,.?\ f
+
+
+.fi
+.sp
+.in +2
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          jfo
diff --git a/man/manx/login.7 b/man/manx/login.7
new file mode 100644 (file)
index 0000000..bb221e5
--- /dev/null
@@ -0,0 +1,101 @@
+.pa 1
+.he '6/15/72''LOGIN, LOGOUT (VII)'
+.ti 0
+NAME           logging in and logging out
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    UNIX
+must be called from an appropriate terminal.
+UNIX supports ASCII terminals typified by the Teletype M37,
+the GE Terminet 300, the Memorex 1240, and various
+graphical terminals on the one hand, and IBM 2741-type
+terminals on the other.
+
+Not all installations support
+all these terminals.
+Often the M33/35 Teletype is supported instead
+of the 2741.
+Depending on the hardware installed, most
+terminals operating at 110, 134.5, 150, or 300 baud can
+be accommodated.
+
+To use UNIX,
+it is also necessary to have
+a valid UNIX user ID and (if desired) password.  These
+may be obtained, together with the telephone number, from the system administrators.
+
+The same telephone number
+serves terminals operating at all the standard speeds.
+The discussion below applies when the standard
+speeds of 134.5 (2741's)
+150 (TTY 37's) and 300 (Terminet 300's)
+are available.
+
+When a connection is established via a 150-baud terminal
+(e.g. TTY 37) UNIX types out "login:"; you respond with
+your user name, and, if requested, with a password.
+(The printer is turned off while you type the
+password.)
+If the login was successful, the "@" character
+is typed by the Shell to indicate
+login is complete and commands may be issued.
+A message of the day may be typed if there are any announcements.
+Also, if there is a file called "mailbox", you are notified
+that someone has sent you mail.
+(See the mail\b\b\b\b____ command.)
+
+From a 300-baud terminal, the procedure is slightly different.
+Such terminals often have a full-duplex switch, which should
+be turned on (or conversely, half-duplex should be turned off).
+When a connection with UNIX is established, a few garbage
+characters are typed (these are the "login:" message at the wrong speed).
+You should depress the "break" key;
+this is a speed-independent signal to UNIX that a 300-baud
+terminal is in use.  It will type "login:" (at the correct speed
+this time) and from then on the procedure is the same as described
+above.
+
+From a 2741, no message will appear.
+After the telephone connection is established,
+press the "ATTN" button.
+UNIX should type "login:" as described above.
+If the greeting does not appear after a few seconds,
+hang up and try again; something has gone wrong.
+If a password is required,
+the printer cannot be turned off, so it will appear on the paper
+when you type it.
+
+For more information, consult
+getty(VII), which discusses the login sequence in more
+detail, and tty0(IV), which discusses typewriter I/O.
+
+Logging out is simple by comparison (in fact, sometimes too simple).
+Simply generate an end-of-file at Shell level by using
+the EOT character; the "login:" message will appear again to
+indicate that you may log in again.
+
+It is also possible to log out simply by hanging up the terminal;
+this simulates an end-of-file on the typewriter.
+.sp
+.ti 0
+FILES          /etc/motd
+may contain a message-of-the-day.
+.sp
+.ti 0
+SEE ALSO       init(VII), getty(VII), tty0(IV)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           Hanging up
+on programs which never read
+the typewriter or which ignore end-of-files
+is very dangerous; in the worst cases,
+the programs can only be halted by restarting the system.
+.sp
+.ti 0
+OWNER          ken, dmr
diff --git a/man/manx/lpr.4 b/man/manx/lpr.4
new file mode 100644 (file)
index 0000000..7c9415e
--- /dev/null
@@ -0,0 +1,52 @@
+.pa 1
+.he '6/12/72''LPR (IV)'
+.ti 0
+NAME           /dev/lpr -- line printer
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    The
+line printer special file is
+the UNIX interface to a DEC LP-11 line printer.
+This file may only be opened (or creat'ed) for writing.
+Anything written on this file is printed on the line printer.
+The following special cases for the
+printer are handled:
+.sp
+.in +3
+On opening and on closing, the paper is
+slewed to the top of the next page.
+.sp
+For the 64 character printer (LP11-FA),
+all lower case letters are
+converted to upper case.
+.sp
+Tabs are converted to align on every eighth column.
+.sp
+New lines and form feeds are ignored when the
+printer is at the top of a page.
+This is done so that pr\b\b__ and roff\b\b\b\b____ output may
+be directed to the printer and sync on
+page boundaries even with automatic page slew.
+.sp
+Carriage return and back space
+can cause multiple printing on a single line
+to allow for overstruck graphics.
+.sp
+.in -3
+.ti 0
+FILES          found in /dev
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          ken, dmr
diff --git a/man/manx/moo.6 b/man/manx/moo.6
new file mode 100644 (file)
index 0000000..7b95a18
--- /dev/null
@@ -0,0 +1,26 @@
+.pa 1
+.he '3/15/72''MOO (VI)'
+.ti 0
+NAME           moo -- a game
+.sp
+.ti 0
+SYNOPSIS       /usr/games/moo
+.sp
+.ti 0
+DESCRIPTION    moo\b\b\b___
+is a guessing game imported from England.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          ken
diff --git a/man/manx/obproc.7 b/man/manx/obproc.7
new file mode 100644 (file)
index 0000000..6855370
--- /dev/null
@@ -0,0 +1,240 @@
+.pa 1
+.he '3/15/72''BOOT PROCEDURES (VII)'
+.ti 0
+NAME           bos, maki, rom, vcboot, msys, et al
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    On
+the RF disk, the highest 16K words are
+reserved for stand-alone programs.
+These 16K words are allocated as follows:
+.sp
+bos            (1K)
+.br
+Warm UNIX      (7K)
+.br
+Cold UNIX      (8K)
+.sp
+The UNIX read only memory (ROM)
+is home cut with 2 programs of 16 words each.
+The first (address 173000)
+reads bos\b\b\b___ from the RF disk into core
+location 154000
+and transfers to 154000.
+The other ROM program
+(address 173040)
+reads a DECtape sitting in the end-zone
+on drive 0
+into core location 0 and transfers to 0.
+This latter operation is compatible with
+part of DEC's standard ROM.
+The disassembled code for the UNIX ROM follows:
+.sp
+.nf
+.in 8
+173000:        mov     $177472,r0              12700;177472
+       mov     $3,-(r0)                12740;3
+       mov     $140000,-(r0)           12740;140000
+       mov     $154000,-(r0)           12740;154000
+       mov     $-2000,-(r0)            12740;176000
+       mov     $5,-(r0)                12740;5
+       tstb    (r0)                    105710
+       bge     .-2                     2376
+       jmp     *$154000                137;154000
+.sp
+173040:        mov     $177350,r0              12700;177350
+       clr     -(r0)                   5040
+       mov     r0,-(r0)                10040
+       mov     $3,-(r0)                12740;3
+       tstb    (r0)                    105710
+       bge     .-2                     2376
+       tst     *$177350                5737;177350
+       bne     .                       1377
+       movb    $5,(r0)                 112710;5
+       tstb    (r0)                    105710
+       bge     .-2                     2376
+       clr     pc                      5007
+.fi
+.in 16
+.sp
+The program bos\b\b\b___ (Bootstrap Operating System)
+examines the console switchs and executes
+one of several internal programs depending on the setting.
+The following settings are currently recognized:
+.sp
+.in +8
+.ti -8
+???    Will read Warm UNIX from
+the RF into core location 0 and transfer to 600.
+.sp
+.ti -8
+1      Will read Cold UNIX from the
+RF into core location 0 and transfer to 600.
+.sp
+.ti -8
+10     Will dump all of memory
+from core location 0 onto DECtape drive 7
+and then halt.
+.sp
+.ti -8
+20     Will read 256 words from RK0 into
+core 0 and transfer to zero.
+This is the procedure to boot
+DOS from an RK.
+.sp
+.ti -8
+40     This is the same as 10 above, but
+instead of halting, UNIX warm is loaded.
+.sp
+.ti -8
+0      Will load a standard UNIX binary paper tape
+into core location 0 and transfer to 0.
+.sp
+.ti -8
+77500  Will load the standard DEC absolute and binary
+loaders and transfer to 77500.
+.sp
+.in 16
+Thus we come to the UNIX warm boot procedure:
+put 173000 into the switches, push
+.ul
+load address
+and then push
+.ul
+start.
+The alternate switch setting of 173030
+that will load warm UNIX is used
+as a signal to bring up
+a single user system for special
+purposes.
+See
+init(VII).
+For systems without a rom,
+UNIX (both warm and cold)
+have a copy of the disk boot
+program at location 602.
+This is probably a better warm boot
+procedure because
+the program at 602 also
+attempts to complete outstanding I/O.
+.sp
+Cold boots can be accomplished with the
+Cold UNIX program, but they're not.
+Thus the Cold UNIX slot on the RF may have
+any program desired.
+This slot is, however, used during a cold boot.
+Mount the UNIX INIT DECtape on drive
+0 positioned in the end-zone.
+Put 173040 into the switches.
+Push
+.ul
+load address.
+Put 1 into the switches.
+Push
+.ul
+start.
+This reads a program called
+.ul
+vcboot
+from the tape into
+core location 0 and transfers to it.
+vcboot\b\b\b\b\b\b______ then reads 16K words from
+the DECtape (blocks 1-32)
+and copies the data to the highest 16K words of
+the RF.
+Thus this initializes the read-only part of the RF.
+vcboot\b\b\b\b\b\b______ then reads in bos\b\b\b___ and executes it.
+bos\b\b\b___ then reads in Cold UNIX and executes that.
+Cold UNIX halts for a last chance before
+it completely initializes the RF file system.
+Push
+.ul
+continue,
+and Cold UNIX will initialize the RF.
+It then sets into execution a user program
+that reads the DECtape for initialization files
+starting from block 33.
+.a
+When this is done, the program executes
+/etc/init
+which should have been on the tape.
+.sp
+The INIT tape is made by the program maki\b\b\b\b____
+running under UNIX.
+maki\b\b\b\b____ writes vcboot\b\b\b\b\b\b______ on block 0 of
+.ul
+/dev/tap7.
+It then copies the RF 16K words (using
+.ul
+/dev/rf0)
+onto blocks 1 thru 32.
+It has internally a list of files to
+be copied from block 33 on.
+This list follows:
+.sp
+.nf
+.in +8
+/etc/init
+/bin/chmod
+/bin/date
+/bin/login
+/bin/ls
+/bin/mkdir
+/etc/mount
+/bin/sh
+/bin/tap
+.in -8
+.fi
+.sp
+Thus this is the set of programs available after a cold boot.
+init\b\b\b\b____ and sh\b\b__ are mandatory.
+For multi-user UNIX,
+getty\b\b\b\b\b_____ and login\b\b\b\b\b_____ are also necessary.
+mkdir\b\b\b\b\b_____ is necessary due to a bug in tap\b\b\b___.
+tap\b\b\b___ and mount\b\b\b\b\b_____ are useful to
+bring in new files.
+As soon as possible, date\b\b\b\b____ should be done.
+That leaves ls\b\b__ and chmod\b\b\b\b\b_____ as frosting.
+.sp
+The last link in this incestuous
+daisy chain is the program msys\b\b\b\b____.
+.sp
+   msys\b\b\b\b____ char file
+.sp
+will copy the file file\b\b\b\b____ onto the
+RF read only slot specified by the characacter char\b\b\b\b____.
+Char is taken from the following set:
+.sp
+   b\b_ bos
+   u\b_ Warm UNIX
+   1\b_ Cold UNIX
+.sp
+Due to their rarity of use,
+maki\b\b\b\b____ and msys\b\b\b\b____ are maintained off line and
+must be reassembled before used.
+.sp
+.ti 0
+FILES          /dev/rf0,
+/dev/tap?
+.sp
+.ti 0
+SEE ALSO       init(VII),
+tap(I),
+sh(I),
+mkdir(I)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           This
+section is very configuration dependent.
+Thus, it does not
+describe the boot procedure for
+any one machine.
+.sp
+.ti 0
+OWNER          ken
diff --git a/man/manx/rp.4 b/man/manx/rp.4
new file mode 100644 (file)
index 0000000..8e8a1bf
--- /dev/null
@@ -0,0 +1,34 @@
+.pa 1
+.he '6/12/72''RP0 (IV)'
+.ti 0
+NAME           rp0  --  RP11/RP02 disk
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    rp0\b\b\b___
+refers to the entire RP02 disk as a single sequentially-addressed
+file.
+Its 256-word blocks are numbered 0 to 40599.
+Like the RF disk and the tape files, its
+addressing is block-oriented.
+Consult the rf0(IV) section.
+.sp
+.ti 0
+FILES          found in /dev
+.sp
+.ti 0
+SEE ALSO       rf0(IV), tap0(IV)
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           See rf0(IV)
+.br
+Due to a hardware bug,
+block 40599 on the RP cannot be accessed.
+.sp
+.ti 0
+OWNER          ken, dmr
diff --git a/man/manx/speakm.5 b/man/manx/speakm.5
new file mode 100644 (file)
index 0000000..c0cb906
--- /dev/null
@@ -0,0 +1,42 @@
+.pa 1
+.he '2/5/73''SPEAK.M (V)'
+.ti 0
+NAME           /etc/speak.m -- voice synthesizer vocabulary
+.sp
+.ti 0
+DESCRIPTION    The memory file for
+.ul
+speak.
+It contains:
+.sp
+- a word containing n, the number of entries
+.br
+- n 4-word entries, counted 0,1...n-1
+.br
+- a word containing m, the number of bytes of strings
+.br
+- m bytes of strings, counted 0,1...m-1, each null-terminated
+.sp
+The entries are arranged in a tree.
+Each consists of four pointers.
+Zero pointers point nowhere.
+The pointers are:
+.sp
+- the number (in string storage) of the first byte of the
+word for this entry
+.br
+- the number of the first byte of the phonetic line
+for the word.  The line is coded according to vsp\b\b\b___ (VII).
+.br
+- the number of an entry that precedes the present word
+in ascii lexicographic order
+.br
+- the number of an entry that follows the present
+word in lexicographic order
+.br
+.sp
+Entry zero points to no word.
+Byte zero of string storage is null.
+.sp
+.ti 0
+SEE ALSO       speak(I), vsp(VII)
diff --git a/man/manx/ttt.6 b/man/manx/ttt.6
new file mode 100644 (file)
index 0000000..f9b78c7
--- /dev/null
@@ -0,0 +1,29 @@
+.pa 1
+.he '3/15/72''TTT (VI)'
+.ti 0
+NAME           ttt -- tic-tac-toe
+.sp
+.ti 0
+SYNOPSIS       /usr/games/ttt
+.sp
+.ti 0
+DESCRIPTION    ttt\b\b\b___
+is the X's and O's game
+popular in 1st grade.
+This is a learning program that never
+makes the same mistake twice.
+.sp
+.ti 0
+FILES          ttt.k -- old mistakes
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          ken
diff --git a/man/manx/uids.5 b/man/manx/uids.5
new file mode 100644 (file)
index 0000000..c7d9bd8
--- /dev/null
@@ -0,0 +1,33 @@
+.pa 1
+.he '3/15/72''UIDS (V)'
+.ti 0
+NAME           /etc/uids  --  map user names to user IDs
+.sp
+.ti 0
+SYNOPSIS       --
+.sp
+.ti 0
+DESCRIPTION    This file
+allows programs to map user names into user numbers and vice versa.
+Anyone can read it.
+It resides in directory /etc, and should be updated
+along with the password file when a user is added or deleted.
+
+The format is an ASCII name,
+followed by a colon, followed by a decimal ASCII
+user ID number.
+.sp
+.ti 0
+FILES          --
+.sp
+.ti 0
+SEE ALSO       --
+.sp
+.ti 0
+DIAGNOSTICS    --
+.sp
+.ti 0
+BUGS           --
+.sp
+.ti 0
+OWNER          dmr, ken