IMD 1.16: 8/06/2007 8:07:30 TOOLSBDSLBR TOOLSBDSLBR !TOOLSBDSLBR"#$%&'()*+,-./01TOOLSBDSLBR23456789:;<=>?@ATOOLSBDSLBR BCDEFGHIJKTPKERM HQPLTPKERMITLBRMNOPQRSTUVWXYZ[\TPKERMITLBR]^_`abcdeTPWARMSTPQTfgTRACER LBRBhijklTRAP COMmTREK COMVnopqrstuvwxyz{TREKINSTCOM|}~TRIVFF LBRTRIVFF LBRTSORT LBRhTXT2ASM AQMGTXT42 LBRoTXT50 LBR#-PUBDOM 056 zSINGLE SUB7TOOLS H 6ROFF H C&RARGS BDSi 4CONVERT BDS=HCOPY BDSDATE BDSXkECHO BDS=FILE BDSVMISC BDS2LPATTERN BDS:SRAT2C BDSbRAWFILE BDSdROFF1 BDSc@?ROFF2 BDS(5STORAGE BDS STRING BDS((SYMTAB BDSFN5TOOLIB1 BDS.pyTOOLIB1 CRL.TOOLIB2 CRL*>BDS DOCJCHANGES DOC4CONVR2C DOCH.-6FILE DOCvLINKARGSSUBLINKCOPYSUB@SYMLINK SUB0TOOLS SUB݈;submit file to create "primitives and tools in BDS C" disk ;put single density disk to be created on drive B: ; xsub pip b:=a:single.sub b:=a:tools.h b:=a:roff.h b:=a:args.bds b:=a:convert.bds b:=a:copy.bds b:=a:date.bds b:=a:echo.bds b:=a:file.bds b:=a:misc.bds b:=a:pattern.bds b:=a:rat2c.bds b:=a:rawfile.bds b:=a:roff1.bds b:=a:roff2.bds b:=a:storage.bds b:=a:string.bds b:=a:symtab.bds b:=a:toolib1.bds b:=a:toolib1.crl b:=a:toolib2.crl b:=a:bds.doc b:=a:changes.doc b:=a:convr2c.doc b:=a:file.doc b:=a:linkargs.sub b:=a:linkcopy.sub b:=a:symlink.sub b:=a:tools.sub /* Standard header for Software Tools * This file includes a version of BDSCIO.h * source: tools.h * version: August 23, 1981 */ /* This file contains: 1. Unchanging constants used by BDS C. 2. Unchanging constants used by Software Tools. 3. Global variables for the Software tools and constants used to define those variables. All software tools sdependent parameters */ /* comment out ----- #define BITS_PER_CHAR 8 #define BITS_PER_WORD 16 #define CHARS_PER_WORD 2 #define MAX_INTEGER 32767 #define MIN_INTEGER -32768 #define MAX_REAL_EXP 38 #define MIN_REAL_EXP -38 #define REAL_PRECISION 6 ----- comment out */ /* DRIVER and DRETURN have been eliminated. Instead, each tool should start as follows: main(arc, argv) int argc; char ** argv; { initst(argc, argv); tool(); } */ /* Definitions for 'spawn' primitive */ /* comment out ---------- #define WAIT 'w' wait for subprocess to complete #define NOWAIT 'n' control returns as soon as subprocess starts #define BACKGR 'b' spawning a background process ---------- end comment out */ /* Part 3 -- Define global variables */ /* max chars in file name (including EOS) for CP/M = 2 (disk) 8 (filename) 1 (dot) 3 (extension) 1 (EOS) */ #define SYS_MAXFN 15 /* replaces FILENAMESIZE, MAXNAME */ #define MAXLINE 135 /* used by BOTH BDS and tools */ hould include tools.h and should NOT include bdscio.h */ /* Part 1 -- Unchanging constants used by BDS C*/ #define BASE 0 /* Base of CP/M system RAM */ #define NULL 0 #define EOF -1 /* Physical EOF returned by */ /* low level I/O functions */ #define ERROR -1 #define OK 0 #define CPMEOF 0x1a /* CP/M End-of-text-file marker */ /* (sometimes!) */ #define SECSIZ 128 /* Sector size for read/write calls */ #define TRUE 1 #define FALSE 0 /* Part 2 -- Unchanging constants used by Software Tools */ #define BEGINNING_OF_FILE -2 /* seek to start of file */ #define END_OF_FILE EOF /* flag to seek for eof */ #define DIGIT '0' #define LETTER 'A' #define ERR ERROR #define HUGE 30000 /* some arbitrarily large number */ #define LAMBDA 0 /* end of list marker */ #define NO 0 #define YES 1 #define NOERR OK /* file types */ /* comment out ----- (file types) #define ALPHA -9 #define ASCII 12 #define BINARY 60 #define LOCAL 6 ----- end comment out */ /* AS #define MAXCARD 80 /* "card" size */ /* to be replaced */ #define MAXCHARS 20 /* max nbr of chars when converting */ /* from integers to characters */ /* (used by putint, outnum, etc.) */ #define MAXPAT 128 /* max size of encoded patterns */ /* (used in string matching) */ #define NCHARS 33 /* number of special characters */ /* define size of I/O buffers The NSECTS symbol controls the size of the file buffers. To change the buffer size allocation, follow these steps: 1) Alter NSECTS to the desired value here in tools.h 2) Re-compile ALL bds files. Make sure you use declare all your I/O buffers with the a statement such as: char buf_name[BUFSIZ]; */ #define NSECTS 8 /* Number of sectors to buffer up in ram */ #define BUFSIZ (NSECTS * SECSIZ + 6 ) /* Don't touch this */ struct _buf { /* Or this... */ int _fd; int _nleft; char *_nextp; char _buff[NSECTS * SECSIZ]; }; /* seed for random number generators */ inCII control character definitions */ #define NUL 0 #define BEL 7 #define BS 8 #define HT 9 #define LF 10 #define VT 11 #define FF 12 #define CR 13 #define CAN 24 #define ESC 27 #define DEL 127 /* Synonyms for important non-printing ASCII characters */ #define BACKSPACE 8 #define BELL 7 #define BLANK 32 #define NEWLINE 10 #define RUBOUT 127 #define TAB 9 /* Printable ASCII characters */ #define DQUOTE 34 #define LBRACE 123 #define LBRACK 91 #define LPAREN 40 #define RBRACE 125 #define RBRACK 93 #define RPAREN 41 #define SQUOTE 39 #define UNDERLINE 95 /* Ratfor language extensions */ #define FILEDES int #define POINTER int #define BOOL int #define EOS 0 /* comment out ----- define (DS_DECL,integer $1($2);common/cdsmem/$1) define (IS_DIGIT,(DIG0<=$1&$1<=DIG9)) # valid only for ASCII! define (IS_LETTER,(IS_UPPER($1)|IS_LOWER($1))) define (IS_LOWER,(LETA<=$1&$1<=LETZ)) define (IS_UPPER,(BIGA<=$1&$1<=BIGZ)) ----- end comment out */ /* Machine-t sys_seed; /* time and date */ char sys_date [MAXLINE]; /* dynamic storage allocation information */ struct _header { struct _header *_ptr; unsigned _size; }; struct _header _base; struct _header *_allocp; /* command line argument information */ int sys_narg; /* number of arguments in list */ /* init to 0 */ int sys_args[30]; /* pointers to n'th argument */ /* BDS C has max of 30 arguments */ /* file information: Units are either standard units or explicitly opened files. Units 0, 1, and 2 are the STDIN, STDOUT, and ERROUT units. By default, these units are the same as the user's console, but these units may be redirected to files via the command line characters >, < and ?. Units 3 and 4 are always assigned to the user's console and line printer respectively. These units can not be reassigned. Reading from unit 4 is not permitted. The user need never open units 0 through 4, although it is permissible to do so. Units with  /* define special characters visible to the user */ #define ARGFLAG '$' #define PAGENUM '#' #define CURRENTDATE '%' /* define default settings of parameters */ #define PAGEJECT FF /* FF is ASCII formfeed (control-L) */ #define PAGEWIDTH 65 #define PAGELEN 66 /* define return codes and other values */ #define LEFT 1 #define CENTER 2 #define RIGHT 3 #define STARTU 1 /* start underscoring */ #define STOPU 2 /* stop underscoring */ /* these variable were originally local variables * initialized with data statements. */ int cuflag; /* cuflg in text() */ int dir; /* dir in spread() */ int putflag; /* cuflg in put() */ /* temporary buffers -- from common block ctemp */ char tbuf1 [MAXLINE]; /* for use by puttl and tabs */ char tbuf2 [MAXLINE]; char ttl [MAXLINE]; /* misc. line info -- from common block cparam */ int fill; /* flag: fill; init = YES */ int lsval; /* line spacing; init = 1 */ int inval; /* indent; >= 0; init = 0 */ int rmvanumbers greater than 4 are files. These units must always be opened by calling open(). Normally, these units are disk files. However, these units may assign to the files TTY or PRINTER. All I/O assigned to TTY is assigned to unit 3. All I/O assigned to PRINTER is assigned to unit 4. I/O from standard units may be redirected to any file, including TTY and PRINTER. Sys_bufp [unit] != ERR ==> unit is directed to a disk file. Sys_spec [unit] != ERR ==> unit is directed to special file. Otherwise, the unit is closed. */ /* define access modes */ #define READ 1 #define WRITE 2 #define APPEND 3 #define READWRITE 4 /* define standard unit numbers */ #define SYS_STD 5 /* # of standard units */ #define STDIN 0 #define STDOUT 1 #define ERROUT 2 #define STDERR ERROUT #define SYS_TERM 3 #define SYS_PRT 4 /* define reserved filenames */ #define TERMINAL "TTY" /* user's terminal */ #define PRINTER "PRINTER" /* user's printer */ #define MAXOFILES 5 /* max l; /* right margin; init = PAGEWIDTH = 60 */ int tival; /* current temporary indent; init = 0 */ int ceval; /* number of lines to center; init = 0 */ int ulval; /* number of lines to underline; init = 0 */ int boval; /* number of lines to boldface; init = 0 */ char cchar; /* line control character; init = PERIOD */ int tjust [3]; /* justification types for heads and foots */ /* init = LEFT, CENTER, RIGHT */ int bsval; /* number of lines to blank suppress; init=0 */ int rjust; /* flag: right justify filled lines */ /* init = YES */ int cuval; /* number of lines to continuously underline */ /* init = 0 */ int tabs [INSIZE]; /* tab stops; init every 8 spaces */ /* misc. page info -- from common block cpage */ int curpag; /* current output page number; init = 0 */ int newpag; /* next output page number; init = 1 */ int lineno; /* next line to be printed; init = 0 */ int plval; /* page length in lines; init = PAGELEN = 66 */ int m1val; /* margin before and including # of open files */ int sys_bufp [SYS_STD + MAXOFILES]; /* ERR or ^ buffer */ int sys_bufn [SYS_STD + MAXOFILES]; /* buffer number */ int sys_spec [SYS_STD + MAXOFILES]; /* ERR or std unit */ int sys_acc [SYS_STD + MAXOFILES]; /* access mode */ char sys_bufs [MAXOFILES * BUFSIZ]; /* file buffers */ /* software tools format program -- C version -- header file * source: roff.h * version: November 26, 1981. */ /* contains the following common blocks: ctemp cparam cpage cout cnr cfiles cdefio cmac */ /* define PAGECONTROL if you want format to output a * page eject character (CNTRL-L) rather than count * lines to finish off a page. */ /* comment out ----- #define PAGECONTROL 1 ----- end comment out */ /* define size of important data objects */ #define MAXLINE 400 #define MAXDEF 400 #define MAXNAME 400 #define INSIZE 400 #define MAXOUT 400 #define PBSIZE 400header */ int m2val; /* margin after header */ int m3val; /* margin after last text line */ int m4val; /* bottom margin, including footer */ int bottom; /* last live line on page */ /* always equal to plval - m3val - m4val */ char ehead [MAXLINE]; /* top of page title for even pages */ /* init = NEWLINE */ char ohead [MAXLINE]; /* top of page title for odd pages */ int ehlim [2]; /* left,right margins for even header */ /* init = inval, rmval */ int ohlim [2]; /* left,right margins for odd header */ /* init = inval, rmval */ char efoot [MAXLINE]; /* bot of page title for even pages */ /* init = NEWLINE */ char ofoot [MAXLINE]; /* bot of page title for odd pages */ /* init = NEWLINE */ int eflim [2]; /* left,right margins for even footer */ /* init = inval, rmval */ int oflim [2]; /* left,right margins for odd footer */ /* init = inval, rmval */ int stopx; /* flag for pausing between pages */ int frstpg; /* first page to begin printing with */ iys_spec [%d] = %3d\n",i,sys_spec [i]); } } printf("End of test\n"); } /* delarg - delete argument n from the command line */ delarg (n) int n; { /* include common /args/ */ int i; /* check for valid argument number */ if (n < 0 || n > sys_narg) { return; } /* move pointers down */ for (i = n; i < sys_narg; i++) { sys_args [i] = sys_args [i + 1]; } sys_narg--; } /* endst - close all files and terminate the program */ endst() { int i; for (i = 0; i < MAXOFILES + SYS_STD; i++) { close (i); } BDS_exit(); } /* errsub - see if argument is ERROUT substitution * abort if we can not open the file */ BOOL errsub (arg) char arg[]; { int access; if ( arg [0] == '?' && arg [1] != '?' && arg [1] != EOS ) { arg++; access = WRITE; } else if ( arg [0] == '?' && arg [1] == '?' && arg [2] != EOS ) { arg++; arg++; access = APPEND; } else { return(NOnt lastpg; /* last page to be printed */ int print; /* print page flag */ int offset; /* offset whole page by this much */ /* init = 0 */ /* output lines and related info -- from common block cout */ int outp; /* last char position in outbuf; init = 0 */ int outw; /* width of text in outbuf; init = 0 */ int outwds; /* number of words in outbuf; init = 0 */ char outbuf [MAXOUT]; /* lines to be filled collect here */ /* word in outbuf; init=0 */ /* number registers -- from common block cnr */ int nr [26]; /* number registers a..z */ /* list of input files -- from common block cfiles */ int infile [SYS_STD + MAXOFILES]; /* file descriptor stack */ int level; /* current file is infile[level] */ /* pushed-back input characters -- from common block cdefio */ int bp; /* next available character; init = 0 */ char pbbuf [PBSIZE]; /* pushed-back characters */ /* symbol table for macros -- from common block cmac */ char * mactbl; /* symbol table cont); } if (_assign(ERROUT, arg, access) == NO) { /* abort -- no place for error message */ endst(); } return(YES); } /* getarg - return pointer to n'th arg. * this is a change from software tools. */ POINTER getarg (n) int n; { if (n < 1 || n > sys_narg) { return(EOS); } else { return(sys_args [n]); } } /* initst - initialize software tools programs */ initst(argc, argv) int argc; char **argv; { int i; POINTER arg; /* initialize system date */ sys_date [0] = EOS; /* initialize system storage management */ /* dsinit(); */ _allocp = NULL; /* initialize system argument area */ sys_narg = argc - 1; sys_args [0] = NULL; for (i = 1; i < argc; i++) { sys_args [i] = argv [i]; } /* close all disk files */ for (i = 0; i < SYS_STD + MAXOFILES; i++) { sys_bufp [i] = ERR; sys_bufn [i] = ERR; sys_spec [i] = ERR; } /* open the standard units */ sys_spec [STDIN] = SYS_TERM; sys_spec [STDOUT] = aining macros */ /* Command line handling routines for Software Tools * source: args.bds * version: August 23, 1981 */ #include tools.h /* routines on this file: initst endst getarg delarg $ insub $ outsub $ errsub */ /* make BDS calls more visible */ #define BDS_exit _exit /* test routine for initst(), and command handlers */ main(argc, argv) int argc; char **argv; { initst(argc, argv); echo(); endst(); } echo() { int i; int unit; char *p; printf("Test of initst()\n"); for (i = 1; (p = getarg(i)) != NULL; i++) { unit = open(p,READ); printf("file %s is unit = %d\n",p,unit); } for (i = 0; i < SYS_STD + MAXOFILES; i++) { if ( sys_bufp [i] != ERR || sys_spec [i] != ERR || sys_bufn [i] != ERR ) { printf("sys_bufp [%d] = %x ",i,sys_bufp [i]); printf("sys_bufn [%d] = %3d ",i,sys_bufn [i]); printf("sSYS_TERM; sys_spec [ERROUT] = SYS_TERM; sys_spec [SYS_TERM] = SYS_TERM; sys_spec [SYS_PRT] = SYS_PRT; /* pick up file substitutions for standard files */ for (i = 1; (arg = getarg(i)) != NULL; ) { if ( insub (arg) == YES || outsub (arg) == YES || errsub (arg) == YES ) { delarg(i); } else { i++; } } } /* insub - check for STDIN substitution */ BOOL insub (arg) char arg []; { if (arg [0] == '<' && arg [1] != EOS) { arg++; } else { return(NO); } if (_assign(STDIN, arg, READ) == NO) { cant (arg); return(NO); } return(YES); } /* outsub - check for STDOUT substitution */ BOOL outsub (arg) char arg[]; { int access; if ( arg [0] == '>' && arg [1] != '>' && arg [1] != EOS ) { arg++; access = WRITE; } else if ( arg [0] == '>' && arg [1] == '>' && arg [2] != EOS ) { arg++; arg++; access = APPEND; } else { return(NO); }  increment i. * calling sequence: gctoi(str, &i, radix); */ /* comment out ----- gctoi (str, ii, radix) char str[]; int *ii, radix; { int base, i, v, d, j; BOOL neg i = *ii; v = 0; base = radix; while (str[i] == ' ' || str[i] == TAB) { i++; } neg = (str[i] == '-'); if (str[i] == '+' || str[i] == '-') { i++; } if ( ( str[i+2] == 'r' && str[i] == '1' && IS_DIGIT(str[i+1])) || ( str[i+1] == 'r' && IS_DIGIT(str[i]) ) { base = str[i] - '0'; j = i; if (str (i + 1) != 'r') { j++; base = base * 10 + (str[j] - '0') } if (base < 2 | base > 16) { base = radix; } else { i = j + 2; } } for (; str[i] != EOS; i++) { if (IS_DIGIT(str[i])) { d = str[i] - '0' } else { d = index (digits, clower (str[i])) - 1; if (d < 0 || d >= base) { break; } v = v * base + d } *ii = i; if (neg) { return (-v); } else { return (+v); } } ----- if (_assign(STDOUT, arg, access) == NO) { cant (arg); return(NO); } return(YES); } /* Conversion routines for Software Tools * source: convert.bds * version: July 28, 1981 */ #include tools.h /* ctoi - convert string at in[i] to int, increment *i. * increment i. * calling sequence: ctoi(buffer, &i); */ ctoi(in, i) char *in; int *i; { while (in[*i] == ' ' || in[*i] == TAB) { (*i)++; } /* note: i still points at beginning of number */ return(atoi(in + *i)); } /* ctomn - translate ASCII control char to mnemonic string */ /* comment out ----- ctomn (c, rep) char c, rep[4] { int i; char *s; i = c & 127; if (0 <= i && i <= 32) { /* non-printing char or space */ switch(i) { case 0: s = "NUL"; break; case 1: s = "SOH"; break; case 2: s = "STX"; break; case 3: s = "ETX"; break; case 4: s = "EOT"; break; case 5: s = "ENG"; break; case 6: s = "ACK"; break; case end comment out */ /* gitoc - convert single precision int to any radix string * */ /* comment out ----- gitoc (int, str, size, base) int int, size, base; char str [size]; { int carry, d, i, radix, n; int value; logical unsign; /* digit string is generated backwards, then reversed */ str[1] = EOS; if (size <= 1) { return[0]; } radix = abs(base); if (radix < 2 || radix > 16) { radix = 10; } /* negative radices mean unsign conversion */ unsign = (base < 0); if (unsign) { /* make positive, but keep high-order bits intact */ n = (int / 2) & (MAX_INTERGER); carry = int & 1; /* get initial carry */ } else { n = int; } i = 1; repeat { d = abs (n % radix); /* generate next digit */ if (unsign) { /* this is only half of actual digit value */ d = 2 * d + carry /* get actual digit value */ if (d >= radix) { /* check for generated carry */ d -= radix carry = 1 } else { carry =  7: s = "BEL"; break; case 8: s = "BS"; break; case 9: s = "HT"; break; case 10: s = "LF"; break; case 11: s = "VT"; break; case 12: s = "FF"; break; case 13: s = "CR"; break; case 14: s = "SO"; break; case 15: s = "SI"; break; case 16: s = "DLE"; break; case 17: s = "DC1"; break; case 18: s = "DC2"; break; case 19: s = "DC3"; break; case 20: s = "DC4"; break; case 21: s = "NAK"; break; case 22: s = "SYN"; break; case 23: s = "ETB"; break; case 24: s = "CAN"; break; case 25: s = "EM"; break; case 26: s = "SUB"; break; case 27: s = "ESC"; break; case 28: s = "FS"; break; case 29: s = "GS"; break; case 30: s = "RS"; break; case 31: s = "VS"; break; } scopy (s, 1, rep, 1); } else if (i == 127) { /* rubout (DEL) */ scopy ("DEL", 1, rep, 1); } else { /* printing character */ rep[1] = c; rep[2] = EOS; } return (length (rep)); } ----- end comment out */ /* gctoi - convert any radix string to single precision int * 0 } } i++; if (str[i] < 10) { str[i] += '0'; } else { str[i] += 'A' - 10; } n /= radix } until (n == 0 || i >= size); if (unsign) { if (carry != 0 & i < size) { /* check for final carry */ i++; str[i] = '1'; } } else if (int < 0 && i < size) { /* add sign if needed */ i++; str[i] = '-'; } value = i - 1; /* will return length of string */ for (d = 1; d < i; d++) { /* reverse digits */ carry = str[d]; str[d] = str[i]; str[i] = carry; i--; } return (value); } ----- end comment out */ /* mntoc - translate ASCII mnemonic into a char */ /* comment out ----- char mntoc (buf, p, default) char buf[], default int p int i, tp int equal char c, tmp (MAXLINE) char text (170) data text / _ ACK, LETA, LETC, LETK, EOS, BEL, LETB, LETE, LETL, EOS, BS, LETB, LETS, EOS, EOS, CAN, LETC, LETA, LETN, EOS, CR, LETC, LETR, EOS, EOS, DC1, LETD, LETC, DIG1, EOS, DC2, LETD, LETg in str */ itoc (n, str, size) int n, size; char *str; { int l; sprintf(str, "%d", n); if ((l = length(str)) >= size) { sys_error("itoc\n"); } return(l); } /* comment out ---------- int d, i, intval, j, k; intval = abs (n); str [0] = EOS for (i = 1;intval == 0 || i > size - 2;i++) { i++; str [i] = '0' + (intval % 10); intval = intval / 10; } if (n < 0 && i < size) { /* then sign */ i = i + 1 str (i) = MINUS } itoc = i - 1 for (j = 1; j < i; j = j + 1) { /* then reverse */ k = str (i) str (i) = str (j) str (j) = k i = i - 1 } } ----- end comment out */ Truncate after len chars */ ctoc (from, to, len) int len; char *from, *to; { int i; for (i = 0/* file copy routine -- test * source: copy.bds * version: July 22, 1981 */ #include tools.h main(argc, argv) int argc; char **argv; { initst(argc, argv); fcopy(STDIN, STDOUT); endst(); } flusMgetliNputdeTitoUputVreadC, DIG2, EOS, DC3, LETD, LETC, DIG3, EOS, DC4, LETD, LETC, DIG4, EOS, DEL, LETD, LETE, LETL, EOS, DLE, LETD, LETL, LETE, EOS, EM, LETE, LETM, EOS, EOS, ENQ, LETE, LETN, LETQ, EOS, EOT, LETE, LETO, LETT, EOS, ESC, LETE, LETS, LETC, EOS, ETB, LETE, LETT, LETB, EOS, ETX, LETE, LETT, LETX, EOS, FF, LETF, LETF, EOS, EOS, FS, LETF, LETS, EOS, EOS, GS, LETG, LETS, EOS, EOS, HT, LETH, LETT, EOS, EOS, LF, LETL, LETF, EOS, EOS, NAK, LETN, LETA, LETK, EOS, NUL, LETN, LETU, LETL, EOS, RS, LETR, LETS, EOS, EOS, SI, LETS, LETI, EOS, EOS, SO, LETS, LETO, EOS, EOS, SOH, LETS, LETO, LETH, EOS, SP, LETS, LETP, EOS, EOS, STX, LETS, LETT, LETX, EOS, SUB, LETS, LETU, LETB, EOS, SYN, LETS, LETY, LETN, EOS, US, LETU, LETS, EOS, EOS, VT, LETV, LETT, EOS, EOS/ tp = 1 repeat { tmp (tp) = buf[p] tp = tp + 1 p++ } until (! (IS_LETTER(buf[p]) | IS_DIGIT(buf[p])) | tp >= MAXLINE) tmp (tp) = EOS if (tp == /* Time and date routines for Software Tools * source: date.bds * version: August 22, 1981 */ #include tools.h /* fmtdat - format date and time information into date * form is reserved for a format selector. * time is a scratch buffer */ fmtdat (date, time, now, form) char *date, *time, *now; int form; { /* copy now to date. do not copy newline */ while (*now != NEWLINE && *now != EOS) { *date++ = *now++; } *date = EOS; /* comment out ----- format date and time date [0] = now [1] / 10 + '0'; date [1] = now [1] % 10 + '0'; date [2] = '/'; date [3] = now [2] / 10 + '0'; date [4] = now [2] % 10 + '0'; date [5] = '/'; date [6] = now [0] % 100 / 10 + '0'; date [7] = now [0] % 10 + '0'; date [8] = EOS; time [0] = now [3] / 10 + '0'; time [1] = now [3] % 10 + '0'; time [2] = '/'; time [3] = now [4] / 10 + '0'; time [4] = now [4] % 10 + '0'; time [5] = ':'; time [6] = now [5] / 10 + '0'; time [7] = now [5] % 10 + '0'2) c = tmp[1] else { lower (tmp) for (i = 1; i < 170; i = i + 5) /* should use binary search here */ if (equal (tmp, text (i + 1)) == YES) break if (i < 170) c = text[i] else c = default } return[c] } ----- end comment out */ /* upper - fold all alphas to upper case */ upper (token) char *token; { int i; for (i = 0; token[i] != EOS; i++) { token[i] = toupper(token[i]); } } /* lower - fold all letters to lower case */ lower (token) char *token; { int i; for (i = 0; token [i] != EOS; i++) { token [i] = tolower(token [i]); } } /* ctoc - copy the from string. Truncate after len chars */ ctoc (from, to, len) int len; char *from, *to; { int i; for (i = 0; i < len && from [i] != EOS; i++) { to [i] = from [i]; } to [i] = EOS; return (i); } /* fold - fold all letters in a string to lower case */ fold (token) char *token; { lower (token); } /* itoc - convert int int to char strin; time [8] = EOS; ----- end comment out */ } /* getnow - return pointer to current time and date */ char * getnow () { if (sys_date [0] == EOS) { putlin("\nEnter date: \n", SYS_TERM); getlin(sys_date, SYS_TERM); if (sys_date [0] == EOS) { sys_date [0] == ' '; sys_date [1] == EOS; } } return(sys_date); /* comment out ----- set now [], date [] now [0] = 1981; /* the year */ now [1] = 1; /* the month */ now [2] = 1; /* the day */ now [3] = 23; /* the hour (24-hour clock) */ now [4] = 59; /* the minute of the hour */ now [5] = 59; /* the second of the minute */ now [6] = 999; /* the millisecond */ ----- end comment out */ } /* wkday - get day-of-week corresponding to month,day,year */ int wkday (month, day, year) int month, day, year; { month = month - 2; if (month <= 0) { month = month + 12; year--; } return ( ((day + (26 * month - 2) /10 +year +year/4 -34) % 7)+ 1 ); }  /* _chkacc - check access parameter */ BOOL _chkacc(access) int access; { if (access == READ || access == WRITE) { return (YES); } if (access == READWRITE) { error("READWRITE access not supported\n"); } else if (access == APPEND) { error("APPEND access not supported\n"); } else { printf("access = %d\n",access); error("unknown file access type\n"); } return(NO); } /* _getunit - return an available file unit number */ int _getunit() { int i, j; /* search sys_bufn [] for unit i */ for (i = SYS_STD; i < MAXOFILES + MAXOFILES; i++) { if (sys_spec [i] != ERR) { continue; } for (j = 0; j < SYS_STD + MAXOFILES; j++) { if (sys_bufn [j] == i) { /* buffer i in use */ break; } } if (j == SYS_STD + MAXOFILES) { /* free buffer found */ return(i); } } return(ERR); } /* _open1 - internal open routine */ BOOL _open1(unit, filename, access) int unit; char *filename; int access; { FILEDES fd; int /* echo command line arguments * source: echo.bds * version: July 17, 1981 */ /* echo - echo command line arguments */ # include symbol definitions DRIVER(echo) integer i integer getarg character buf (MAXARG) call query ("usage: echo [args].") for (i = 1; getarg (i, buf, MAXARG) != EOF; i = i + 1) { if (i != 1) call putch (BLANK, STDOUT) call putlin (buf, STDOUT) } if (i != 1) call putch (NEWLINE, STDOUT) } /* I/O routines and primitives for software tools * source: newfile.bds * version: November 25, 1981 * * This file is the version of August 9, 1981 * put in alphabetical order. */ #include tools.h /* make the calls to buffered BDS routines more visible */ #define BDS_fclose _fclose #define BDS_fcreat _fcreat #define BDS_fflush _fflush #define BDS_fopen _fopen #define BDS_getc _getc #define BDS_gets _gets #define BDS_gchar _getchar #define BDS_fopen diskunit; char *iobuf; if (unit < 0 || unit >= SYS_STD + MAXOFILES) { sys_error("_open1: bad unit\n"); } /* fill in access mode */ if (_chkacc(access) == NO) { return(NO); } else { sys_acc [unit] = access; } /* check for special files */ if (equal (filename, TERMINAL)) { sys_spec [unit] = SYS_TERM; return(YES); } else if (equal (filename, PRINTER)) { if (access == READ) { return(NO); } else { sys_spec [unit] = SYS_PRT; return(YES); } } if (unit < SYS_STD) { /* find a disk file slot */ if ((diskunit = _getunit()) == ERR) { return(NO); } } else { diskunit = unit; } iobuf = sys_bufs + ((diskunit - SYS_STD) * BUFSIZ); if (access == READ) { fd = BDS_fopen(filename, iobuf); if (fd == ERR) { return(NO); } else { /* open system tables */ sys_bufp [unit] = iobuf; sys_bufn [unit] = diskunit; return(YES); } } if (access == WRITE) { /* erase the file if it exists ! */ fd = _fopen #define BDS_putc _putc #define BDS_pchar _putchar #define BDS_rename _rename #define BDS_unlink _unlink /* This file contains: _assign _chkacc _getunit _open1 close creat fcopy flush getc getch getch1 getlin isatty mkuniq note open prompt putc putch putch1 putdec putint putlin putstr readf remove rename seek writef */ /* _assign - open a file for STDIN, STDOUT, or ERROUT * redirect I/O to that file. */ BOOL _assign(unit, filename, access) int unit; char *filename; int access; { BOOL _open1(); if (unit < 0 || unit >= SYS_STD) { sys_error("_assign\n"); } if (access == READ && unit != STDIN) { return(NO); } if (access == WRITE && unit == STDIN) { return(NO); } /* open the unit */ if (_open1(unit, filename, access) == NO) { return(NO); } /* comment out ----- printf("assign: unit = %d name = %s\n",unit,filename); ----- end comment out */ return(YES); } BDS_fcreat (filename, iobuf); if (fd == ERR) { return(NO); } else { /* open system tables */ sys_bufp [unit] = iobuf; sys_bufn [unit] = diskunit; return(YES); } } /* unknown access */ return(NO); } /* close - close unit */ close (unit) int unit; { if (unit < 0 || unit >= SYS_STD + MAXOFILES) { return; } else if (sys_spec [unit] != ERR) { if ( unit == STDIN || unit == STDOUT || unit == ERROUT ) { sys_spec [unit] = SYS_TERM; } else { sys_spec [unit] = ERR; } } if (sys_bufp [unit] == ERR) { return; } /* write end of file mark and flush for output files */ if (sys_acc [unit] != READ) { putch (CPMEOF, unit); flush (unit); } /* close the file */ BDS_fclose(sys_bufp [unit]); sys_bufp [unit] = ERR; sys_bufn [unit] = ERR; } /* create - create a clean file * erase it if it exists. */ int create (filename, access) char *filename; int access; { int ue [0] == (CPMEOF & 0xff)) { return(EOF); } for (i = 0; line [i] != EOS; i++) { ; } return (i); } for (i = 0; i < MAXLINE - 1; i++) { c = getch(unit); if (c == EOF) { line [i] = EOS; return (EOF); } else if (c == NEWLINE) { line [i] = c; line [i + 1] = EOS; return (i); } else { line [i] = c; } } line [MAXLINE-1] = EOS; return (MAXLINE); } /* isatty - determine if file is a teletype/CRT device */ BOOL isatty (unit) int unit; { int type; if (sys_bufp [unit] != ERR) { /* disk file */ return(NO); } else if (sys_spec [unit] != ERR) { /* special file */ return(YES); } else { /* unit not open */ return(NO); } } /* mkuniq - make a scratch file name based on 'seed' */ mkuniq (seed, name) char seed[], name[]; { /* name is $$A.$$$ through $$Z.$$$ */ scopy ("$$", 0, name, 0); name [2] = seed + 'A'; scopy (".$$$", 0, name, 3); } /* note - determine current file position */ notenit; BOOL _open1(); if (access != WRITE) { error("in create: bad access mode\n"); } if ((unit = _getunit()) == ERR) { return(ERR); } if (_open1(unit, filename, WRITE) == NO) { return(ERR); } else { return(unit); } } /* fcopy - copy file in to file out */ fcopy (in, out) int in, out; { char line [MAXLINE]; while (getlin (line, in) != EOF) { putlin (line, out); } } /* flush - flush file's output buffer */ flush (unit) int unit; { if (unit < 0 || unit >= SYS_STD + MAXOFILES) { error("flush: bad unit\n"); } if (sys_bufp [unit] == ERR) { return; } /* flush buffer */ if (sys_acc [unit] != READ) { BDS_fflush(sys_bufp [unit]); } } /* getc - get char from STDIN */ int getc(c) char c; { return(getch(STDIN)); } /* getch - get a character from a file * return the character and set c to character. * Note: this is a change from Software Tools */ int getch (unit) int unit; { in (unit, offset) int unit; int offset[2]; { error("note() not implemented\n"); } /* open - open a file */ int open (filename, access) char *filename; int access; { int unit; BOOL _open1(); /* get an available file number */ if ((unit = _getunit()) == ERR) { return(ERR); } /* open the file */ if (_open1(unit, filename, access) == NO) { return(ERR); } else { return(unit); } } /* prompt - write to/read from teletype */ prompt (str, buf, unit) char *str, *buf; int unit; { int i; if (isatty(unit) == YES) { putlin (str, unit); flush (unit); } getlin (buf, unit); } /* putc - put char c onto STDOUT * return c */ int putc (c) char c; { return (putch (c, STDOUT)); } /* putch - put char 'c' to a file * return 'c' */ int putch (c, unit) { /* check unit once here */ if (unit < 0 || unit >= SYS_STD + MAXOFILES) { error("in putch: bad unit\n"); } /* add carriage returns before LF (NEt c; /* check unit once here */ if (unit < 0 || unit >= SYS_STD + MAXOFILES) { error("in getch: bad unit\n"); } /* ignore all carriage returns */ while ((c = getch1(unit)) == CR) { ; } return(c); } int getch1 (unit) int unit; { int c; if (sys_bufp [unit] != ERR) { c = BDS_getc(sys_bufp [unit]); if (c == CPMEOF) { return(EOF); } else { return(c); } } else if (sys_spec [unit] == SYS_TERM) { c = BDS_gchar(); if (c == CPMEOF) { return(EOF); } else { return(c); } } else { error("getch: unit not open\n"); } } /* getlin - get a line from a unit * return number of chars in the line. */ int getlin (line, unit) char *line; int unit; { int i; int c; if (unit < 0 || unit >= SYS_STD + MAXOFILES) { error("getlin: bad unit\n"); } if ( sys_bufp [unit] == ERR && sys_spec [unit] == SYS_TERM ) { /* allow delete char & line functions */ BDS_gets(line); if (linWLINE) */ if (c == NEWLINE) { putch1 (CR, unit); } return(putch1 (c, unit)); } int putch1 (c, unit) char c; int unit; { if (sys_bufp [unit] != ERR) { return(BDS_putc(c, sys_bufp [unit])); } else if (sys_spec [unit] == SYS_TERM) { return(BDS_pchar(c)); } else if (sys_spec [unit] == SYS_PRT) { bdos(5,c); return(c); } else { error("in putch: unit not open\n"); } } /* putdec - put decimal int n in field width >= w */ putdec(n,w) int n, w; { char chars [MAXCHARS]; int i, nd; nd = itoc (n, chars, MAXCHARS); for (i = nd; i < w; i++) { putc (' '); } for (i = 0; i < nd; i++) { putc (chars[i]); } } /* putint - output int in specified field */ putint (n, w, unit) int n, w; int unit; { char chars [MAXCHARS]; itoc (n, chars, MAXCHARS); putstr (chars, w, unit); } /* putlin - output a line to a unit */ putlin (line, unit) char *line; int unit; { int i; for (i = 0; line [i] != EOS; i++) { putch (line in: "); remark (line); _exit(); } /* remark - print error message and continue */ remark(line) char *line; { putlin (line, ERROUT); } ontinue */ remark(line) char *line; { putlin (line, ERROUT); } ) { return(ERR); } /* Pattern and set routines for Software Tools * source: pattern.bds * version: November 26, 1981 */ /* note: only addstr() and addset are translated and debugged */ #include tools.h /* addstr - add s to str[j] if it fits, increment j */ addstr (s, str, j, maxsiz) char *s, *str; int *j, maxsiz; { int i; for (i = 0; s[i] != EOS; i++) { if (addset (s[i], str, j, maxsiz) == NO) { return(NO); } } return(YES); } /* comment out ---------- /* catsub - add replacement text to end of new */ catsub (lin, from, to, sub, new, k, maxnew) char *lin; int from [10], to [10]; char *sub, *new; int k, maxnew; { int i, j, ri; for (i = 0; sub[i] != EOS; i++) { if (sub[i] == DITTO) { i++; ri = [i], unit); } } /* putstr - output char string in specified field */ putstr (str, w, unit) char *str; int w; int unit; { int i, len; len = length (str); /* output leading blanks blanks */ for (i = len; i < w; i++) { putch (' ', unit); } /* output string */ for (i = 0; i < len; i++) { putch (str [i], unit); } /* output trailing blanks */ for (i = (-w) - len; i > 0; i--) { putch (' ', unit); } } /* readf - read 'n' bytes/words/whatever from file fd */ readf (buf, n, unit) char *buf; int n; int unit; { int i; for (i = 0; i < n; i++) { if ((buf [i] = getch(unit)) == EOF) { buf[i] = EOS; return (EOF); } } buf[i] = EOS; return (i); } /* remove - remove a file from the file system */ BOOL remove (filename) char *filename; { return (BDS_unlink(filename)); } /* rename - change old file name to new file name */ BOOL rename (old, new) char *old, *new; { BDS_rename(old, new); return(OK); } /* writef - w sub[i] + 1; for (j = from [ri]; j < to [ri]; j++) { addset (lin[j], new, k, maxnew); } } else { addset (sub[i], new, k, maxnew); } } } /* getpat - convert str into pattern */ getpat (str, pat) char *str, *pat; { return (makpat (str, 1, EOS, pat)); } /* maksub - make substitution string in sub */ maksub (arg, from, delim, sub) char *arg; int from; char delim; char *sub; { int i, j; j = 1; for (i = from; arg[i] != delim && arg[i] != EOS; i++) { if (arg[i] == AND) { addset (DITTO, sub, j, MAXPAT); addset (0, sub, j, MAXPAT); } else if ( arg[i] == ESCAPE && type(arg[i + 1]) == DIGIT ) { i++ addset (DITTO, sub, j, MAXPAT); addset (arg[i] - DIG0, sub, j, MAXPAT); } else { addset (esc (arg, i), sub, j, MAXPAT); } } if (arg[i] != delim) { /* missing delimiter */ return(ERR); } else if (addset (EOS, sub, j, MAXPAT) == NO) { /* no room */ return(ERR); } else { rrite 'n' bytes/words/whatever to file */ writef (buf, n, unit) char *buf; int n; int unit; { int i; for (i = 0; i < n; i++) { if (buf[i] == EOS) { break; } putch (buf[i], unit); } return (i); } /* Miscellaneous routines for Software Tools * source: misc.bds * version: July 26, 1981 */ #include tools.h /* routines on this file: cant error query */ /* query - print usage message if user has typed '?' */ query (mesg) char *mesg; { char *p; p = getarg(1); if ( p [0] == '?' && p [1] == EOS) { error (mesg); } } /* cant - print "file: can't open" and terminate execution */ cant (file) char *file; { putlin ("Can't open: ", ERROUT); putlin (file, ERROUT); endst(); } /* error - print message and terminate execution */ error (line) char *line; { remark (line); endst(); } /* system error - don't try to close files ! */ sys_error (line) char *line; { remark ("System erroreturn(i); } } /* makpat --- make pattern from arg (from) * terminate at delim */ int makpat (arg, from, delim, pat) char *arg; int from; char delim; char *pat; { int i, j, lastcl, lastj, lj; int tagnst, tagnum, tagstk[9]; /* pat index */ j = 1; lastj = 1; lastcl = 0; tagnum = 0; tagnst = 0; for (i = from; arg[i] != delim && arg[i] != EOS; i++) { lj = j; if (arg[i] == ANY) { addset (ANY, pat, j, MAXPAT); } else if (arg[i] == BOL & i == from) { addset (BOL, pat, j, MAXPAT); } else if (arg[i] == EOL & arg (i + 1) == delim){ addset (EOL, pat, j, MAXPAT); } else if (arg[i] == CCL) { if (getccl (arg, i, pat, j) == ERR) { return (ERR); } } else if (arg[i] == CLOSURE & i > from) { lj = lastj; if ( pat (lj) == BOL || pat (lj) == EOL || pat (lj) == CLOSURE || pat (lj) == START_TAG || pat (lj) == STOP_TAG ) { break; } lastcl = stclos(pat, j, lastj, l if (pat [n] == CHAR | pat [n] == START_TAG | pat [n] == STOP_TAG) patsiz = 2 else if (pat [n] == BOL | pat [n] == EOL | pat [n] == ANY) patsiz = 1 else if (pat [n] == CCL | pat [n] == NCCL) patsiz = pat (n + 1) + 2 else if (pat [n] == CLOSURE) /* optional */ patsiz = CLOSIZE else error ("in patsiz: can't happen.") return } /* filset --- expand set at array [i] into set [j], * stop at delim. */ filset (delim, array, i, set, j, maxset) char delim; char *array; int i; char *set; int *j; int maxset; { string digits "0123456789" string lowalf "abcdefghijklmnopqrstuvwxyz" string upalf "ABCDEFGHIJKLMNOPQRSTUVWXYZ" for ( ; array [i] != delim && array [i] != EOS; i++) { if (array [i] == ESCAPE) { addset (esc(array,i), set, *j, maxset); } else if (array [i] != DASH) { addset (array [i], set, j, maxset); } else if (j <= 1 | array (i + 1) == EOS) { /* literal - */ addset (DASH, set, j, maxset); } else if astcl); } else if (arg[i] == START_TAG) { if (tagnum >= 9) { /* too many tagged sub-patterns */ break; } tagnum++; tagnst++; tagstk [tagnst] = tagnum; addset (START_TAG, pat, j, MAXPAT); addset (tagnum, pat, j, MAXPAT); } else if (arg[i] == STOP_TAG & tagnst > 0) { addset (STOP_TAG, pat, j, MAXPAT); addset(tagstk[tagnst], pat, j, MAXPAT); tagnst--; } else { addset (CHAR, pat, j, MAXPAT); addset (esc (arg, i), pat, j, MAXPAT); } lastj = lj; } if (arg[i] != delim) { /* terminated early */ return(ERR); } else if (addset (EOS, pat, j, MAXPAT) == NO) { /* no room */ return(ERR); } else if (tagnst != 0) { return(ERR); } else { return(i); } } /* stclos --- insert closure entry at pat [j] */ stclos (pat, j, lastj, lastcl) char pat (MAXPAT) int j, lastj, lastcl { int addset int jp, jt, junk for (jp = j - 1; jp >= lastj; jp = jp - 1) { /* make a hole */ jt = jp + CLOSIZE (index (digits, set (j - 1)) > 0) { dodash (digits,array,i,set,j,maxset); } else if (index (lowalf, set (j - 1)) > 0) dodash (lowalf,array,i,set,j,maxset); } else if (index (upalf, set (j - 1)) > 0) { dodash (upalf,array,i,set,j,maxset); } else { addset (DASH, set, j, maxset); } } } /* locate --- look for c in char class at pat (offset) */ int locate (c, pat, offset) char c; char *pat; int offset; { int i /* size of class is at pat (offset), chars follow */ for (i = offset + pat [offset]; i > offset; i--) { if (c == pat [i]) { return (YES); } } return (NO) } /* dodash - expand array (i-1)-array (i+1 * into set [j]... from valid */ subroutine dodash (valid, array, i, set, j, maxset) int i, j, maxset char valid (ARB), array (ARB), set (maxset) char esc int junk, k, limit int addset, index i = i + 1 j = j - 1 limit = index (valid, esc (array, i)) for (k = index (valid, set [j]); k <= limit; k junk = addset (pat (jp), pat, jt, MAXPAT) } j = j + CLOSIZE stclos = lastj /* put closure in it */ junk = addset (CLOSURE, pat, lastj, MAXPAT) /* COUNT */ junk = addset (0, pat, lastj, MAXPAT) /* PREVCL */ junk = addset (lastcl, pat, lastj, MAXPAT) /* START */ junk = addset (0, pat, lastj, MAXPAT) return } /* getccl --- expand char class at arg [i] into pat [j] */ getccl (arg, i, pat, j) char arg (MAXARG), pat (MAXPAT) int i, j { int jstart, junk int addset i = i + 1 /* skip over [ */ if (arg [i] == NOT) { junk = addset (NCCL, pat, j, MAXPAT) i = i + 1 } else junk = addset (CCL, pat, j, MAXPAT) jstart = j /* leave room for count */ junk = addset (0, pat, j, MAXPAT) filset (CCLEND, arg, i, pat, j, MAXPAT) pat (jstart) = j - jstart - 1 if (arg [i] == CCLEND) getccl = OK else getccl = ERR return } /* patsiz --- returns size of pattern entry at pat [n] */ int function patsiz (pat, n) char pat (MAXPAT) int n = k + 1) junk = addset (valid [k], set, j, maxset) return } ---------- end comment out */ /* addset - put c in string [j] if it fits, increment j * * calling sequence: addset (c, str, &j, maxsiz); */ BOOL addset (c, str, j, maxsiz) char c; char *str; int *j; int maxsiz; { if (*j >= maxsiz) { return(NO); } else { str[(*j)++] = c; return(YES); } } /* comment out ---------- /* esc - map array [i] into escaped char if appropriate */ char esc (array, i) char *array; int i; if (array [i] != ESCAPE) { return(array [i]); } else if (array (i+1) == EOS) { /* @ not special at end */ return(ESCAPE); } else { i++; if ( array [i] == 'n' || array [i] == 'N') { return(NEWLINE); } else if (array [i] == 't' || array [i] == 'T'){ return(TAB); } else { return(array [i]); } } } /* match --- find match anywhere on line */ match (lin, pat) char *lin, *pat; { int i, junk[9] for (i = 0;  0; } } else if (pat [j] == ANY) { if (lin [i] != NEWLINE) { bump = 1; } } else if (pat [j] == EOL) { if (lin [i] == NEWLINE) { bump = 0; } } else if (pat [j] == CCL) { if (locate (lin [i], pat, j + 1) == YES) { bump = 1; } } else if (pat [j] == NCCL) { if ( lin [i] != NEWLINE && locate (lin [i], pat, j + 1) == NO ) { bump = 1; } } else { error ("in omatch: can't happen."); } if (bump >= 0) { *i += bump; return(YES); } else { return(NO); } } ---------- end comment out */ /* BDS C program to convert from RATFOR to C style comments * source: rat2c.bds * version: May 21, 1981. */ /* define globals */ #include bdscio.h #define YES 1 #define NO 0 #define EOS 0 #define CR 13 #define LF 10 #define VERSION "ver: May 21, 1981" #define SIGNON "Welcome to RAT4 to C comment converter. " int input; int output; char buffer[lin[i] != EOS; i++) { if (amatch (lin, i, pat, junk, junk) > 0) { return(YES); } } return(NO); } /* amatch --- (non-recursive) look for match * starting at lin (from) */ amatch (lin, from, pat, tagbeg, tagend) char lin (MAXLINE), pat (MAXPAT) int from, tagbeg (10), tagend (10) { int i, j, offset, stack; for (i = 1; i <= 10; i = i + 1) { tagbeg [i] = 0; tagend [i] = 0; } tagbeg [1] = from; stack = 0; offset = from; /* next unexamined input char */ for (j = 1; pat [j] != EOS; j = j + patsiz (pat, j)) { if (pat [j] == CLOSURE) { /* a closure entry */ stack = j /* step over closure */ j += CLOSIZE for (i = offset; lin [i] != EOS; ) { /* match as many as possible */ if (omatch(lin,i,pat,j) == NO){ break; } } pat (stack + COUNT) = i - offset; pat (stack + START) = offset; /* char that made us fail */ offset = i; } else if (pat [j] == START_TAG) { i = pat (j + 1); 100]; /* general buffer */ char inbuf[BUFSIZ]; /* input file buffer */ char outbuf[BUFSIZ]; /* output file buffer */ /* convert one file after another interactively */ main() { /* sign on */ puts(SIGNON); puts(VERSION); ccrlf(); /* mark files as closed */ input = -1; output = -1; while (1) { if (openio() == NO) { closeio(); break; } convert(); closeio(); } puts("End of comment converter"); ccrlf(); } /* open an input and output file. * the input file must exist. * the output file must not exist. * return NO if the user gives up by entering a null file name. */ openio() { if (openin() == NO) { return(NO); } else { return(openout()); } } /* open the input file, which must exist. * keep trying until the file is open or the user gives up. */ openin() { while (1) { ccrlf(); puts("input file ? "); gets(buffer); if (buffer[0] == EOS) { return(NO); } input = fopen (buffer,inbuf); if (input == -1 tagbeg (i + 1) = offset; } else if (pat [j] == STOP_TAG) { i = pat (j + 1) tagend (i + 1) = offset } else if (omatch (lin, offset, pat, j) == NO) { /* non-closure */ for ( ; stack > 0; stack = pat (stack + PREVCL)) if (pat (stack + COUNT) > 0) break if (stack <= 0) { /* stack is empty */ amatch = 0 /* return failure */ return } pat (stack + COUNT) = pat (stack + COUNT) - 1 j = stack + CLOSIZE offset = pat (stack + START) + pat (stack + COUNT) } } /* else omatch succeeded */ amatch = offset; tagend [1] = offset; return; /* success */ } /* omatch --- try to match a single pattern at pat [j] * increment i. */ BOOL omatch (lin, i, pat, j) char *line; int *i; char *pat; int j; { int bump; if (lin [i] == EOS) { return(NO); } bump = -1; if (pat [j] == CHAR) { if (lin [i] == pat [j + 1]) { bump = 1; } } else if (pat [j] == BOL) { if (i == 1) { bump =) { ccrlf(); puts("file not found"); } else { return(YES); } } } /* open the output file, which must not exist. * keep trying until the file is open or the user gives up. */ openout() { while (1) { ccrlf(); puts("Output file ? "); gets(buffer); if (buffer[0] == EOS) { return(NO); } /* make sure the file does not exist */ output = fopen(buffer,outbuf); if (output != -1) { ccrlf(); puts("File exists"); fclose(outbuf); continue; } output = fcreat(buffer,outbuf); if (output == -1) { ccrlf(); puts("disk error"); } else { return(YES); } } } /* close any open files */ closeio() { if (input != -1) { fclose(inbuf); } if (output != -1) { fflush(outbuf); fclose(outbuf); } } /* copy input file to output file. * convert everything following a '#' on a line into * a C style comment. */ convert() { /* copy one line at a time */ while (do1line() == NO) { ; } } ; } else { /* open for writing */ return(BDS_open(filename,1)); } } /* The following routines came from STDLIB1.C They all use this stucture: #define NSECTS 8 Number of sectors to buffer in ram note: (NSECTS * SECSIZ + 6) = sizeof(struct_buf) #define BUFSIZ (NSECTS * SECSIZ + 6 ) Don't touch this struct _buf { Or this... int _fd; returned by BDS_open int _nleft; char *_nextp; char _buff[NSECTS * SECSIZ]; }; */ int _fopen(filename,iobuf) struct _buf *iobuf; char *filename; { if ((iobuf -> _fd = BDS_open(filename,0)) < 0) { return(ERROR); } iobuf -> _nleft = 0; return iobuf -> _fd; } int _getc (iobuf) struct _buf *iobuf; { int nsecs; /* comment out ----- if (iobuf == 0) return getchar(); if (iobuf == 3) return bdos(3); ----- end comment out */ if (iobuf -> _nleft--) { return *iobuf -> _nextp++; } nsecs = BDS_read(iobuf -> _fd, iobuf -> _buff, NSECTS); if (nsecs <= 0) { return iobuf -> _nleft++; }  /* copy one line from input file to output file. * return YES if end of file has been seen. */ do1line() { int c; /* the current character */ int comflag; /* YES means in comment */ /* start off each line not in a comment */ comflag=NO; while (1) { /* get next character from input */ c = getc(inbuf); if ( (c == -1) || (c == 0x1a) ) { /* end of file */ if (comflag == YES) { /* finish comment */ putc(' ',outbuf); putc('*',outbuf); putc('/',outbuf); } /* output end of file mark */ putc(0x01a,outbuf); return(YES); } else if ((comflag == NO) & (c == '#') ) { /* start of comment */ comflag = YES; putc('/',outbuf); putc('*',outbuf); putc(' ',outbuf); } else if (c == CR) { /* end line. assume LF will follow */ c = getc(inbuf); if (comflag == YES) { /* finish comment */ putc(' ',outbuf); putc('*',outbuf); putc('/',outbuf); } /* finish line */ putc(CR,outbuf); p iobuf -> _nleft = nsecs * SECSIZ - 1; iobuf -> _nextp = iobuf -> _buff; return *iobuf->_nextp++; } int _fcreat(name,iobuf) char *name; struct _buf *iobuf; { if ((iobuf -> _fd = BDS_creat(name)) < 0 ) { return ERROR; } iobuf -> _nextp = iobuf -> _buff; iobuf -> _nleft = (NSECTS * SECSIZ); return iobuf -> _fd; } int _putc (c,iobuf) char c; struct _buf *iobuf; { int nsecs; /* comment out ----- if (iobuf == 1) return putchar(c); if (iobuf == 2) return (bdos(5,c)); if (iobuf == 3) return (bdos(4,c)); ----- end comment out */ if (iobuf -> _nleft--) { return *iobuf -> _nextp++ = c; } nsecs = BDS_write(iobuf->_fd, iobuf->_buff, NSECTS); if (nsecs != NSECTS) { return ERROR; } iobuf -> _nleft = (NSECTS * SECSIZ - 1); iobuf -> _nextp = iobuf -> _buff; return *iobuf -> _nextp++ = c; } int _fflush(iobuf) struct _buf *iobuf; { int i; /* comment out ----- if (iobuf < 4) return OK; ----- end comment out */ if (iobuf -> _nlefutc(LF,outbuf); /* no EOF seen yet */ return(NO); } else { /* just copy next character */ putc(c,outbuf); } } } /* output CR and LF to console */ ccrlf() { putchar(CR); putchar(LF); } n a comment */ comflag=NO;/* Lowest level file routines for Software Tools * Used by File primitives * * source: rawfile.bds * version: July 23, 1981 */ #include tools.h /* make calls to raw BDS file routines more visible */ #define BDS_close _close #define BDS_creat _creat #define BDS_flush _flush #define BDS_open _open #define BDS_read _read #define BDS_seek _seek #define BDS_unlink _unlink #define BDS_write _write /* routines on this file: _creat _fcreat _fclose _fflush _fopen _getc _putc */ /* The following routines are replacements for routines * on STDLIB2.CRL */ BDS_creat (filename) char *filename; { _unlink (filename); /* call BDOS create function */ if (bdos (22,0x5c) == 255) { return(ERR)t == (NSECTS * SECSIZ)) { return OK; } i = NSECTS - iobuf->_nleft / SECSIZ; if (BDS_write(iobuf -> _fd, iobuf -> _buff, i) != i) { return ERROR; } i = (i-1) * SECSIZ; if (iobuf -> _nleft) { movmem(iobuf->_buff + i, iobuf->_buff, SECSIZ); iobuf -> _nleft += i; iobuf -> _nextp -= i; return BDS_seek(iobuf->_fd, -1, 1); } iobuf -> _nleft = (NSECTS * SECSIZ); iobuf -> _nextp = iobuf -> _buff; return OK; } int _fclose(iobuf) struct _buf *iobuf; { /* comment out ----- if (iobuf < 4) return OK; ----- end comment out */ return BDS_close(iobuf -> _fd); }  *iobuf -> _nextp++ /* software tools format program -- C version -- Part 1 * source: roff1.bds * version: November 27, 1981. */ #define VERSION "November 27, 1981" #include tools.h #include roff.h main(argc, argv) int argc; char **argv; { initst(argc, argv); main1(); endst(); } main1() { /* include: cpage, cparam, cout */ char *arg; int i, fd, nf; finit();  { tbuf [j++] = buf [i - k1]; } for (k1 = k; k1 > 0; k1--) { tbuf [j++] = BACKSPACE; } for (k1 = k; k1 > 0; k1--) { tbuf [j++] = buf [i - k1]; } /* copy delimiter */ tbuf [j++] = buf [i]; /* reset counter */ k = 0; if (buf [i] == NEWLINE) { break; } } } tbuf [j] = EOS; if (j >= size) { sys_error("bold"); } /* copy tbuf back to buf */ scopy(tbuf, 0, buf, 0); } /* brk - end current filled line */ brk() { /* include cout */ if (outp > 0) { outbuf [outp++] = NEWLINE; outbuf [outp] = EOS; put(outbuf); } outp = 0; outw = 0; outwds = 0; } /* center - center a line by setting tival */ center(buf) char buf []; { /* include cparam */ tival = max( (rmval + tival - width(buf)) / 2, 0); } /* command - perform formatting command */ command(buf) char *buf; { /* include: cpage, cparam, cfiles, cnr */ char name [MAXLINE], defn[MAXDEF]; int val, argtyp; /* command line va query("usage: ROFF [-s] [+n] [-n] [-pon] [files]\n"); putlin("Welcome to roff version 0b:, ",SYS_TERM); putlin(VERSION, SYS_TERM); putlin("\n",SYS_TERM); /* open all files. examine options */ nf = 0; /* number of open files */ for (i = 1; (arg = getarg(i)) != EOS; i++) { /* -s option: stop after each page */ if (arg [0] == '-' && tolower(arg[1]) == 's') { stopx = YES; } /* -po n option: page offset */ else if ( arg [0] == '-' && tolower(arg [1]) == 'p' && tolower(arg [2]) == 'o' ) { set (&offset, atoi(arg + 3), arg [3], 0, 0, rmval - 1); } /* + n option: start printing with page n */ else if (arg [0] == '+') { frstpg = atoi(arg + 1); } /* - n option: stop printing after page n */ else if (arg [0] == '-' && arg[1] != EOS) { lastpg = atoi(arg + 2); } /* - or filename option: process input */ else { if (arg [0] == '-') { fd = STDIN; } else { fd =lues */ int spval; /* temp spacing param */ int ismacro; int i, j; /* must look for macros before expanding escapes */ i = 1; getwrd(buf, &i, name); ismacro = ludef(name, defn); doesc(buf, name, MAXLINE); /* get value of argument following command */ i = 0; while ( buf [i] != ' ' && buf [i] != TAB && buf [i] != NEWLINE ) { i++; } /* warning: i used below as index into buf */ val = getval(buf, &i, &argtyp); if (ismacro == YES) { /* evaluate args. push back definition */ eval(buf, defn); return; } if (lu(buf,"fi")) { brk(); fill = YES; } else if (lu(buf,"br")) { brk(); } else if (lu(buf,"nf")) { brk(); fill = NO; } else if (lu(buf,"ls")) { set(&lsval, val, argtyp, 1, 1, HUGE); } else if (lu(buf,"ce")) { brk(); set(&ceval, val, argtyp, 1, 0, HUGE); } else if (lu(buf,"ul")) { cuval = 0; set(&ulval, val, argtyp, 0, 1, HUGE); } else if (lu(buf,"bd")) { set(&boval,  open(arg, READ); } if (fd == ERR) { cant(arg); continue; } /* process one file */ doroff(fd); nf++; if (fd != STDIN) { close(fd); } } } /* end of for loop */ /* if no input files, do STDIN */ if (nf == 0) { doroff(STDIN); } /* end gracefully */ brk(); if ( plval <= 100 && (lineno > 0 || outp > 0) ) { /* flush last output */ space(HUGE); } /* comment out ----- disable pagecontrol ifdef(PAGECONTROL, putc(PAGEJECT); putc(NEWLINE); ) ----- end comment out */ } /* bold - bold-face or overstrike a line */ bold(buf, tbuf, size) char *buf, *tbuf; int size; { int i, j, k, k1; /* expand into tbuf */ k = 0; j = 0; for (i = 0; ; i++) { if ( buf [i] != ' ' && buf [i] != TAB && buf [i] != BACKSPACE && buf [i] != STARTU && buf [i] != STOPU && buf [i] != NEWLINE ) { k++; } else { /* over strike word */ for (k1 = k; k1 > 0; k1--)val, argtyp, 0, 1, HUGE); } else if (lu(buf,"he")) { gettl(buf, ehead, ehlim); gettl(buf, ohead, ohlim); } else if (lu(buf,"fo")) { gettl(buf, efoot, eflim); gettl(buf, ofoot, oflim); } else if (lu(buf,"bp")) { /* perform break explicitly */ brk(); if (lineno > 0) { space(HUGE); } set(&curpag,val,argtyp,curpag+1,-HUGE,HUGE); newpag = curpag; } else if (lu(buf,"sp")) { set(&spval, val, argtyp, 1, 0, HUGE); space(spval); } else if (lu(buf,"in")) { brk(); set(&inval, val, argtyp, 0, 0, rmval-1); tival = inval; } else if (lu(buf,"rm")) { set(&rmval, val, argtyp, PAGEWIDTH, tival + 1, HUGE); } else if (lu(buf,"ti")) { brk(); set(&tival, val, argtyp, 0, 0, rmval); } else if (lu(buf,"pl")) { set(&plval, val, argtyp, PAGELEN, m1val+m2val+m3val+m4val+1, HUGE); bottom = plval - m3val - m4val; } else if (lu(buf,"po")) { set(&offset, val, argtyp, 0, 0, rmval-1); } else if (lu(buf,"m1")) { set(&m1val, v if (spval > lineno && lineno == 0) { phead(); } if (spval > lineno) { space(spval - lineno); } } else { /* ignore unknown commands */ return; } } /* return true if first two characters of buffer matches * the string. */ BOOL lu (buf, string) char *buf, *string; { if ( buf [1] == string[0] && buf [2] == string[1] ) { return(YES); } else { return(NO); } } /* dodef - define a command; .de xx is in buf * read lines until a .en is found */ dodef(buf, fd) char *buf; int fd; { /* include cparam */ char name [MAXNAME], defn [MAXDEF]; int i; /* comment out ----- printf("in dodef: buf = %s\n", buf); ----- end comment out */ /* get name */ i = 0; getwrd(buf, &i, name); i = getwrd(buf, &i, name); /* comment out ----- printf("dodef: name = %s\n", name); ----- end comment out */ if (i == 0) { /* null definition -- ignore */ return; } /* allow arbitrary length names */ i = 0; al, argtyp, 3, 0, plval-m2val-m3val-m4val-1); } else if (lu(buf,"m2")) { set(&m2val, val, argtyp, 2, 0, plval-m1val-m3val-m4val-1); } else if (lu(buf,"m3")) { set(&m3val, val, argtyp, 2, 0, plval-m1val-m2val-m4val-1); bottom = plval - m3val - m4val; } else if (lu(buf,"m4")) { set(&m4val, val, argtyp, 3, 0, plval-m1val-m2val-m3val-1); bottom = plval - m3val - m4val; } else if (lu(buf,"eh")) { gettl(buf, ehead, ehlim); } else if (lu(buf,"oh")) { gettl(buf, ohead, ohlim); } else if (lu(buf,"ef")) { gettl(buf, efoot, eflim); } else if (lu(buf,"of")) { gettl(buf, ofoot, oflim); } else if (lu(buf,"cc")) { /* change command character */ cchar = argtyp; if (cchar == EOS || cchar == NEWLINE) { cchar = '.'; } } else if (lu(buf,"ne")) { if (lineno + val > bottom && lineno <= bottom){ space(val); lineno = 0; } } else if (lu(buf,"bs")) { set(&bsval, val, argtyp, 1, 0, HUGE); } else if (lu(bufwhile (ngetln(buf, fd) != EOF) { /* .en terminates macro definition */ if ( buf [0] == cchar && buf [1] == 'e' && buf [2] == 'n' ) { break; } addstr(buf, defn, &i, MAXDEF); } if (addset(EOS, defn, &i, MAXDEF) == NO) { error("definition too long."); } entdef(name, defn); } /* doesc - expand values of number regs into buf */ doesc(buf, tbuf, size) char *buf, *tbuf; int size; { /* include cnr */ int i, j; j = 0; /* expand into tbuf */ for (i = 0; buf [i] != EOS && j < size; i++) { if (buf [i] != '@') { tbuf [j++] = buf[i]; } else if (buf [i+1] == '@') { /* two at signs count as one */ tbuf [j++] = '@'; i++; } else if ( buf [i+1] == 'n' && isalpha(buf [i+2]) ) { /* @na is request for number reg a */ j += itoc( nr [tolower(buf [i+2])-'a'], tbuf + j, size - j - 1 ); i += 2; } else { tbuf [j++] = buf[i]; } } tbuf [j] =,"ju")) { rjust = YES; } else if (lu(buf,"nj")) { rjust = NO; } else if (lu(buf,"so")) { /* start new source file */ if (getwrd(buf, &i, name) == 0) { return; } if (level + 1 >= MAXOFILES) { error("so commands nested too deeply."); } infile [level+1] = open(name, READ); if (infile [level+1] != ERR) { level++; } } else if (lu(buf,"cu")) { ulval = 0; set(&cuval, val, argtyp, 0, 1, HUGE); } else if (lu(buf,"de")) { dodef(buf, infile [level]); } else if (lu(buf,"nr")) { /* set number register */ if (getwrd(buf, &i, name) == 0) { return; } fold(name); if (name [0] < 'a' || name[0] > 'z') { error("invalid number register name."); } val = getval(buf, &i, &argtyp); set(&nr [name[0]-'a'], val, argtyp, 0, -HUGE, HUGE); } else if (lu(buf,"st")) { /* space to line n from top of page */ if (argtyp == '-') { spval = plval; } else { spval = 0; } set(&spval, val, argtyp, 0, 1, bottom);  EOS; scopy(tbuf, 0, buf, 0); } /* doroff - format text in file fd */ doroff(fd) int fd; { /* include cfiles, cparam */ char inbuf [INSIZE]; infile [0] = fd; for (level = 0; level >= 0; level--) { while (ngetln(inbuf, infile [level]) != EOF) { if (inbuf [0] == cchar) { command(inbuf); } else { text(inbuf); } } /* close an .so file */ if (level > 0 && infile [level] != ERR) { close(infile [level]); } } } /* dotabs - expand tabs in buf */ dotabs(buf, tbuf, size) char *buf, *tbuf; int size; { /* include cparam */ int i, j; /* expand into tbuf */ j = 0; for (i = 0; buf [i] != EOS && j < size; i++) { if (buf [i] == TAB) { while (j < size) { tbuf [j++] = ' '; if ( tabs [j] == YES || j >= INSIZE ) { break; } } } else { tbuf [j++] = buf [i]; } } tbuf [j] = EOS; scopy(tbuf, 0, buf, 0); } /* entdef - enter name and definition in macro table */ entd/* software tools format program -- C version -- Part 2 * source: roff2.bds * version: November 26, 1981. */ #include tools.h /* defs for primitives */ #include roff.h /* finit - set parameters to default values */ finit() { /* include: cparam, cpage, cout, cdefio, cnr, cmac */ int i; /* initialize flags */ cuflag = NO; dir = 0; putflag = NO; /* initialize cparam */ inval = 0; rmval = PAGEWIDTH; tival = 0; lsval = 1; fill = YES; ceval = 0; ulval = 0; boval = 0; cchar = '.'; tjust [0] = LEFT; tjust [1] = CENTER; tjust [2] = RIGHT; bsval = 0; rjust = YES; cuval = 0; for (i = 0; i < INSIZE; i++) { if (i % 8 == 0) { tabs [i] = YES; } else { tabs [i] = NO; } } /* initialize cpage */ lineno = 0; curpag = 0; newpag = 1; plval = PAGELEN; m1val = 3; m2val = 2; m3val = 2; m4val = 3; bottom = plval - m3val - m4val; ehead [0] = NEWLINE; ehead [1] = EOS; ohead [0] = NEWLINE; ohead [1] = EOS; efef (name, defn) char *name, *defn; { /* include cmac */ int i; char *locn; /* comment out ----- printf("entdef: name = %s, defn = \n%s\n",name,defn); ----- end comment out */ if ((locn = lookup (name, mactbl)) != 0) { /* erase old definition */ delete(name, mactbl); } enter (name, defn, mactbl); } /* eval - evaluate defined command; push back definition. * buf contains a call to a macro. * defn contains its definition. * substitute args from buf into definition and * push it all back. */ eval(buf, defn) char *buf, *defn; { int i, j, k; int argptr [10]; /* comment out ----- printf("eval: buf = %s\ndefn = %s\n", buf, defn); ----- end comment out */ /* create null string */ buf [0] = EOS; /* initialize pointers to null string */ for (j = 0; j < 10; j++) { argptr [j] = 0; } /* up to 9 positional arguments are allowed. * $0 refers to command name. */ for (i= 1, j = 0; j < 10; j++) { /oot [0] = NEWLINE; efoot [1] = EOS; ofoot [0] = NEWLINE; ofoot [1] = EOS; ehlim [0] = inval; ehlim [1] = rmval; ohlim [0] = inval; ohlim [1] = rmval; eflim [0] = inval; eflim [1] = rmval; oflim [0] = inval; oflim [1] = rmval; stopx = NO; frstpg = 0; lastpg = HUGE; print = YES; offset = 0; /* initialize cout */ outp = 0; outw = 0; outwds = 0; /* initialize dynamic storage */ /* ----- calling sequence changed ----- */ dsinit(); /* initialize symbol table for macros */ /* ----- calling sequence changed */ mactbl = mktabl(29); /* initialize cdefio */ bp = -1; /* initialize cnr */ for (i = 0; i < 26; i++) { nr [i] = 0; } } /* gettl - copy title from buf to ttl */ gettl(buf, ttl, lim) char *buf, *ttl; int *lim; { /* include: cparam */ int i; /* skip command name */ i = 0; while ( buf [i] != ' ' && buf [i] != TAB && buf [i] != NEWLINE ) { i++; } /* skip to start of title* scan past blanks ending previous argument */ skipbl(buf, &i); if (buf [i] == NEWLINE || buf[i] == EOS) { break; } /* point argptr at arg */ argptr [j] = i; while ( buf [i] != ' ' && buf [i] != TAB && buf [i] != NEWLINE && buf [i] != EOS ) { i++; } /* end argument */ buf [i++] = EOS; /* comment out ----- printf("argptr[%d] = %d,",j, argptr[j]); printf("buf + argptr[%d] = %s\n", j, buf + argptr[j]); ----- end comment out */ } /* push the defintion back in reverse order. * substitute actual parameters for $1 ... $9 * substitute command name for $0 */ for (k = length(defn) - 1; k > 0; k--) { if (defn [k-1] != ARGFLAG) { putbak(defn [k]); } else { if (defn [k] < '0' || defn [k] > '9') { putbak(defn [k]); } else { i = defn [k] - '0'; pbstr(buf + argptr [i]); k--; /* skip over $ */ } } } /* do last character */ if (k >= 0) { putbak(defn [k]); } }  */ skipbl(buf, &i); /* copy titles to ttl */ scopy(buf, i, ttl, 0); /* comment out ----- gettl trace printf("gettl: buf is -->%s\n",buf); printf("gettl: ttl is -->%s\n",ttl); printf("Hit any key to continue\n"); getch(SYS_TERM); ----- end comment out */ /* set limits */ lim [0] = inval; lim [1] = rmval; } /* getval - evaluate optional numeric argument * set i past argument * set argtype to type (numeric or not) * calling sequence: getval (buf, &i, &argtyp); */ getval(buf, i, argtyp) char *buf; int *i, *argtyp; { /* move *i past blanks */ skipbl(buf, i); *argtyp = buf [*i]; if (*argtyp == '+' || *argtyp == '-') { (*i)++; } /* move *i past argument */ return(ctoi(buf, i)); } /* getwrb - get a word; hangs onto trailing blanks * point i past word * calling sequence: getwrb (in, &i, out); */ getwrb(in, ii, out) char *in, *out; int *ii; { int i, j; i = *ii; j = 0; while ( ielete leading blanks, set tival */ leadbl(buf) char *buf; { /* include: cparam */ int i, j; brk(); /* find first non-blank character on the line */ for (i = 0; buf [i] == ' '; i++) { ; } if (buf [i] != NEWLINE) { tival += i; } /* move line to left */ j = 0; while ((buf [j++] = buf [i++])!= EOS) { ; } } /* ludef - look up a macro name * copy the definition to defn * return pointer to definition if found. * Note: this is a change in lookup. */ ludef (name, defn) char *name, *defn; { /* include: cmac */ int i; char *locn; /* comment out ----- printf("in ludef: name = %s\n",name); ----- end comment out */ if ((locn = lookup (name, mactbl)) == 0) { return (NO); } else { scopy (locn, 0, defn, 0); return (YES); } } /* ngetch - get a char from file fd or * the stack of pushed back characters. */ ngetch(fd) int fd; { /* include: cdefio */ if (bp >= 0) { return(pbbuf n [i] != EOS && in [i] != ' ' && in [i] != TAB && in [i] != NEWLINE ) { out [j++] = in [i++]; } /* include trailing blanks */ while (in [i] == ' ') { i++; out [j++] = ' '; } /* supply a blank to end the word if none there */ if ( j > 0 && out [j - 1] != ' ') { out [j++] = ' '; } out [j] = EOS; *ii = i; /* comment out ----- getwrb trace printf("getwrb: out = %s, i = %d, j = %d\n",out,i,j); printf("Hit any key to continue\n"); getch(SYS_TERM); ----- end comment out */ return(j); } /* gfield - get next tab or title field * set i past field * return number of characters copied * calling sequence: gfield(buf, &i, n, temp, delim); */ int gfield(buf, ii, n, temp, delim) char *buf; int *ii; int n; char *temp; char delim; { int i, j; i = *ii; j = 0; if (n > 0) { if (buf [i] == delim) { i++; } while ( buf [i] != delim && buf [i] != EOS && b[bp--]); } else { return(getch(fd)); } } /* ngetln - get next line from f into line */ ngetln(line, fd) char *line; int fd; { int i; int c; i = 0; while (i < MAXLINE - 1 && (c = ngetch(fd)) != EOF) { line [i++] = c; if (c == NEWLINE) { break; } } line [i] = EOS; if (i == 0 && c == EOF) { i = EOF; } return(i); } /* pbstr - push string back onto input */ pbstr(in) char *in; { int i; for (i = length(in) - 1; i >= 0; i--) putbak(in [i]); } /* pfoot - put out page footer */ pfoot() { /* include: cpage */ skip(m3val); if (m4val > 0) { if (curpag % 2 == 0) { puttl(efoot, eflim, curpag); } else { puttl(ofoot, oflim, curpag); } /* comment out ----- pagecontrol ifnotdef(PAGECONTROL, skip(m4val-1) ); ----- end comment out */ skip(m4val-1); } } /* phead - put out page header */ phead() { /* include: cpage */ int c [MAXLINE]; curpag = newpag; /* check whether we should pruf [i] != NEWLINE && j < n ) { temp [j++] = buf [i++]; } } /* skip things between delims */ while ( buf [i] != delim && buf [i] != EOS && buf [i] != NEWLINE ) { i++; } temp [j] = EOS; *ii = i; return(j); } /* jcopy - scopy without copying EOS */ jcopy(from, i, to, j) char *from, *to; int i, j; { while (from [i] != EOS) { to [j++] = from [i++]; } } /* justify - justifies string in its tab column */ justify(in, left, right, type, out) char *in, *out; int left, right, type; { int j, n; n = width(in); if (type == RIGHT) { j = max ( (right - n), 0); jcopy(in, 0, out, j); } else if (type == CENTER) { j = max( (right + left - n) / 2, left); jcopy(in, 0, out, j); } else jcopy(in, 0, out, left); /* comment out ----- justify trace printf("justify: type = %d\n out = %s\n",type,out); printf("Hit any key to continue\n"); getch(SYS_TERM); ----- end comment out */ } /* leadbl - d int this page */ if (curpag >= frstpg && curpag <= lastpg) { print = YES; } else { print = NO; } if (stopx == YES && print == YES) { prmpt(); } newpag++; /* comment out ---------- pagecontrol ifdef(PAGECONTROL, if (stopx == 0 && print == YES) { putc(PAGEJECT); } ) ---------- end comment out */ if (m1val > 0) { skip(m1val-1); if (curpag % 2 == 0) { puttl(ehead, ehlim, curpag); } else { puttl(ohead, ohlim, curpag); } } skip(m2val); lineno = m1val + m2val + 1; } /* prmpt - pause for paper insertion. */ prmpt() { char line [MAXLINE]; putlin("Type return to begin a page",SYS_TERM); getlin(line, SYS_TERM); } /* put - put out line * ALL output eventually comes here via * calls from text() or calls from brk(). */ put(buf) char *buf; { if (lineno == 0 || lineno > bottom) { phead(); } if (print == YES) { put1(buf); } tival = inval; skip (min (lsval - 1, bottom - lineno)); lturn; } left = lim [0]; right = lim [1]; /* calculate the width of the page number and date */ nc = itoc(pageno, chars, MAXLINE - 1); now = getnow(); fmtdat(cdate, tbuf1, now, 0); ncd = length(cdate); delim = buf [0]; /* blank out title field */ for (j = 0; j < right; j++) { ttl [j] = ' '; } /* get the left, center, and right fields */ i = 0; for(n = 0; n < 3 ;n++ ) { /* get next field of title */ if ( gfield ( buf, &i, right - left, tbuf1, delim) > 0 ) { /* substitute page num for '#' */ subst ( tbuf1, PAGENUM, tbuf2, chars, nc); /* substitute date for '%' */ subst ( tbuf2, CURRENTDATE, tbuf1, cdate, ncd); justify ( tbuf1, left, right, tjust [n], ttl); } if ( buf [i] == EOS || buf [i] == NEWLINE ) { break; } } /* trim blanks */ while (ttl [right-1] == ' ') { right--; } ttl [right] = NEWLINE; ttl [right+1] = EOS; /* offset titineno += lsval; if (lineno > bottom) { pfoot(); } } /* put1 - put out text beteen header and footer */ put1(buf) char *buf; { /* include: cpage, cparam */ int i, j, w, c; int start; /* comment out ----- put1 trace printf("put1: buf = %s\n",buf); printf("Hit any key to continue\n"); getch(SYS_TERM); ----- end comment out */ /* putflag may be YES on entry */ w = 0; start = 0; /* page offset */ for (i = 0; i < offset; i++) { putc(' '); } /* indentation */ for (i = 0; i < tival; i++) { putc(' '); } /* put out line. handle underlining */ for ( i = 0; ;i++) { c = buf [i]; if ( (putflag == NO) && (c == EOS || c == NEWLINE) ) { break; } if (c == STARTU) { start = i + 1; w = 0; putflag = YES; } else if (c == STOPU && putflag == NO) { remark("in put1: extra STOPU ignored"); } else if ( c == STOPU || c == EOS || c == NEWLINE ) { /* output charle */ for (i = 0; i < offset; i++) { putc(' '); } /* output title */ putlin(ttl, STDOUT); } /* putwrd - put a word in outbuf * the word includes trailing blanks * justify right margin when line becomes full */ putwrd(wrdbuf) char *wrdbuf; { /* include cout, cparam */ int last, llval, nextra, len, w; len = length(wrdbuf); w = width(wrdbuf); /* set new end of outbuf */ last = len + outp; llval = rmval - tival; if (outw + w > llval || last >= MAXOUT) { /* too big -- buffer will have one word */ last = len; /* do not allow trailing blanks on a line */ nextra = llval - outw; while ( outp > 0 && outbuf[outp - 1] == ' ' ) { outp--; nextra++; } /* outp points past the last char or 0 here */ if (rjust == YES) { spread(outbuf, outp, nextra, outwds); if (nextra > 0 && outwds > 1) { outp += nextra; } } brk(); /* flush previous line */ } scopy(wrdbuf, 0, outbuf, outp)s */ for (j = start; j < i ;j++) { putch(buf[j], STDOUT); } /* now backspace */ for (j = 0; j < w; j++) { putch(BACKSPACE, STDOUT); } /* now underline */ for (j = 0; j < w; j++) { putch('_', STDOUT); } if (c == EOS || c == NEWLINE) { break; } putflag = NO; } else if (putflag == YES) { w += widthch(c); } else { putch(c, STDOUT); } } /* end of for loop */ putch(NEWLINE, STDOUT); } /* putbak - push character back onto input */ putbak(c) char c; { /* include: cdefio */ if (++bp >= PBSIZE) { error("too many characters pushed back."); } pbbuf [bp] = c; } /* puttl - put out title line * substitute line number for '#' * substitute date for '%' */ puttl(buf, lim, pageno) char *buf; int *lim; int pageno; { /* include cpage, cparam, ctemp */ char chars [MAXLINE], cdate[MAXLINE]; char delim; int nc, i, j, n, left, right, ncd; char *now; if (print == NO) { re ; outp = last; outw += w; outwds++; } /* set - set parameter and check range */ set( param, val, argtyp, defval, minval, maxval) int *param, val, argtyp, defval, minval, maxval; { if (argtyp == NEWLINE) { /* use default */ *param = defval; } else if (argtyp == '+') { /* increase */ *param += val; } else if (argtyp == '-') { /* decrease */ *param -= val; } else { /* set to new value */ *param = val; } /* put value in bounds */ *param = min(*param, maxval); *param = max(*param, minval); } /* skip - output n blank lines */ skip(n) int n; { /* include cpage */ if (print == YES) { while (n-- > 0) { putc(NEWLINE); } } } /* space - space n lines or to bottom of page */ space(n) int n; { /* include: cpage */ brk(); if (lineno > bottom) { return; } if (lineno == 0) { phead(); } skip(min(n, bottom + 1 - lineno)); lineno += n; if (lineno > bottom) { pfoot(); } } /* spread - spread w leadbl(inbuf); } if (ulval > 0) { /* word underlining */ underl(inbuf, wrdbuf, INSIZE); ulval--; } if (cuval > 0) { /* continuous underlining */ if (cuflag == NO) { scopy(inbuf, 0, wrdbuf, 0); inbuf [0] = STARTU; scopy(wrdbuf, 0, inbuf, 1); cuflag = YES; } cuval--; if (cuflag == YES && cuval == 0) { /* overwrite \n and EOS */ i = length(inbuf) - 1; inbuf [i] = STOPU; inbuf [i+1] = NEWLINE; inbuf [i+2] = EOS; cuflag = NO; } } if (boval > 0) { /* boldfacing */ bold(inbuf, wrdbuf, INSIZE); boval--; } if (ceval > 0) { /* centering */ center(inbuf); put(inbuf); ceval--; } else if (inbuf [0] == NEWLINE) { /* all blank line */ put(inbuf); } else if (fill == NO) { /* unfilled textd */ put(inbuf); } else { /* filled text */ /* comment out ----- text trace printf("text: inbuf = %s\n",inbuf); printf("Hit any character to continue\n"); getch(SYS_TERM); ----- end coords to justify right margin * warning: this routine is sensitive to * bad parameters. */ spread(buf, outp, ne, outwds) char *buf; int outp, ne, outwds; { /* include: cparam */ int i, j, nb, nholes; /* comment out ----- spread trace printf("spread: outp = %d, ",outp); printf("ne = %d, ",ne); printf("outwds = %d \n",outwds); printf("spread: buf = %s\n",buf); printf("Hit any key to continue\n"); getch(SYS_TERM); ----- end comment out */ if (ne <= 0 || outwds <= 1 || outp <= 0) { return; } /* reverse direction */ dir = 1 - dir; nholes = outwds - 1; if (tival != inval && nholes > 1) { nholes--; } /* point i at last character of buf */ i = outp - 1; /* leave room for NEWLINE and EOS */ j = min(MAXOUT - 2, i + ne); while (i < j) { buf [j] = buf [i]; if (buf [i] == ' ' && buf [i-1] != ' ') { if (dir == 0) { nb = (ne-1) / nholes + 1; } else { nb = ne / nholes; } ne = ne - nb; mment out */ /* insure two spaces after a period */ i = length(inbuf); inbuf [i] = ' '; if (inbuf [i-1] == '.') { inbuf [++i] = ' '; } inbuf [i+1] = EOS; for (i = 0; getwrb(inbuf, &i, wrdbuf) > 0; ) putwrd(wrdbuf); } } /* underl - underline words in a line * surround each word with STARTU and STOPU */ underl(buf, tbuf, size) char *buf, *tbuf; int size; { int i, j, t; int inword; inword = NO; /* use tbuf as internal buffer */ for (i = 0, j = 0; j < size - 3; ) { if (buf [i] == EOS || buf [i] == NEWLINE) { break; } t = tolower(type(buf[i])); if (inword == NO) { /* look for start of word */ if (t == 'a' || t == '0' || t == '_') { /* add STARTU to buffer */ tbuf [j++] = STARTU; inword = YES; } } else { /* look for end of word */ if (t != 'a' && t != '0' && t != '_') { /* add STOPU to buffer */ tbuf [j++] = STOPU; inword = NO; } } /* always copy the character */ nholes--; while (nb-- > 0) { buf [--j] = ' '; } } i--; j--; if (i < 0 || j < 0) { sys_error("spread:\n"); } } } /* subst - substitute a string for char1 */ subst(in, char1, out, subara, n) char *in, *out, *subara; char char1; int n; { int i, j, k; for (i = 0, j = 0; in [i] != EOS; i++) { if (in [i] == char1) { for (k = 0; k < n; ) { out [j++] = subara [k++]; } } else { out [j++] = in [i]; } } out [j] = EOS; /* comment out ----- subst trace printf("subst: char = %c, out = %s\n",char1,out); printf("Hit any key to continue\n"); getch(SYS_TERM); ----- end comment out */ } /* text - process text lines */ text(inbuf) char *inbuf; { /* include cparam */ char wrdbuf [INSIZE]; int i; /* data cuflag /NO/ */ /* expand escapes */ doesc(inbuf, wrdbuf, INSIZE); /* expand tabs */ dotabs(inbuf, wrdbuf, INSIZE); if (inbuf [0] == ' ' || inbuf [0] == NEWLINE) { /* move left, set tival */   tbuf [j++] = buf [i++]; } /* make sure we end outside underline mode */ if (inword == YES) { tbuf [j++] = STOPU; } tbuf [j++] = NEWLINE; tbuf [j] = EOS; /* put result back in tbuf */ scopy(tbuf, 0, buf, 0); /* comment out ----- underl trace printf("underl: buf is: %s\n",buf); ----- end comment out */ } /* width - return width of character string */ int width(buf) char *buf; { int value; value = 0; while (*buf != EOS) { value += widthch(*buf++); } return(value); } /* return width of a character */ widthch(c) int c; { if (c == BACKSPACE) { return(-1); } else if (c >= ' ' && c <= '~') { return(1); } else { return(0); } } /* Storage management routines for Software Tools & BDS C. * source: storage.bds * version: August 27, 1981 */ #include tools.h /* The only routine whose calling sequence has been * changed is dsinit: * * RATFOR: dsinit (w) * s from start of string * return length of new string */ int sdrop (from, to, chars) char *from, *to; int chars; { int len, start; len = length (from); if (chars < 0) { return (ctoc (from, to, len + chars)); } else { start = min (chars, len); return (ctoc (from + start, to, len)); } } /* stake --- take chars from a string APL-style * if chars < 0 take chars from end * if chars >= 0 take chars from beginning * return number of chars taken */ int stake (from, to, chars) char *from, *to; int chars; { int len, start; len = length (from); if (chars < 0) { start = max(len + chars, 0); return (ctoc (from + start, to, len)); } else { return (ctoc (from, to, chars)); } } /* strcmp - compare 2 strings * return -1 if <, 0 if =, +1 if > */ int strcmp (str1, str2) char *str1, *str2; { int i; for (i = 0; str1[i] == str2[i]; i++) { if (str1[i] == EOS) { return(0); } int w; * * * C: dsinit (); * */ /* dsinit -- initialize the dynamic storage space */ dsinit() { /* reserve 1000 bytes for stack at all times */ rsvstk(1000); /* anchor the free memory space */ _allocp = NULL; } /* dsfree -- return a block to the available space list */ dsfree (block) char *block; { free(block); } /* dsget -- get pointer to block of n bytes */ char *dsget (n) int n; { char *p; /* comment out ----- printf("In dsget: n = %d\n", n); ----- end comment out */ if ((p = alloc(n)) == 0) { error ("dsget: out of dynamic memory"); } return(p); } /* ---------- dsdump not implemented: /* dsdump --- produce semi-readable dump of storage */ dsdump (form) char form; { } ---------- end comment out */ /* ---------- dsdbiu not implemented: /* dsdbiu - dump contents of block-in-use */ dsdbiu (b, form) pointer b; char form; { } ---------- end comment out */  } if (str1[i] == EOS) { return(-1); } else if (str2[i] == EOS) { return(1); } else if (str1[i] < str2[i]) { return(-1); } else { return(1); } } /* strim - trim trailing blanks and tabs from a string * return number of characters in str [] */ int strim (str) char *str; { int i, j; for (i = 0, j = 0; str[i] != EOS; i++) { if (str[i] != BLANK && str[i] != TAB) { j = i; } } str [j + 1] = EOS; return (j); } /* slstr --- slice a substring from a string * if first < 0 count backwards from end * if chars < 0 count backwards from first * return the number of characters in the slice */ int slstr (from, to, first, chars) char *from, *to; int first, chars; { int i, k, last, len; len = length (from); if (first < 0) { /* count backwards from end */ first += len; } if (chars < 0) { /* count backwards from first */ first += chars; chars = - chars; } first =/* Sting manipulation routines for Software Tools * source: string.bds * version: July 25, 1981 */ #include tools.h /* concat - concatenate two strings together */ concat (buf1, buf2, outstr) char *buf1, *buf2, *outstr; { int i; i = 0; stcopy (buf1, 0, outstr, &i); scopy (buf2, 0, outstr, i); } /* getwrd - get non-blank word from in [i] into out [] * increment i. * return j = the number of characters copied. * * calling sequence: j = getwrd (in, &i, out); */ int getwrd (in, ii, out) char *in, *out; int *ii; { int i, j; i = *ii; while (in[i] == ' ' || in[i] == TAB) { i++; } j = 0; while ( in[i] != EOS && in[i] != ' ' && in[i] != TAB && in[i] != NEWLINE ) { out[j++] = in[i++]; } out[j] = EOS; *ii = i; return(j); } /* sdrop --- drop chars from a string APL-style * if chars < 0 drop chars from end of string * if chars >= 0 drop char  max (0, first); last = min (len, first + chars); for (k = 0, i = first; k < last; ) { to [k++] = from[i++]; } to [k] = EOS; return(k); } /* type - determine type of char */ char type (c) int c; { if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) { return('a'); } else if ('0' <= c && c <= '9') { return('0'); } else { return(c); } } /* skipbl - skip blanks and tabs at lin[i] * point i past blanks. * calling sequence: skipbl(lin, &i); */ skipbl(lin, i) char *lin; int *i; { while (lin [*i] == BLANK || lin [*i] == TAB) { (*i)++; } } /* equal - compare str1 to str2 */ BOOL equal (str1, str2) char *str1, *str2; { int i; for (i = 0; str1 [i] == str2 [i]; i++) { if (str1 [i] == EOS) { return (YES); } } return (NO); } /* locate --- look for c in char class at pat (offset) */ BOOL locate (c, pat, offset) char c, *pat; int offset; { int i; /* size of class is at pat [offset], chachar data [1]; /* first byte of data field */ }; #define NODE "N" /* only legal value for nchk */ #define NHEAD 3 /* size of fixed part of node */ /* These routines have different calling sequences from * the RATFOR routines from the Software Tools Users Group: * * * RATFOR: delete (symbol, table) * char *symbol, *table; * * C: delete (symbol, table) * char *symbol; * struct symtab *table; * * * RATFOR: enter (symbol, info, table) * char *symbol; * int info; * char *table; * * C: enter (symbol, info, table) * char *symbol, *info; * struct symtab *table; * * * RATFOR: lookup (symbol, info, table) * char *symbol, *info, *table; * (copy information to info []); * * C: lookup (symbol, table) * char *symbol; * struct symtab *table; * (return pointer to info field) * rs follow */ for (i = offset + pat [offset]; i > offset; i--) { if (c == pat [i]) { return (YES); } } return (NO); } /* scopy - copy string at from (i) to to (j) */ scopy (from, i, to, j) char *from, *to; int i, j; { while ((to [j++] = from [i++]) != EOS) { ; } } /* stcopy - copy string at from [i] to to [j] * update j to point AT the EOS * * calling sequence: stcopy (from, i, to, &j); */ stcopy (from, i, to, j) char *from, *to; int i; int *j; { while ((to [*j] = from [i++]) != EOS) { (*j)++; } } /* index - find char c in string str */ int index (str, c) char *str, c; { int i; for (i = 0; str [i] != EOS; i++) { if (str [i] == c) { return(i); } } return (-1); } /* length - compute length of string * do not count EOS in length */ int length (str) char *str; { int i; for (i = 0; str [i] != EOS; i++) { ; } return(i); }  * * RATFOR: mktabl (nodesize) * int nodesize; * * C: mktable (htsize) * int htsize; * * * RATFOR: rmtabl (table) * char *table; * * C: rmtabl (table) * struct symtab *table; * * * RATFOR: sctabl (table, sym, info, posn) * char *table, *sym, *info; * int *posn; * (copy fields to sym [] and info []) * * C: sctabl (table, posn) * struct symtab *table; * int *posn; * (return pointer to data field of node) * */ #define NTABS 10 /* number of symbol tables */ main(argc, argv) int argc; char **argv; { initst(argc, argv); main1(); endst(); } main1() { char inbuf[100]; /* input buffer */ int i, number; char *tables [NTABS]; /* pointer to symbol tables */ char symbol [100]; /* symbol name */ char info [100]; /* info field of symbol */ /* init available memory */ dsinit(); printf("\nTest of symtab.bds: A/* Symbol table routines for Software Tools * source: symtab.bds * version: November 27, 1981 */ #include tools.h /* These routines assume that the data field in each node * has the following format: * * name field: string, ends with EOS. * value field: string, ends with EOS. * * The length of these fields is arbritrary; * that is why they are not made part of struct node. * The table lookup routines examine only the name field. * This format works well for macros, but may not be so * good for numeric fields which may contain embedded EOS * characters. */ /* format of each symbol table */ struct symtab { char stchk; /* check byte */ int htsize; /* size of hash table */ struct node *hashtab [1]; /* start of hash table */ }; #define TABCHK "T" /* only legal value for stchk */ #define STHEAD 3 /* size of fixed part of symtab */ /* format of each node */ struct node { char nchk; /* check byte */ struct node *next; /* pointer to next node */  ugust 27, 1981\n"); for (i = 0; i < NTABS; i++) { tables [i] = 0; } /* main loop */ for(;;) { printf("\nEnter table number or "); printf("-1 to exit or "); printf("-2 to dump tables.\n"); _gets(inbuf); number = atoi(inbuf); if (number == -1) { return; } if (number == -2) { for (i = 0; i < NTABS; i++) { if (tables [i] != 0) { printf("\nDump of table %d\n",i); dumptabl (tables [i]); } } continue; } if (number < 0 || number >= NTABS) { printf("Bad table number\n"); continue; } /* create table if needed */ if (tables [number] == 0) { printf("Creating table %d\n",number); tables [number] = mktabl(33); printf("Table %d at %x\n", number, tables [number]); } /* get name of symbol */ printf("Enter symbol name\n"); _gets(symbol); if (symbol [0] == 0) { continue; } /* delete if info field is null */ printf("Enter info field or CR\n"); _gets(info); if ( /* use a cast for maximum portability: * n = (struct * node) dsget (k); */ n = dsget (k); /* set header fields of node */ n -> nchk = NODE; /* copy symbol and info to data area */ i = 0; stcopy (symbol, 0, n -> data, &i); i++; scopy (info, 0, n -> data, i); /* hang node from hash table */ h = hashfunc(symbol, table -> htsize); n -> next = table -> hashtab [h]; table -> hashtab [h] = n; } /* compute the hash function for symbol in a table with * n entries. */ hashfunc (symbol, n) char *symbol; int n; { int i, h; h = 0; for (i = 0; symbol[i] != EOS; i++) { h += symbol [i]; } return (h%n); } /* lookup - return pointer to info for symbol in table. * -- return 0 if symbol not in table */ char *lookup (symbol, table) char *symbol; struct symtab * table; { int h; struct node *n; char *p; h = hashfunc(symbol, table -> htsize); n = table -> hashtab [h]; for ( ; n; n = n -> next) { if (equal(symbol, n -> datinfo [0] == 0) { delete(symbol, tables [number]); } else { enter(symbol, info, tables [number]); } } } /* delete - remove a symbol from the symbol table */ delete (symbol, table) char *symbol; struct symtab *table; { int h; struct node *n, *n1; /* comment out ----- printf("In delete: symbol = %s, table = %x\n", symbol, table); ----- end comment out */ /* point at list of buckets */ h = hashfunc(symbol, table -> htsize); n = table -> hashtab [h]; /* the first bucket is a special case so that the code * is independent of the format of struct symtab. */ if (n == 0) { return; } if (equal(symbol, n -> data)) { table -> hashtab [h] = n -> next; dsfree(n); return; } /* general case: search list of buckets */ n1 = n; /* n1 points at previous bucket */ n = n -> next; /* n points at current bucket */ while (n) { if (equal(symbol, n -> data)) { n1 -> next = n -> next; dsfree(n); return; } elsa)) { /* point p at info field */ p = n -> data; while (*p++ != EOS) { ; } return(p); } } return (0); } /* mktabl - make a new (empty) symbol table */ char *mktabl (hashsize) int hashsize; { char *dsget(); struct symtab *table; int i; /* get storage for the table. * use a cast for maximum portability: * table = (symtab *) dsget (...); */ table = dsget ((2 * hashsize) + STHEAD); /* fill in the debugging byte */ table -> stchk = TABCHK; /* fill in the size of the table */ table -> htsize = hashsize; /* zero out the hash table */ for (i = 0; i < hashsize; i++) { table -> hashtab [i] = 0; } return(table); } /* rmtabl - remove a symbol table, deleting all entries */ rmtabl (table) struct symtab *table; { struct node *n, *n1; int i; /* check debugging byte */ if (table -> stchk != TABCHK) { syserr ("rmtabl: bad check byte"); } /* free every entry in hash table */ for (i = 0; i < table -> htsizee { n1 = n; n = n -> next; } } } /* dumptabl -- dump all symbols of a symbol table */ dumptabl (table) struct symtab *table; { int i, k, posn; char *n, *symbol, *info; int *p; /* dump hash table */ printf("The hash table is:\n\n"); for (i = 0; i < table -> htsize; i++) { if (k = table -> hashtab [i]) { printf("hashtab [%3d] = %x\n", i, k); } } /* print all the nodes in the table */ posn = 0; while (symbol = sctabl(table, &posn)) { info = symbol; while (*info++ != EOS) { ; } p = symbol - 2; printf("node = %x, ", symbol); printf("next = %x, ", *p); printf("symbol = %s, ", symbol); printf("info = %s\n", info); } } /* enter -- place a symbol in the symbol table * update entry if already present */ enter (symbol, info, table) char *symbol, *info; struct symtab *table; { struct node *n; int i, h, k; /* allocate another node */ k = (length(symbol) + 1) + (length(info) + 1) + NHEAD;  ; i++) { n = table -> hashtab [i]; while (n) { n1 = n -> next; dsfree(n); n = n1; } } /* free the symbol table itself. * a cast would be best: dsfree( (char *) table); */ dsfree(table); printf("End of rmtabl\n"); } /* sctabl -- scan symbol table. * update *posn. * return pointer to data field or 0. */ char *sctabl (table, posn) struct symtab *table; int *posn; { int i, count; struct node *n; count = 0; for (i = 0; i < table -> htsize; i++) { n = table -> hashtab [i]; while (n) { if (count == *posn) { (*posn)++; return (n -> data); } else { count++; n = n -> next; } } } (*posn)++; return(0); } /* New BDS library for use with software tools * source: toolib1.bds * version: November 26, 1981 */ #include tools.h /* This file contains all the standard BDS C library functions which are written in C that are used by the software to j >= 0; j -= gap) { if ((*compar)(base+j, jd+j) <=0) break; _swp(width, base+j, jd+j); } } } _swp(w,a,b) char *a,*b; int w; { char tmp; while(w--) {tmp=*a; *a++=*b; *b++=tmp;} } /* Some string functions */ int atoi(n) char *n; { int val; char c; int sign; val=0; sign=1; while ((c = *n) == '\t' || c== ' ') ++n; if (c== '-') {sign = -1; n++;} while ( isdigit(c = *n++)) val = val * 10 + c - '0'; return sign*val; } /* Some character diddling functions */ int isalpha(c) char c; { return isupper(c) || islower(c); } int isupper(c) char c; { return c>='A' && c<='Z'; } int islower(c) char c; { return c>='a' && c<='z'; } int isdigit(c) char c; { return c>='0' && c<='9'; } int isspace(c) char c; { return c==' ' || c=='\t' || c=='\n'; } char toupper(c) char c; { return islower(c) ? c-32 : c; } char tolower(c) char c; { return isupper(c) ? c+32 : c; } /* Storage allocation routols programs. These library functions are identical to the functions which were on files stdlib1 and stdlib2.c EXCEPT that these functions call some routines whose names have changed. The object code for these functions used to be on deff.crl. Now the object code is on toolib1.crl. The functions on this file ONLY use functions on toolib2.crl All the functions with new names are on file toolib2.crl. All functions on toolib2.crl came from deff2.crl. The names have all been changed in the same way, viz., by adding a leading underscore character to the name. The following functions have been renamed: ( * denotes that a call to the function is in this file) _getchar _ungetch _putchar * _putch _gets * _call _read * _write _open * _close * _creat (_unlink) _seek (_tell) _rename _exit _rread _rwrite _rseek _rtell _rsrec _rcfsiz The following functions were on stdlib1.c but have been deleted from this file. getc(),ines, taken from chapter 8 of K&R, but simplified to ignore the storage allignment problem and not bother with the "morecore" hack (a call to "sbrk" under CP/M is a relatively CHEAP operation, and can be done on every call to "alloc" without degrading efficiency.) */ char *alloc(nbytes) unsigned nbytes; { struct _header *p, *q, *cp; int nunits; /* comment out ----- printf("In alloc: nbytes = %d\n", nbytes); ----- end comment out */ nunits = 1 + (nbytes + (sizeof (_base) - 1)) / sizeof (_base); if ((q = _allocp) == NULL) { _base._ptr = _allocp = q = &_base; _base._size = 0; } for (p = q -> _ptr; ; q = p, p = p -> _ptr) { if (p -> _size >= nunits) { if (p -> _size == nunits) q -> _ptr = p -> _ptr; else { p -> _size -= nunits; p += p -> _size; p -> _size = nunits; } _allocp = q; /* comment out ----- printf("Alloc returns: %x\n", p+1); ----- end comment out */ return p + 1; } if (p == _allocp) { cp = sbrk putc(), and ungetc() are now defined on file.bds. They had to be completely rewritten to allow for I/O redirection. fopen getc ungetc getw fcreat putc putw fflush fclose strcat strcmp strcpy strlen qsort initw initb getval The following functions from stdlib1.c are on this file: qsort atoi isalpha isupper islower isdigit isspace toupper tolower alloc free abs max min */ /* This is the new qsort routine, utilizing the shell sort technique given in the Software Tools book (by Kernighan & Plauger.) NOTE: this "qsort" function is different from the "qsort" given in some old releases (pre 1.32) -- here, the items are sorted in ASCENDING order. */ qsort(base, nel, width, compar) char *base; int (*compar)(); { int gap,ngap, i, j; int jd, t1, t2; t1 = nel * width; for (ngap = nel / 2; ngap > 0; ngap /= 2) { gap = ngap * width; t2 = gap + width; jd = base + gap; for (i = t2; i <= t1; i += width) for (j = i - t2; (nunits * sizeof (_base)); if (cp == ERROR) { printf("Alloc: Out of memory"); return NULL; } cp -> _size = nunits; /* remember: pointer arithmetic ! */ free(cp+1); p = _allocp; } } } free(ap) struct _header *ap; { struct _header *p, *q; /* comment out ----- printf("In free: ap = %x\n", ap); ----- end comment out */ p = ap - 1; /* No need for the cast when "ap" is a struct ptr */ for (q = _allocp; !(p > q && p < q -> _ptr); q = q -> _ptr) if (q >= q -> _ptr && (p > q || p < q -> _ptr)) break; if (p + p -> _size == q -> _ptr) { p -> _size += q -> _ptr -> _size; p -> _ptr = q -> _ptr -> _ptr; } else p -> _ptr = q -> _ptr; if (q + q -> _size == p) { q -> _size += p -> _size; q -> _ptr = p -> _ptr; } else q -> _ptr = p; _allocp = q; /* comment out ----- printf("In free: new _allocp = %x\n", q); ----- end comment out */ } /* define max(), min(), abs() */ int abs(n) { return (n<0) ? - where the string pointer points. Usage: sprintf(string,format,arg1, arg2, ...); */ sprintf(buffer,format) char *buffer, *format; { _spr(buffer,&format); /* call _spr to do all the work */ } /* sscanf: Reads a line of text in from the console and scans it for variable values specified in the format string. See the comments below in _scn() Usage: sscanf(format,&arg1,&arg2,...); */ int sscanf(line,format) char *line, *format; { return _scn(line,&format); /* let _scn do all the work */ } /* General formatted output conversion routine, used by fprintf and sprintf..."line" is where the output is written, and "fmt" is a pointer to an argument list which must consist of a format string pointer and subsequent list of (optional) values. The arguments are, of course, passed on the stack. */ _spr(line,fmt) char *line, **fmt; { char _uspr(), c, base, *sptr, *format; char wbuf[MAXLINE], *wptr, pf, ljflag, zfflag; int width, precision, *argn : n; } int max(a,b) { return (a > b) ? a : b; } int min(a,b) { return (a <= b) ? a : b; } /* The following functions from stdlib2.c are on this file: printf _spr scanf _scn _puts (renamed by analogy to _get) swapin The following functions from stdlib2 have been deleted: fprintf sprintf scanf sscanf fputs fgets Many comments have been deleted from these functions. See STDLIB2.C if you are really interested. Each function uses an array of dimension MAXLINE. Make sure MAXLINE is longer than the largest line ever printed! Remember to put out a 0x1a (control-Z, CPMEOF) at the end of text files being written out to disk. Also remember that there are two end of file conditions: -1 and CPMEOF. */ /* printf usage: printf(format, arg1, arg2, ...); Exactly the same as in Kernighan & Ritchie. */ printf(format) char *format; { char line[MAXLINE]; _spr(line,&format); /* use "_spr" to form the output */ s; format = *fmt++; /* fmt first points to the format string */ args = fmt; /* now fmt points to the first arg value */ while (c = *format++) if (c == '%') { wptr = wbuf; precision = 6; ljflag = pf = zfflag = 0; if (*format == '-') { format++; ljflag++; } if (*format == '0') zfflag++; /* zero-fill feature test */ width = (isdigit(*format)) ? _gv2(&format) : 1; if ((c = *format++) == '.') { precision = _gv2(&format); pf++; c = *format++; } switch(toupper(c)) { case 'D': if (*args < 0) { *wptr++ = '-'; *args = -*args; width--; } case 'U': base = 10; goto val; case 'X': base = 16; goto val; case 'O': base = 8; /* note that arbitrary bases can be added easily before this line */ val: width -= _uspr(&wptr,*args++,base); goto pad; case 'C': *wptr++ = *args++; width--; goto pad; case ' /* comment out ----- _puts(line); /* and print out the line */ ----- end comment out */ putlin(line, STDOUT); } /* scanf: This one accepts a line of input text from the console, and converts the text to the required binary or alphanumeric form. (see K & R) Usage: scanf(format, ptr1, ptr2, ...); Returns number of items matched. Since a new line of text must be entered from the console each time scanf is called, any unprocessed text left over from the last call is lost forever. This is a difference between BDS and UNIX. The field width specification is not supported. */ int scanf(format) char *format; { char line[MAXLINE]; /* comment out ----- _gets(line); /* get a line of input from user */ ----- end comment out */ getlin(line, STDIN); return _scn(line,&format); /* and scan it with "_scn" */ } /* sprintf: Like fprintf, except a string pointer is specified instead of a buffer pointer. The text is written directly into memory S': if (!pf) precision = 200; sptr = *args++; while (*sptr && precision) { *wptr++ = *sptr++; precision--; width--; } pad: *wptr = '\0'; pad2: wptr = wbuf; if (!ljflag) while (width-- > 0) *line++ = zfflag ? '0' : ' '; while (*line = *wptr++) line++; if (ljflag) while (width-- > 0) *line++ = ' '; break; default: *line++ = c; } } else *line++ = c; *line = '\0'; } /* Internal routine used by "_spr" to perform ascii- to-decimal conversion and update an associated pointer: */ int _gv2(sptr) char **sptr; { int n; n = 0; while (isdigit(**sptr)) n = 10 * n + *(*sptr)++ - '0'; return n; } /* Internal function which converts n into an ASCII base `base' representation and places the text at the location pointed to by the pointer pointed to by `string'. Yes, you read that correctly. */ char _uspr(string, n, base) char **string; unsigned (&line),base) == ERROR) return n; while ((c = _bc(*line++,base)) != 255) val = val * base + c; line--; break; case 'S': _igs(&line); sptr = *args; while (c = *line++) { if (c == *format) { format++; break; } if (!sf) *sptr++ = c; } if (!sf) { n++; *sptr = '\0'; args++; } continue; case 'C': if (!sf) { poke(*args++, *line); n++; } line++; continue; default: return n; } if (!sf) { **args++ = val * sign; n++; } }} return n; } /* Internal function to position the character pointer argument to the next non white-space character in the string: */ char _igs(sptr) char **sptr; { char c; while (isspace(c = **sptr)) ++*sptr; return (c); } /* Internal function to convert character c to value in base b , or return ERROR if illegal character for that base: */ inn; { char length; if (n b-1) return ERROR; else return c; } /* _puts: Write out the given string to the console. A newline is NOT automatically appended: */ _puts(s) char *s; { while (*s) _putchar(*s++); } swapin(name,addr) char *name; /* the file to swap in */ { int fd; if (( fd = _open(name,0)) == ERROR) { printf("Swapin: cannot open %s\n",name); return ERROR; } if ((_read(fd,addr,512)) < 0) { printf("Swapin: read error on %s\n",name); _close(fd); return ERROR; } _close(fd); return OK; } QSOR_SWЋATOISALPHISUPPEISLOWESISDIGIԉISSPACſTOUPPETOLOWEGALLOÓFREŃAB MAE MIu PRINTƥ SCAN SPRINT: SSCANf _SPҔ _GVs_USP_SCΰ_IGN_Bê_PUTnSWAPIεhe buffer "str" until a COLON or null byte is encountered. */ int _scn(line,fmt) char *line, **fmt; { char sf, c, base, n, *sptr, *format; int sign, val, **args; format = *fmt++; /* fmt first points to the format string */ args = fmt; /* now it points to the arg list */ n = 0; while (c = *format++) { if (!*line) return n; /* if end of input string, return */ if (isspace(c)) continue; /* skip white space in format string */ if (c != '%') { /* if not %, must match text */ if (c != _igs(&line)) return n; else line++; } else { /* process conversion */ sign = 1; base = 10; sf = 0; if ((c = *format++) == '*') { sf++; /* if "*" given, supress assignment */ c = *format++; } switch (toupper(c)) { case 'X': base = 16; goto doval; case 'O': base = 8; goto doval; case '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is{``in}%J! ! s#r! 6#6! s! s! s͐n}-Ÿ! ^#Vr+s! 4͐n}0¯! 4͐n&|! !! s#r! ^#Vr+sn`is{.! ! s#r! 4! ^#Vr+sn`is`in& }DCUXʈOʑCS4͐~#fo|! sl! n& |g! n&sl!! n! n&+ҋ!Ô! n& *0BMSe_PUTCHA2!9DM͐n}0! ^#Vr+sn&*._OPEPRINT_REA_CLOS!9DM!͐`is#rzE͐!!Ê!͐͐ |{͐!͐ !Ê͐ !Ê!9Swapin: cannot open %s Swapin: read error on %s !/7;CT\dhry_GETCHAKBHIC_UNGETC]_PUTCHAq_PUTCȲ_GETRAN SRAN:SRANDNRANCSSETMEMOVME*_CAĽCALLINOUTPEEPOK SLEEPAUSWSETFCk_REAĔ_WRIT_OPEΌ_CLOS_CREA_UNLIN'_SEEATEL_RENAMFABORT FCBADDh _EXI} BDOӅ BIOӝ CODEN EXTERN ENDEX TOPOFME EXE EXEC SBR RSVST˻ _RREA _RWRITe _RSEE _RTEL< _RSREV _RCFSIz FО o#|>͐P`i^#Vr+s!P!9h!9DM͐k*! s#r͐͐ \`is#r͐ +|͐#& 6C#6O#6M/[!w#w#*w#<:**S*!Âѷʤ!Å(0BN7*!9& 6C#6O#6M/*|E!\&W!\&*|W!!l&!~#foʏ> +͆#~t##ha{ !p!*w#œ:**ʳ*!ѷ! (5CRou~1 *&+*|/g}/o#9*&#"z{  "7:)~:,"s!"u*|*u/**s!ѷfUO! ! ~a6*u*+"*"*u#"u*s! N#Fp+q"+EJ]v7:)~:,"s!"u*|*u7*~#?"*s"*u#"u*+"*s! N#Fp+q*3EtG7:,?*:4="4#?*!s#r!^#V .7:,!^#V7:,$!~#fo7:,#!~#fo7!&:_!og(2;DMV]͌̀m.mv.ḿ.m.]ͫ*]5:wo2w&!o 2 . &%:w&o o&:wo2w&6    _ * & _    - 6  #F#x(~#&(*>H7*|g}o"zg{o"|g i |""E ! ###""  Wait a few seconds, and type a CR: $(PUT) !xV ###"" PUT7*|&*"*"*"|P*!Z ##7""":2!6#]! ~W!~w# vzҗ!w# o g!?/w#ª+~g:oŇ#*1CFILQV[bhq|o&7**:Ozq#Q7*|DM**K/><#~# x# >@w#> w! !Uf! U>2!:G~!~!=!]!6!)͆!4H!36>2!~p!>0*w#"!5ʹ͆U!5! c2c2!]!)!)!=!)*6E#:/<26-#: 2 >0w#:0w#6!]́!5!]́!47~/w# ɯ# !ɧ~w# *ɧ~w+ 4ɧw# >ɧ# J6# Uw n& 7*:w1 #+| 'z   /   7*~#  +*&! v7:)~:,"s!"u*|V**s[! ~V6*u*+"*"*u#"u"(HRth7:)~:,"s!"u*|*uf*~#="*s*uf#"u*+"*3CVdD7,2q*&:q):<=<=r:qo&.4#UNLINOPE1 7*\!*, !\&!TELk7:,*:*(}|2q YO:qwJ! {w%9H]& , FNxg>Goy$$![7*!*&*!:&*!, !\&!TELk  )6! ) , 7:O*o`$7*+++:G_*DM!o&****+7*!9# ]:2x!!:w:!ffffP "),/$WZ369<?BEHKNQTbjnu}  !$),/369<@DGJMPSVY^aknsw| $),/7:=@EIMRUZ]adgjmruz $',147;>CFKNSV\adhknquz}  %0:EQZcgjnqvy|SV\adhknquz}  %0:EQZcgjnqv.cm comments about the files on this disk .cm source: bds.doc .cm version: December, 1981 .bp 1 .he 'bds.doc''%' .fo ''-#-'' .ul Primitives The following files contain the software tools primitives written in BDS C: TOOLS.H, DATE.BDS, Fch are written in assembly language. Note that some of the names in this file have been changed. This file was, of course, created with CLIB. The file COPY.BDS is a test propram for the primitives. The file ARGS.BDS also contains a main() function which is a test of I/O redirection. The file SYMTAB.BDS contains a main() function which is a test of the symbol table primitives. The .SUB files on this disk are SUBMIT files used to compile or link the primitives. The file TOOLS.SUB simply compiles all the primitives. The files LINKARGS.SUB, LINKCOPY.SUB, and SYMLINK.SUB link the files ARGS.BDS, COPY.BDS, and SYMTAB.BDS. Note that linking all the primitives together is fairly complicated at this stage. .ul Utilities and documentation The file RAT2C.BDS is a filter which converts RATFOR-style comments into BDS C style comments. At present this program is the only tool that I have for converting RATFOR programs to C program. The file CONVR2C.DOC tells what has to be doILE.BDS, RAWFILE.BDS, ARGS.BDS, MISC.BDS, STORAGE.BDS, STRING.BDS, CONVERT.BDS, SYMTAB.BDS, and PATTERN.BDS. The file TOOLS.H contains all global variables and declarations used by the BDS C version of the software tools primitives. This file must be used in ALL programs instead of BDSCIO.H. This file contains portions of BDSCIO.H and RATDEF. See the file TOOLS.H for more comments. The files FILE.BDS, RAWFILE.BDS, ARGS.BDS, MISC.BDS implement the I/O primitives and I/O redirection. (MISC.BDS contains some odds and ends.) I have been using them for several months now with no problems. The file STORAGE.BDS contains the dynamic storage allocation primitives. This file simply calls the BDS C allocation primitives. The file STRING.BDS contains string manipulation primitives. Not all the primitives on this file have been debugged. The file CONVERT.BDS contains various conversion utility routines. Not all of the routines on this file have been converted from RATFOR to BDne to convert programs from RATFOR to C. You may be surprised (or shocked) to see how difficult it is. The file CHANGES.DOC tells what changes should or could be made to the primitives. The contents of this file are only opinions, but I hope they will form a starting point for future discussions. The file FILE.DOC tells how the primitives implement I/O redirection. Some of this information can also be found on TOOLS.H. .cm changes made to primitives .cm source: changes.doc .cm version: October 15, 1981 .bp 1 .he 'changes.doc''%' .fo ''-#-'' This file discusses changes that I made to adapt the primitives from the Software Tools Users Group to the environment of BDS C. As I mentioned in the file CONTENTS.DOC, these changes are not very satisfactory. The resulting primitives are compatible with neither the Software Tools Primitives nor the Unix primitives. However, many of the primitives supplied by tS C. The ones that have not been converted are commented out. The file SYMTAB.BDS contains symbol table creation, deletion, and lookup routines. These routines are used by the ROFF program, but you still might want to revise them extensively. There are more comments on the file SYMTAB.BDS. The file PATTERN.BDS contains pattern-matching and set manipulation primitives. None of the primitives on this file have been completely converted to BDS C and debugged. Indeed, the primitives on this file are in various stages; some are mostly RATFOR still while others are mostly BDS C. The file TOOLIB1.BDS contains most of the library routines from STDLIB1.BDS and STDLIB2.BDS. Some of the routines were modified for use with the directed I/O routines. Some of the names of routines were changed to avoid conflicts. Some of the BDS C routines were deleted. See the comments on the file TOOLIB1.BDS for more details. The file TOOLIB2.CRL contains the object for all the BDS C routines whihe Software Tools Users Group have no analog in the Unix primitives. Thus, it will still pay you to look at the primitives and see what you can use. .ul Changes made to BDSCIO.H All global definitions used by BDS C and the Software Tools have been combined into the file TOOLS.H. The following changes have been made to BDSCIO.H: 1. I have not included the constants for terminal characteristics, serial port characteristics or modem characteristics. I really don't see why these are needed in .ul every program. However, the definition for ESC does appear in TOOLS.H. 2. The definition of MAXLINE has been moved so that it appears with all other constants which affect data structures. 3. Ditto for NSECTS, BUFSIZ and struct _buf. 4. Since the Software Tools assume that dynamic storage is available, I have removed the ALLOC_ON and ALLOC_OFF definitions. All tools compiled with TOOLS.H will have access to struct _header and the variables _base and _allocp. I think this is aict with the names of the primitives used by the Software Tools. The following BDS C routines were changed by prefixing them with an underscore character: close, creat, exit, fclose, fcreat, fflush, fopen, flush, getc, gets, getchar, open, putc, puts, putchar, read, rename, rcfsiz, rreed, rseek, rsrec, rtell, rwrite seek, ungetch, unlink, write The routines getc(), putc(), and ungetc() are now defined on file FILE.BDS rather than on STDLIB1.C. These routines had to be completely rewritten to allow for I/O redirection. Some other changes were made to the code in TOOLIB1.BDS to allow for I/O redirection. See that file for more details. .ul Changes made to the Software Tools Primitives 1. The calling sequence of getch() was changed. old calling sequence: c = getch (unit, &c) new calling sequence: c = getch (unit) The change was made because the old calling sequence is awkward in a C environment. The old sequence was used because the following is not l reasonable scheme because there are lots of variables whose names start with either _ or SYS_. We might as well just prevent the user from using variables and functions which start with those characters. Another reason why this decision seems reasonable is that the dsinit() primitive makes it unnecessary for programs to access _base and _allocp directly. .ul Changes made to RATDEF: 1. I have eliminated many of the definitions for ASCII control characters. This was done in an effort to control the number of names that the system is supposed to define. 2. I have eliminated all of the definitions for individual letters. For instance, I see no reason to define BIGA as "A". In RATFOR, there is a reason, but not in C. 3. I have eliminated most, but not all, of the definitions for printable ASCII characters. I have kept only those characters that may not appear on most keyboards or which might be confusing inside quotes. 4. I have eliminated most RATFOR language extensions becausegal in a RATFOR environment: while ((c = getch(unit)) != EOF) { 2. The calling sequence of getarg() was changed. old calling sequence: arg = getarg (n) new calling sequence: p = getarg (n) In other words, the new version of getarg() returns a pointer to the argument where the old version copied the argument. The change was made because there is no need for getarg to actually copy an argument. Returning a pointer to an arg is more natural in C. 3. Getwrd() changes one of its parameters. Thus, the calling sequence must be: j = getwrd (in, &i, out); 4. The old definition of type() is absurd. There is, in fact, not much use for this "primitive" in C. I suggest that type() return "a" for alphabetic characters, "0" for numeric characters, and the character itself for all other characters. See STRING.BDS for the new definition of type(). 5. Stcopy() changes one of its parameters. Thus, the calling sequence must be: stcopy (from, i, to, &j); 6. The C version of ie they already are a part of C. Indeed, their purpose was to make RATFOR look more like C. 5. I have eliminated most of the "manifest constants". These are either unneeded or are duplicates of BDS C constants. 6. I have (reluctantly) kept most of the constants which affect the size of data structures. This is one area where having pointers eliminates a lot of Mickey Mouse declarations that do absolutely nothing. There is a real difference between: int vector[] /* in C */ and integer vector (ARB) # in RATFOR. The diffence is that there are a lot fewer irrelevant names (I'm talking about ARB) to worry about. 7. I have eliminated the DRIVER and DRETURN macros. I don't know how to implement them in BDS C. 8. I have inserted declarations for variables used by my implementation of the primitives. These declarations are needed in TOOLS.H only because BDS C does not have STATIC variables. .ul changes to BDS C routines The names of several BDS C routines conflndex must return one less than the RATFOR version of index because C arrays start at 0, not 1. 7. The length() primitive in RATFOR is a duplicate of the BDS C strlen() routine. 8. The RATFOR ctoi() routine changes one of its arguments. Thus, the calling sequence must be: ctoi (string, &i); 9. I have not examined (or converted) many of the routines in CONVERT.BDS or PATTERN.BDS. I can't say for sure what may have to be done. However, many of the routines in PATTERN.BDS change their arguments. Thus, the calling sequences for these routines will have to contain the & character. 10. As I have said before, I don't exactly know what to do with the routines in SYMTAB.BDS. The routines there do work, but they assume that the information field associated with a symbol is a string terminated by an EOS. This is not a very good way to design an important primitive. See the comments and code in SYMTAB.BDS for more details. ration. .ul changes to declarations .ti +3 The RAT4 keywords function and subroutine must be eliminated where they appear. .ti +3 RAT4 groups parameter declarations with declarations of local variables. In C, these two declarations are separated by a {. .ti +3 The RAT4 keyword integer and character must be changed to int and char. .ti +3 The RAT4 keyword pointer indicates (probably) that the variable is an int whose address will be passed (via &) as an actual parameter. It is not clear whether the RAT4 usage of pointer is consistent with good C coding practice. .ti +3 As mentioned before, include statements inside RAT4 subroutines must be eliminated. .ti +3 The RAT4 data statement can not be simulated directly without C initializers. An alternative is to create global variables which are initialized at run time. .ti +3 The names of functions which are used by a RAT4 subroutine appear in the declarations of that routine. These declarations must be eliminated from C.cm How to convert from RATFOR to C .cm .cm source: convr2c.doc .cm version: May 22, October 14, 1981. .bp 1 .pl 66 .rm 60 .he 'convr2c'RATFOR to C conversions'%' .fo ''-#-'' .ul introduction .ti +3 This file tells what I had to do to convert a large program (ROFF) from RATFOR to C. Most of this file was written just after I finished the project, so it is quite complete. .ul general changes .ti +3 Comments must be changed from RATFOR style to C style. RAT4 comments start with # (outside strings) and continue to the end of the line. C comments start with /* and continue to */. The program rat2c converts from RAT4 comments to C comments. .ti +3 Multiple spaces may be replaced with tabs. The routines entab() and detab() are only marginally useful for this. .ti +3 RATFOR define statment must be replaced by the C #define. The RATFOR define looks like: define (a,b) The C define looks like: #define a b Note that the C define must start in column 1. No arithmet programs. (The C compiler thinks local variables are being declared.) .ti +3 RAT4 uses parens to declare arrays. C uses square brackets. .ul changes to executable statements .ti +3 The biggest problem is probably subscripts. (See below for a more semantic problem with subscripts). RAT4 uses parens for both actual parameter lists and array subscripts. C uses parens for parameter lists, but square brackets for subscripts. Clearly, whether to convert to square brackets depends on knowing whether an id is an function or not. .ti +3 In C, all statements must end in semicolons. Once again, a full RAT4 parser is needed in order to know where to put the semicolons. .ti +3 RAT4 assignment statements like: .in +5 i = i + 1 .br .in -5 can be changed to: .in +5 i++; .br .in -5 .ti +3 In RAT4 functions, the name of the function is used as a variable which denotes the value returned by the function. In C, the name of a function denotes recursive execution. In C, a new lic is allowed in the C define. .ti +3 RAT4 had the ifdef and ifnotdef pseudo ops. These may have to be changed in some versions of C. They can be replaced by just commenting out code or by creating runtime global variables corresponding to compile time variables tested by the ifdef. .ti +3 RAT4 uses includes inside each program for including declarations of variables. In C, these #includes appear once at the start of each file. The includes inside each RAT4 program must be commented out and replaced by a single set at the start of the C file. .ti +3 Printable character constants can be eliminated from C programs. I think that RAT4 uses them to get around problems with character sets. At the present time I can see no reason to have constants for printable characters. I may be wrong though. .ti +3 RAT4 common blocks must be replaced by global variables declared in a header file. Array dimensions must appear in the variable declarations in C rather than in the common block declaocal variable must be declared inside the function and the function must return a value with a return(value) statement. .ti +3 My version of C does not have a repeat statement. The RAT4 statement: .in +5 repeat { ... } until ( ) .br .in -5 must be replaced by the C statement: .in +5 while (1) { ... if ( ) break; } .br .in -5 .ti +3 The RAT4 statement next must be replaced by the C statement continue. .ti +3 RAT4 uses call statement. C does not. RAT4 calls with no arguments do not need actual parameter lists. In C, a function with no arguments still needs (). .ti +3 In RAT4 all arrays start at 1. In C all arrays start at 0. This means that array declarations will have to be changed, as well as all code that refers to the limits of arrays. In practice, a semantic analysis of how .ul all variables of a program are used is required. Almost every part of a program might need to be changed: initialization of variables, for loop indices, actual parameters, etc. . system maintains the following file information: int sys_spec [SYS_STD + MAXOFILES]; int sys_bufp [SYS_STD + MAXOFILES]; int sys_bufn [SYS_STD + MAXOFILES]; .ti +3 As you can see, there is one entry in each array for each unit. If sys_bufp [unit] != ERR then I/O is assigned to the file whose buffer is sys_bufp [unit]. Otherwise, if sys_spec [unit] != ERR then I/O is assigned to either special unit 3 (the console) or 4 (the line printer). If sys_bufp [unit] == sys_spec [unit] == ERR then the unit is not open. .ti +3 Note that both sys_bufp [unit] and sys_spec [unit] may be non-ERR. In this case the unit is NOT a special file, it is a disk file. In other words, sys_bufp [] is checked before sys_spec [] in getch1() and putch1() and close() and flush(). This is somewhat of a kludge, but it makes open() simpler. .ti +3 The array sys_bufn [unit] is used only by open() and close(). sys_bufn [] keeps track of which disk files (0 -- (MAXOFILES - 1)) have been assigned. Close() ti +3 RAT4 uses call by reference. C uses call by value. This means that if a RAT4 subroutine changes any of it's arguments, the C routine will have to pass a pointer to a variable, rather than the variable itself. The C routine will have to change the variable via indirection. This also means that C programs do not have to protect there arguments from change like RAT4 programs do. .ti +3 RAT4 uses & and | to indicate AND and OR. C uses && and || to indicate boolean AND and OR. C can use & and | only if each relational clause joined by & and | is fully parenthesized. .ti +3 For best portability RAT4 uses the construction: .in +5 junk = func() .br .in -5 even when junk is not going to be used. This is not needed in C. .cm File primitives for Software Tools .cm source: file.doc .cm version: August 9, 1981 .bp 1 .rm 60 .pl 66 .he 'file.doc'File primitives for Software Tools'%' .fo ''page #'' .ti +3 This file discusses the file primitives for the software tooluses sys_bufn [] to deassign disk files. Sys_bufn [] may not really be needed, but without it close() would have to do some hairy pointer subtraction and division on sys_bufp [] in order to figure out what disk file was being closed. It seems simpler to use sys_bufn []. .ul system initialization routine .ti +3 initst() initializes all system data areas. It puts the command line arguments in sys_args[] and puts the number of command line arguments in sys_narg. It redirects I/O if requested on the command line. This is done by calling _assign() which in turn updates the arrays sys_spec [], sys_bufp [] and sys_bufn []. clink args file rawfile misc string toolib1 toolib2 file ile misc string toolib1 toolib2 d); } turn *iobuf -> _nextp++ clink copy -s args file rawfile string misc toolib1 toolib2 EprompJisattKputliLflusMgetliNputdeTitoUputVreads. .ul file open routine .ti +3 READ, WRITE, READWRITE, and APPEND are global constants known to all programs. .ti +3 WRITE access implies erasing the file first. READWRITE and APPEND access are currently illegal. .ti +3 If name = TERMINAL then open() must assign the I/O to the user's console. If name is PRINTER then open() must assign the I/O to the line printer. Note that because BDS C truncates names at 8 characters, the name TERMINAL is the same as the names TERMINAL_IN and TERMINAL_OUT. .ti +3 open() returns unit numbers to the user. Units may be assigned to disk files, the console, or the line printer. open() never returns unit < SYS_STD. .nf Unit 1 is reserved for standard input. Unit 2 is reserved for standard output. Unit 3 is reserved for error output. Unit 4 is reserved for the console. Unit 5 is reserved for the line printer. .fi .ti +3 open() might save the file name for the software tools error routines. At present it does not do so. .ti +3 Thexsub clink symtab storage args misc string file rawfile misc toolib1 toolib2 ren toolib2.brl=toolib2.crl era *.crl ren toolib2.crl=toolib2.brl cc1 file.bds cc1 rawfile.bds cc1 toolib1.bds cc1 args.bds cc1 string.bds cc1 misc.bds cc1 convert.bds cc1 date.bds string.bds cc1 misc.bds  if (fd == SYS_TERM) { BDS_pchammand line arguments in sys_args[] and puts the number of command line arguments in sys_narg. It redirects I/O if requested on the command line. This is done by calling _assign() which in turn updates the arrays sys_spec [], sys_bufp [] and sys_bufn []. clink args file rawfile misc string toolib1 toolib2 file ile misc string toolib1 toolib2 d); } turn *iobuf -> _nextp++ clink copy -s args file rawfile string misc toolib1 toolib2 EprompJisattKputliLflusMgetliNputdeTitoUputVread ', , <=?BDACEFG@H_U1ʮQv6[W]o$)t o/_<&{8*o/^<W\%I/^ivTPKERM.HLPC  !"#o$%'&(*)+,-.0/21364579:8;<=?>BA@4(=yJhZYߩiE] ab\Q4jE5im )Zoͭxsiamjc'#yL7U\\fO Bor|jmnѣ%͹՟5dw*H+[a5UR!mF.oi#k #_mOb;?eȸ-vH. Y+;u3rT?kXU*5¤Nv=4TǧϹa5צ 9Қy.:m#CseU~TRt+dkڜKc8NSm/5e?#! ^uW|1m7s륆j-I1驓]6^*x;tXvA6K`8>n2tXAƗp-ao2t_nKm| e|70ow,/|7;?t-Ǘ ,0oɂlƗ Od3t[naor+ƗpE;s|7rg/x{Kɿo!_ Y3=C&zxՋհ2ū^4M/^| y2;xqk2ɸ*oV_n3d\OwZ~ neȓq=9hUxhx<} Ә'zsz[Jɸ*I .WQ!Ot砍cT<ӝ_yT+zy2;<} Ә'zsz[ ȸ1ɸv} Ә'zsWy`A2ū6!Ot<`V<ӝ[m W62y2;۾TѴZ!Unȓq=9hcU@1Ot/A+U4zy2;<} <ӝ[m WDƍ!Ot砍cT<ӝ_;xd\Ow/^| y2;xq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|u)go*k|چ)?go|g}o|*k)))*)^#V͹C*R*k}o|g))P͜C*k#"k*k*z|}|:6>!&,ͺ!<*#"**z|'}|^ *)A6>!,!+ͺ!+ͺ<*)^#Vͱ!+ͺ!r+!Y+!,+ͺ<@rͧCr@ͧC@rQ3!`͗?C"@Q3!`͗?C"*|=)p*|M)p*|])p*|m)s6>*ͱ!+<*a+"a*[+"[*[|!*)"^#V*}o|C>ͲBG 6>!ͺ!U'<6>! '<6>!"3<6>!&<6>!q&<6>!-&<6>!"3<6>!%<6>!%<6>!D%<6>!$<6>!$<6>!$<6>!L$<6>!8$<! "6>!YCͺ!$@!9ͧC]!6>!ͺ<"6>!"3<^ 6>!#<6>!#<6>!"3<6>!#<6>!`#<6>!4#<6>!#<6>!"<6>!"<6>!"<6>!l"ͺ<5o"9 - COMMAND SUMMARY&"6 - PROGRESSIVE GALAXY DISPLAY 7*"5 - DAMAGE CONTROL REPORT 6 | 8)"4 - PHOTON TORPODOES / | \-#3 - PHASORS 5---- * ----1)7#2 - LONG RANGE SCAN \ | /*c#1 - SHORT RANGE SCAN 4 | 2� - FIRE WARP ENGINES 3-#============== ===============-#COMMAND SUMMARY DIRECTION CHART$$HIT ANY KEY TO CONTINUE 7$=;$a Klingon nearby.EO$torpodeos could destroy the home base, so shoot carefully if there isJ$To refuel and re-arm the ship must be docked at a home base. Remember that$use the chart below.I$are o*&^#V*}o|2*#"*|/)*)8s#r×*)))*)x^#V|y6>!+<@gy3ͧCg×6>!"3<6>!*<@cy3ͧCc*)))*)xs#r*aSDd͹CwC Ac3AAgC*R)))*P)s#r6>!*ͧC A53A13!`ͻ?JDͧC*)B6>!*<|6>!"3<͉C36>!YCͺ!CT! #Bͺ<*)^#V<@e3ͧC*#"*|گ)j^ 6>!o*ͺ<*)^#Vͱ!C*!*ͺ<*)^#Vͱ!+ͺ!YCͺ!)<6>!)ͺ<*[ͱ!|)<6>!e)ͺ!*)<6>!)ͺ<!͎[oB )!o%?#͹C7AQ3!`͗?A3CBz56>!YCͺ!(<6>!(nly a limited number, and they must be aimed accurately. For aiming,HG%on Klingons is cumulative. Photon torpodoes do not use energy, but thereO%ship's energy, but they destroy any klingon within range. The effect of PhasorsI%Klingons are destroyed by Phasors and Photon torpodoes. Phasors drain theA0&to the width of one quadrant. For direction, use the chart below.Lt&is determined by the warp factor - a factor of 1 corresponding approximatelyI&To move around the Universe, use the warp engines. The amount of movementF'Within each quadrant there are 64 sectors, identified in the same way.AX'by its row and column number, 1 to 8, starting from the top left.F'The Universe is divided into 64 quadrants. Each quadrant is referenced' !' 1 2 3 4 5 6 7 8 (PROGRESSIVE GALAXY SCAN'(ADMIRAL1(CAPTAIN ;(COMMANDER G(LIEUTENANTT(ENSIGN]( YEARS. RATING= o( KLINGONS IN (YOU HAVE BEEN PROMOTED TO (COMMANDER IN CHIEF(BOOT(THE FEDERATION HAS BEEN SAVED3(THE LAST KLINGON BATTLE CRUISER HAS BEEN<*m͹CwCIA,0wCIAu3<A8=A7A-3A7Am3!`͗?ͧC A3!`͗?CB #/,@)3s!(B|!(B6>!|(ͺ*mͱ!YCͺ!'*ͱ*k)))*SD=ͺ!"3<*#"*|)e^ *)H *P#"*P+/ *R#"*R+ *|)go*|)?go|g}o| *k|,)go*k|=)?go|g}o| *k)))*)^#VC ͹CͧCL*k)))*)^#VCd͹C`ALͧCP*k)))*)^#V͹C`AL`APͧCT*k)))*SD= AT3A%3CYC AP}3A%3CYC>@L%3CYC>ͲB*k#"k*k*z|' }|*#"**z|C }|*R)))*P)^#VC ͹CͧCL*R)))*P)^#VCd͹C`ALͧCP*R)))*P)^#V͹C`AL`APͧCT*R)))*PSD= AT3A%3CYC AP}3A%3CYC>@L%3CY DESTROYED!)yYnN) MENACE ONCE AGAIN ? 8-)DO YOU WISH TO ENTER INTO COMBAT WITH THE DEADLY KLINGONh)YOU WILL BE REPLACED)BATTLE CRUISERS LEFT.) KLINGON2)THE FEDERATION WILL BE CONQUERED. THERE ARE STILL !)THE ENTERPRISE HAS BEEN DESTROYED)IT IS STARDATE  * - ENERGY LEFT=$*ENTERPRISE HIT BY KLINGON AT SECTOR F*STARBASE PROTECTS ENTERPRISE e*DESTROYED!r*KLINGON AT SECTOR *DEVICE STATE&*DAMAGE CONTROL REPORT IS NOT AVAILABLE*TORPEDO MISSED.****HOME BASE DESTROYED. . .CONGRATULATIONS!***+STAR DESTROYED+***KLINGON DESTROYED***/+TORPEDO TRACK @+TORPEDO COURSE (0*1-8.9)=\+ALL TORPEDOES EXPENDED u+SPACE CRUD BLOCKING PHOTON TUBES + ENERGY LEFT= +ENERGY DRAIN=+KLINGON HIT AT SECTOR +NUMBER OF UNITS TO FIRE=++PHASORS LOCKED ON TARGET. ENERGY AVAILABLE= ,PHASORS OUT!),:-,#1,,!5,LONG RANGE SENSOR SCAN. QUADRANT Y,LONG RANGE SENSORS OUT!s,A THINGY BLOCKS YOU AT SECTOR , REPAIRS INITIATED. ,***TRUCE, , DAMAGED ***,***SPACE STORM, ,WARP DRIVE OUT, MAX SPEED=.2,WARP FAC\ѷ!>+ *OUT OF MEMORY* $dW> ʹ[W*c*c"c"c*c|W͵V*c|W͵V!c^#V#z!9"=5**ʑ5!6#}‘5|‘56!C56#z¤5*|5> 66#s#r#=º5>275>2:5>2952<5"?5!4"J5+4ñGH STO85f9*J5.. . .........͡F*X5|5:U5j6*S5|j6i8* s#r* {w#6"V5*=5*S5>2U5f9HError -!6~<ʐ6=ʐ6#~#6|6# H5Syntax Error in DATRETURN without GOSU Type MismatcOut of DatIllegal Function CalFloating OverfloInteger OverfloOut of Memor Subscript Out of Rang Division By ZerOut of String SpacString Formula Too CompleRESUME without Erro2Field Overflo3Internal Erro4Bad File Numbe5File Not Foun6Bad File Mod7File Already Ope9Disk I/O Erro:File Already Exist=Disk Ful>Input Past En?Bad Record Numbe@Bad File NamCToo Many FileUnprintable Erro!9N#F*~#~Қ8~+ʠ8~#~ښ8+^#V###x8###x8|ʬ8~#fo!8H Internal Error - No Line Number Ñ4*~#H9H at linei88f9>TOR (0-12)=-COURSE (0*1-8.9)="-GAMES*-N.- 1-COMMAND : >-KLINGONS LEFT=O-PHOTON TORPEDOES=c-ENERGY=m-SECTOR=w- - }-QUADRANT= -CONDITION= -REMAINING -STARDATE=- - ---G-FSHORT RANGE SENSORS OUT !-YELLOW-RED-GREEN"-OUT OF PARTS : NO REPAIRS POSSIBLE.DOCKED"$.Hit any key for more instructions.I.third is the number of stars.Ji.Klingons in the quadrant, the second is the number of home bases, and the K.data in the form of a three digit number. The first digit is the number of F/The long range scanner and the progressive galaxy display return theirM/can be made immediately.Kh/expected to take, but getting to a home base will usually mean that repairsG/is damaged the damage control report will indicate how long repairs areK0you may have to cope with space storms and wayward meteorites. If the ship KN0perils of space can never be eliminated, and apart from the deadly KlingonsH0Although you have been supplied with the best of materials and men, the L0you may be promoted, but /9<9(98/9<90](99}_|W!>9_~#fo>H at address|͓>}͓>f9> ]> ]!9"55*55)9|*?5*A5ʻ9))9) )9 9 9"A5"?5K!"`i]û9!͊9>!96\>p\g[>Ï\"\!\6\x>6\#.î\o g7%\*c!\#\##\*c##n&\!c \#7~4\4o&~#fo>5^^#VzG]G]ѧG]+^#Vc! o gB6]$>-&]%G]_6+6V]##͚\>2Ï\<{\&p]&GN#"9!9"9"9y29*H5|;*`5!;"X5A~#*9^~;ʠ;9;`J<;gJ"9b;n;͋H*`*`*`*`{;I*`{;tH*`*`*9^ʓ;~#"9,;;~;!"X5~,"«;#"~ʿ;ʿ;# ®;;";#"9x"; ;+~ ;y͆F{;H?Redo from Start *9͡F!<\<*9:9O;*9+~+@<2<2< +w 4.uɀI}~0 @L~@z@;L}uPzTHQfff)\ #}u{ #zQsH HH[[[[ BASLIB #900354 5.1 - OWNED BY MICROSOFT, 1979 <44#V#!DM*"D*G##"Dy5>2 424*^#V" 4##^#V"4!s5"p56#6P>2w5>2v5>2u5 4Í44Í4Ä4_p9yUڨ4! S6C#6O#6MS!\>! _KXtR\<[!9%.4>= _.44ot42h2|!"=H~# =x2?H:k5¿=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DIRECTION/DISTANCE CALCULATIONS.7l THIS OPTION ALLOWS YOU TO ENTER COORDINATES FOR. OPTION 4 = DIRECTION/DISTANCE CALCULATOR:& STARBASE WITHIN YOUR QUADRANT.8 THIS OPTION GIVES DIRECTION AND DISTANCE TO ANY (; OPTION 3 = STARBASE NAVGATION DATA:)f TO ALL KLINGONS IN YOUR QUADRANT.9 GIVES DIRECTIONS AND DISTANCE FROM THE ENTERPRISE$ OPTION 2 = PHOTON TORPEDO DATA:, AND STARBASES REMAINING IN THE GAME.<$ THIS OPTION SHOWS THE NUMBER OF KLINGONS, STARDATES,c OPTION 1 = STATUS REPORT:3 PREVIOUS SHORT AND LONG RANGE SENSOR SCANS.@ THIS OPTION SHOWES COMPUTER MEMORY OF THE RESULTS OF ALL+ OPTION 0 = CUMULATIVE GALACTIC RECORD:/+ THE LIBRARY-COMPUTER CONTAINS SIX OPTIONS: ] \COM\ COMMAND = LIBRARY-COMPUTER DAMAGED.; 'STATE OF REPAIR' SHOWS THAT THE DEVICE IS TEMPORARILY@ GIVES THE STATE OF REPAIR OF ALL DEVICES. WHERE A NEGATIVE& \DAM\ COMMAND = DAMMAGE CONTROL REPORTA: THAT THE STATUS DISPLAY TOTAL ENERGY INCLUDES SHIELD ENERGY.>~ SHIELDS. ENERGY IS TAKEN FROM TOTAL SHIP'S ENERGY. NOTE= DEFINES THE NUMBER OF ENERGY UNITS TO BE ASSIGNED TO THE \SHE\ COMMAND = SHIELD CONTROL3 COMPUTE TORPEDO TRAJECTORY FOR YOU (OPTION 2).;V THE LIBRARY-COMPUTER (\COM\ COMMAND) HAS AN OPTION TO ; THE PHASER FIRE OF ALL OTHER KLINGONS IN THE QUADRANT.? HIS PHASER FIRE. IN EITHER CASE, YOU AREPLANETS.< KLINGON WARWHIPS WHICH ARE MENACING THE UNITED FEDERATION OF:JENTERPRISE; YOUR MISSION: TO SEEK AND DESTROY THE FLEET OF;GALAXY TO BEGIN A TOUR OF DUTY AS COMMANDER OF THE STARSHIP; YOU WILL BE ASSIGNED A STARTING POINT SOMEWHERE IN THE?AND EACH QUADRANT IS FURTHER DIVIDED INTO AN 8 X 8 SECTOR GRID.7E THE GALAXY IS DIVIDED INTO AN 8 X 8 QUADRANT GRID, WILL BE ABORTED.? TYPE IN ILLEGAL DATA (LIKE NEGATIVE NUMBERS), THAT COMMAND= 'NAV' COMMAND COMES BACK WITH 'COURSE (1-9) ?'.) IF YOU<3. SOME COMMANDS REQUIRE YOU TO ENTER DATA (FOR EXAMPLE, THE,X LIST OF THE LEGAL COMMANDS PRINTED OUT.?2. IF YOU SHOULD TYPE IN AN ILLEGAL COMMAND, YOU'LL GET A SHORT8 COMMANDS (NAV,SRS,LRS,PHA,TOR,SHE,DAM,COM, OR XXX).;1. WHEN YOU SEE \COMMAND ?\ PRINTED, ENTER ONE OF THE LEGAL2B* * * SUPER STAR TREK INSTRUCTIONS * * *2w* *2**************************************************z@`[[[[ BASLIB  ALSO SUBJECT TO > CANNOT FIRE BACK AT YOU. IF YOU MISS, YOU ARE SUBJECT TO7U IF YOU HIT THE KLINGON VESSEL, HE IS DESTROYED AND? TORPEDO COURSE IS THE SAME AS USED IN WARP ENGINE CONTROL.& \TOR\ COMMAND = PHOTON TORPEDO CONTROL PHASERS TOO!): DEPLETE THEIR SHIELD POWER. (REMEMBER, KLINGONS HAVE8L ZAPPING THEM WITH SUITABLY LARGE UNITS OF ENERGY TO: ALLOWS YOU TO DESTROY THE KLINGON BATTLE CRUISERS BY \PHA\ COMMAND = PHASER CONTROL.9 EXAMPLE - 207 = 2 KLINGONS, NO STARBASES, & 7 STARS." KLINGONS.83 STARBASES, AND THE HUNDRESDS DIGIT IS THE NUMBER OF >B< = FEDERATION S#500240 5.2 - OWNED BY MICROSOFT, 1979 <99ʅ;J<DM*"#*&##"#û>2023*^#V"1##^#V"4 26!ʄ!!""7!"6#6P>2>2>203_͓͐4!16C#6O#6M!\>!!?1!\> >͑7]1\A>.2.ot#!#&\ѷ!>/ *OUT OF MEMORY* $=*!"ͳ<"> ͳ<> ó<> ͼ> ͼ*<~= G͗=!9"*1*+!6#}|6!6#z*/|> T6#s#r#=>2y>2|>2{2~"!"RÖ&& STO7͉*.. . ........͆%*|>:§*|ʧ͌*+ s#r*+ {w#6"**>2͉&Error -!~<=#~#ù#&1Syntax Error in DATRETURN without GOSU Type MismatcOut of DatIllegal Function CalOverfloOut of Memor Subscript Out of Rang Division By ZerOut of String SpacString Formula Too CompleRESUME without Erro2Field Overflo3Internal Erro4Bad File Numbe5File Not Foun6Bad File Mod7FilTARBASE (REFUEL/REPAIR/RE-ARM HERE!)$' +K+ = KLINGON BATTLE CRUISER&N = YOUR STARSHIP'S POSITION3w SYMBOLOGY ON YOUR SENSOR SCREEN IS AS FOLLOWS:/ SHOWS YOU A SCAN OF YOUR PRESENT QUADRANT.'\SRS\ COMMAND = SHORT RANGE SENSOR SCAN!  USE COURSE 3, WARP FACTOR 1.(- FROM QUADRANT 6,5 TO 5,5, YOU WOULD%X ONE QUADTANT. THEREFORE, TO GET$ ONE WARP FACTOR IS THE SIZE OF 2 COURSE! ITSELF IS EQUIVALENT TO 1.0.3 VALUES MAY APPROACH 9.0, WHICH 6 7 826 . . .1k WAY BETWEEN 1 AND 2). ...5 USED. (THUS COURSE 1.5 IS HALF- 5 ---- 11 INTEGER AND REAL VALUES MAY BE ...2  VECTOR ARRANGEMENT AS SHOWN. . . .3@ COURSE IS IN A CIRCULAR NUMERICAL 4 3 2&v\NAV\ COMMAND = WARP ENGINE CONTROL --OF THE STARSHIP ENTERPRISE:@ YOU HAVE THE FOLLOWING COMMANDS AVAILABLE TO YOU AS CAPTAINe Already Ope9Disk I/O Erro:File Already Exist=Disk Ful>Input Past En?Bad Record Numbe@Bad File NamCToo Many FileUnprintable Erro!9N#F*%~#~ҽ~+~#~ڽ+^#V###Û###Û|~#fo!& Internal Error - No Line Number *%~#k& at line͌É>R<7K!R<70G=K3}_|W!a=~#fo>& at address|"}"É> G=> G=!9"w*w~2#~#^#V&++|%^;(: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FF /JG)ϙ֘)ċ m$LCT*HA!8/ח:D)wQl[NeS)z̰ ZcT:tNPtݏOfXHUT1Sj/x >SR@h 1v]KBEKL;(?a$wKC194f269kƏ(@LcQ2aKE& N2#?DT2[rn{bkxT׼ FQ @ ֚uJRQ2Z7(Cp>/wnϒ+%~`jvx0+C1b+Ya kDGcRu{Bt  kZ KIa 4̡;g =Q8$+`I!n9TD3DX83c3:>3vfMwoc¢Q"BtDHcia!f( g hcivQY}VEE:ct lM=q>!|^wntF1N foG vĸK=W#񭒞[iFG!ېSS/h%5vs>M_=< :\UNW?V*MH,jp,*uX^OXJaaM/4̛YvvK QKr='=Cq Gm*Bf<ROH ֟!5YDc UgGT'Jo`Dgs -XRS?f(VYrD I;= hF7EEg aM55}YMqCcpnyLctNNx.C~PD'Q㐬`ԣeSrL/N5/4i66CuYE]b̏qb̉B_ޛzD#|j?9ѩsSw4!3y@oq\qNe NXUQ }] ;MN!v6hX.i%gl8A ; dK 1 ѦrW1 eԧצ__:4sEkMc E\4Smjf|/OCKŘ1uIMOZsVٱi8ǩ߿_NIt/i kno yo ar probabl ver excite abou th ne gam Trivia Pursuit hav locate ne twis o thi revolutionar game Compute Trivia Pursuit Tr runnin i b typin "TRIVIA a th comman line The afte yo hav goo tim playin wit th dat file tha ar supplied Creat you own Her i th form for data files. -top of page- ------------------------------------------------------------------------------- 1st line "title that you wish to come up in the first menu" 2nd line A/question?/answer1/answer2/answer3/answer4 etc./ ------------------------------------------------------------------------------- wit "A bein th correc choice th questio following an th answer on a tim separate b / Yo ma us thi for wit question tha requir operato inpu b th sam for above bu wit th a SORT COM`SORT PASbqSORTS DOC v4Copyright (C) 1983 BORLAND Inc Osborne 1= ()TERP<~7#~= o&ͦoͦc|ͣ}!!" ~#(}:8= +ͥ*!v-!pͥ*|!!:(=2!-: <2!~!!Y:jO:l:kO:m!ͥ*n! !i45(!+/ 0y0( d!9-!I-[[o&  :(y ͠|( r*"x2y( >28!"9!!>2 0&+!0 [ (!ePWA8Q0G: x@!\w# nswe i th ver firs collumn, and the question second, separated by /. Its that easy. Jus cal you dat fil "TRIVIAxx.DAT wher x i th numbe o th file 1 on up. Thi progra come fro unknow origi an d no remembe wha BB tha go i of of I give credit to A foreign source for this program. I yo want creat additiona file an pu the o thi system. for others to benifit. Thanks: Mike Stubblefield 528-3185  -top of page- ------------------------------------------------------------------------------- 1st line "title that you wish to come up in the first menu" 2nd line A/question?/answer1/answer2/answer3/answer4 etc./ ------------------------------------------------------------------------------- wit "A bein th correc choice th questio following an th answer on a tim separate b / Yo ma us thi for wit question tha requir operato inpu b th sam for above bu wit th a(   L). )!h6# (*(.(!8}(*(Ww#>?> w#a{ |e}nƐ'@'ý7||}>"C ""*B"[R*"^#V#^#V#N#FO/o&9O/o&9!9(> (G!9 w#EMw}8"RB0 >RRR!+k = R!+k = !+k = !+k = !#k = !+k = T]KB!z> S>))0 = |  DMgo>jB0 7?= H<͡z5)<z {0Gɯgo|| }||/g}/o#}o&K[xAJSJDM!b"!6J"DM'oodo o} $yWx(>-q{(ay(oe z(>.q (o =e{>Eq>+|(|Dg>-q|/ 0:p# ~# +>0w#,-  60# ˸}րogM͇| .( = ~> x0w#xG% % ZJDM% = _~65(+~hìx-Sx9?+{Η@}|  gZJDM0 ,7}o˸ #yO!@9i&  #w#/w#w#!9! E9!!9~(+FM!"9!(#>2*u"|>":( E *6#w*6#6 !\$!u[ (W( #:~CONTRMKBDLSTAUXUSR>2ͭ*#~ u*:> >w###6Õ  #6++p>2Su:*6###ww#w$w#j _}8(8J`9{T]=o`9y $͙ >" 8# }>(́ x }} ˸T}ٕ(0D= ,= (  0% , 7 R ?(88 x  - 8˸x   ͠ ,-xG} }م 9 .>#n0  = - nx  ,-(-˸G,- }ٕ? 9.>R 88 ?= u+-(> 08  8R ?x  , 78ƀ8ƀ8ox٨!دoGOW_gɷɷ|لg{ً_zيWyىOxوG|ٔg{ٛ_zٚWyٙOx٘Gxٸyٹzٺ{ٻ|ټx٨u xx( ?}ٽR }ց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~+)^#VJ!*'~+) R,!*,CR-,!*e,HRE,!*,IR],!*g!,LRu,!*1&,QR,!*3",RR°,!*M#!*g!,SR,!*̈́%,TR,!*I'@ endO*&E-*+}õ!}͛O@Options:OO! e.! 0@B Bubble sort.O! e.! 0@C Count sort.O! e.! 0@D toggle Display of list.O! e.! 0@ H Heap sort.O! e.! 0@I Insertion sort.O! e.! 0@L sheLL sort.O! e.! 0@N Number of items to sort.O! e.! 0@P Presort master list.O! e.! 0@Q Quick sort.O! e.! 0@R quick sort 2.O! e.! 0@S Selection sort.O! e.! 0@ T Tree sort.O! e.! 0@X eXit program.OO@Your choice? !!}͚*}&}2}O*}&BR0CR0HR0IR0LR0QR0Red with one cell for each item in the list, and these cells are set to 1. Each pair of items is compared, and the auxiliary cell corresponding to the higher item is incremented. The auxiliary cells then give the number of items smaller than any given item, which establishes its position in the sorted list. *) procedure count(lb, ub : integer); var left, right, cell : integer; sorted : list absolute aux1; count : list absolute aux2; begin for cell := lb to ub do count[cell] := 1; for right := lb + 1 to ub do begin for left := lb to right - 1 do begin if (a[right] > a[left]) then count[right] := count[right] + 1 else count[left] := count[left] + 1; end; end; for cell := lb to ub do sorted[count[cell]] := a[cell]; for cell := lb to ub do a[cell] := sorted[cell]; end; (***** HEAP SORT *******************************************R0SR0TR%0*}&͛+Ù0DR?0*&}o}2Ù0NRS0!*Ù0PRg0*ͼ*Ù0XRw0rÙ0O@ Not on menu.O -}õ!}2 -r&}o}2-0NRN!*G0PRP*ͼ*[0XRXro0Otype list = array[1..2000] of integer; longlist = array[1..3199] of integer; var n : integer; (* number of items to sort *) toggle : boolean; (* controls display of list *) master : list; (* random values for sorting *) a : list; (* working list to be sorted *) aux1 : longlist; (* auxiliary arrays used by *) aux2 : longlist; (* count and tree sort *) (* Internal arrays in count and tree sort are forced to overlay aux1 and aux2 using the absolute address variable ability of Turbo Pascal. This saves some critical space in the program so tha*********) (* The items are rearranged into a "heap", where each item at position i is larger than the two items at positions 2i and 2i + 1. The top item in the heap is then repeatedly removed and placed in its final position, with the heap being consolidated after each such removal. *) procedure heap(lb, ub : integer); var cell : integer; procedure siftup(parent, top : integer); label done; var child, copy : integer; begin copy := a[parent]; repeat child := parent + parent; if (child > top) then goto done else begin if (child < top) and (a[child] < a[child + 1]) then child := child + 1; if (a[child] <= copy) then goto done else begin a[parent] := a[child]; parent := child; end; end; until (falt large lists can be sorted without a heap stack collision. *) (***** COMMON PROCEDURES USED BY SORTING ALGORITHMS *****************) procedure swap(var i, j : integer); var t : integer; begin t := i; i := j; j := t; end; (***** BUBBLE SORT **************************************************) (* The list is scanned repeatedly, and adjacent items that are out of order are swapped. When a pass occurs with no swaps, the list is sorted. *) procedure bubble(lb, ub : integer); var swapped : boolean; cell : integer; begin repeat swapped := false; for cell := lb to ub - 1 do begin if (a[cell] > a[cell + 1]) then begin swap(a[cell], a[cell + 1]); swapped := true; end; end; until (swapped = false); end; (***** COUNT SORT ***************************************************) (* An auxiliary array is creat!se); done: a[parent] := copy; end; begin for cell := (ub div 2) downto (lb + 1) do siftup(cell, ub); for cell := ub downto (lb + 1) do begin siftup(1, cell); swap(a[1], a[cell]); end; end; (***** INSERTION SORT ***********************************************) (* The first item is considered as the nucleus of a sorted lefthand sublist. Each succeeding item to the right is compared backward along the left sublist and inserted at the correct position in the sorted portion. *) procedure insert(lb, ub : integer); var cell, newcell, newval : integer; begin for newcell := lb + 1 to ub do begin cell := newcell; newval := a[cell]; while (cell > lb) and (newval < a[cell - 1]) do begin a[cell] := a[cell - 1]; cell := cell - 1; end; a[cell] := newval; end; end; (***** SIMPLE QUICK SORT *************************************** a[lb]; repeat repeat left := left + 1 until (a[left] >= pivot); repeat right := right - 1 until (a[right] <= pivot); if (left < right) then swap(a[left], a[right]); until (left > right); swap(a[lb], a[right]); quick2(lb, right - 1); quick2(left, ub); end; end; (***** SIMPLE SELECTION SORT ****************************************) (* The smallest item is found and placed in the leftmost cell. On each succeeding pass, the smallest remaining unsorted item is found and placed at the end of the sorted lefthand portion. *) {procedure select(lb, ub : integer); var left, right : integer; begin for left := lb to ub do for right := left + 1 to ub do if (a[left] > a[right]) then swap(a[left], a[right]); end;} (***** IMPROVED SELECTION SORT **************************************) (* In this faster version, most calls on swap are replaced by an explicit **) {$A-} (* compiler toggle to allow recursion *) (* A pivotal value is chosen and the list is rearranged so that all values to the left are less than or equal to the pivot and all values to the right are greater than or equal to the pivot. The same procedure is then called recursively to deal with the left and right sublists. When all sublists are of length one, the list is sorted. In this version, the pivot is simply chosen to be the leftmost member of each sublist. *) procedure quick1(lb, ub : integer); var left, right, pivot : integer; begin if (lb < ub) then begin left := lb; right := ub + 1; pivot := a[lb]; repeat repeat left := left + 1 until (a[left] >= pivot); repeat right := right - 1 until (a[right] <= pivot); if (left < right) then swap(a[left], a[right]); until (left > right); swap(a[lb], a[right]); quick1(lb, right - 1temporary variable, which represents the position holding the lowest item yet found at a given time during one pass. *) procedure select(lb, ub : integer); var left, right, low : integer; begin for left := lb to ub do begin low := left; for right := left + 1 to ub do if (a[right] < a[low]) then low := right; swap(a[left], a[low]); end; end; (***** SIMPLE SHELL SORT ********************************************) (* The list is divided into a number of interlaced sublists in which items are separated by a gap initially equal to half the length of the list. On each pass, the gap is cut in half until on the last pass, adjacent items are being compared. During each pass, items on each of the current sublists are sorted by insertion sort. *) {procedure shell(lb, ub : integer); var gap, left, right : integer; begin gap := (ub - lb) div 2; while (gap >= lb) do begin ); quick1(left, ub); end; end; (***** IMPROVED QUICK SORT *****************************************) (* This version includes two improvements: (1) The pivot is chosen to be the median of the leftmost, rightmost and middle items in each sublist; and (2) sublists of less than ten items are left unsorted. The partly sorted list can then be rapidly brought into complete order with insertion sort. *) procedure quick2(lb, ub : integer); const CUTOFF = 10; var left, right, pivot : integer; function med(lb, ub : integer) : integer; var mid : integer; begin mid := (lb + ub) div 2; if (a[lb] <= a[mid]) and (a[mid] <= a[ub]) then med := mid else if (a[lb] <= a[ub]) and (a[ub] <= a[mid]) then med := ub else med := lb; end; begin if (ub - lb > CUTOFF) then begin left := lb; right := ub + 1; swap(a[lb], a[med(lb, ub)]); pivot :=! for right := gap to ub do begin left := right - gap; while ((left >= lb) and (a[left] > a[left + gap])) do begin swap(a[left], a[left + gap]); left := left - gap; end; end; gap := gap div 2; end; end;} (***** IMPROVED SHELL SORT ******************************************) (* This version saves some time in the inner loop with a better version of insertion sort that uses a temporary variable to cut down on swaps. *) procedure shell(lb, ub : integer); var gap, left, right, newval : integer; begin gap := (ub - lb) div 2; while (gap >= lb) do begin for right := gap to ub do begin left := right; newval := a[left]; while (left - gap >= lb) and (newval < a[left - gap]) do begin a[left] := a[left - gap]; left := left - gap; end;  i : integer; begin writeln; write('Number of items to sort: '); readln(n); for i := 1 to n do master[i] := random(2000); master[n + 1] := MAXINT; reset(n); end; procedure presort(n : integer); var i : integer; begin quick2(1, n); for i := 1 to n do master[i] := a[i]; end; procedure show(n : integer); var i : integer; begin writeln; for i := 1 to n do begin write(a[i] : 5); if (i mod 10 = 0) then writeln; end; end; procedure dosort(c : char); begin reset(n); if (toggle) then show(n); writeln; write('ready?'); repeat until keypressed; write(' begin'); case c of 'B' : bubble(1, n); 'C' : count(1, n); 'H' : heap(1, n); 'I' : insert(1, n); 'L' : shell(1, n); 'Q' : quick1(1, n); 'R' : begin quick2(1, n); insert(1, n); end; 'S' : select(1, n); 'T' : tree(1, n); end;  a[left] := newval; end; gap := gap div 2; end; end; (***** TREE SORT ****************************************************) (* In one auxiliary array, the items are arranged in a tree where each position i contains a copy of the smaller item at positions 2i and 2i + 1. A second auxiliary array contains pointers to the original position of each item in the first auxiliary array. The first (smallest) item in the tree is repeatedly removed and transfered to its final position in the sorted list. Then, it is replaced at its original position with a value higher than any item in the list, and the tree is rearranged to move the new smallest item to the top. *) procedure tree(lb, ub : integer); var cell, node : integer; value : longlist absolute aux1; pointer : longlist absolute aux2; procedure minimum(cell : integer); begin if (value[2 * cell] <= value[2 * cell + 1]) t writeln(' end'); if (toggle) then show(n); end; procedure menu; var c : char; begin writeln; write('Options:'); writeln; writeln; writeln(' ' : 10, 'B Bubble sort.'); writeln(' ' : 10, 'C Count sort.'); writeln(' ' : 10, 'D toggle Display of list.'); writeln(' ' : 10, 'H Heap sort.'); writeln(' ' : 10, 'I Insertion sort.'); writeln(' ' : 10, 'L sheLL sort.'); writeln(' ' : 10, 'N Number of items to sort.'); writeln(' ' : 10, 'P Presort master list.'); writeln(' ' : 10, 'Q Quick sort.'); writeln(' ' : 10, 'R quick sort 2.'); writeln(' ' : 10, 'S Selection sort.'); writeln(' ' : 10, 'T Tree sort.'); writeln(' ' : 10, 'X eXit program.'); writeln; write('Your choice? '); read(kbd, c); c := upcase(c); writeln; case c of 'B', 'C', 'H', 'I', 'L', 'Q', 'R', 'S', 'T' : dosort(c); 'D' : toggle := not toggle; 'N' : init(n); 'P' hen begin value[cell] := value[2 * cell]; pointer[cell] := pointer[2 * cell]; end else begin value[cell] := value[2 * cell + 1]; pointer[cell] := pointer[2 * cell + 1]; end; end; begin for cell := ub to (2 * ub - 1) do begin value[cell] := a[cell - ub + 1]; pointer[cell] := cell; end; for cell := (ub - 1) downto lb do minimum(cell); for cell := lb to ub do begin a[cell] := value[lb]; node := pointer[lb]; value[node] := MAXINT; node := node div 2; while (node >= lb) do begin minimum(node); node := node div 2; end; end; end; (***** MAIN PROGRAM INFRASTRUCTURE **********************************) procedure reset(n : integer); var i : integer; begin for i := 1 to n + 1 do a[i] := master[i]; end; procedure init(var n : integer); var ": presort(n); 'X' : halt; else begin writeln; writeln('Not on menu.'); end; end; menu; end; (***** MAIN PROGRAM *************************************************) begin toggle := true; menu; end. SORT.CO͠ i progra shel designe t allo compariso o numbe o sortin砠 algorithms SORT.PAӠ i th correspondin Turb Pasca sourc file Th progra men allow th use t generat desire numbe o rando integer (u t 2000 bu tre sor ca handl onl 1600) Th maste lis ca b presorte i desired an displa o th number ca b toggle o o off Th othe men choice allo th use t tes th particula sorting methods. Th individua sortin algorithm appea a name procedure withi SORT.PAS The wer writte t gai understandin o th sorts an wer optimize fo clea expressio rathe tha versatilit o speed T compar th spee o th variou algorithms time th interva betwee m respons t th promp "Ready? an th momen whe th sorte lis bega t prin out teste eac sor o 40 an 80 rando integers an the o th sam numbe set afte presorting wit th followin result (time in seconds): SORT 400 800 400 (PS) 800 (PS) bubble 29.7 114.8 .3 .3 count 17.8 70.2 18.0 71.0 insert 11.5 42.2 .4 .4 select 9.2 35.6 9.1 35.4 tree 6.3 14.1 6.3 14.0 shell 1.9 4.0 1.1 2.1 heap 1.6 3.5 1.7 3.6 quick1 1.1 2.1 8.7 failed quick2 1.0 2.0 .7 1.2 Th firs fou sort ar o clas tha take tim proportiona t * t sor items shvTXT2ASM.ASM_  ! "$#&%(')*+,-./01235467o98:;<=>?@ACBDEFGHIJLKMNOQPRSTUWVXYZ[^]\fEY#?{oP9?-r ed!;57gΤ~mr=;]5:o8O~3/0JfgѡuD?;:yk[-#\FX \>mcdZX7wƿ,}YÉ~jMoxꦽYX.^OeFqG^el sor i i a intermediat clas tha take tim proportiona t roughl * 1.25 an th othe fou ar i th bes cas clas tha take tim proportiona t lo n Not tha tw o th ver simpl sort (bubbl an insertion ar excellen o list tha ar alread sorte o nearl so Tre sor i wors tha shel sor a thi lo becaus o hig overhead bu woul eventuall catc u a muc large n Th simpl quic sor i notoriousl ba o presorte lists--a 80 i fail du t stac overflo durin recursiv calls Th improve quic sor overcome thi proble an wil b th fastes sor o thi collectio fo al bu ver unlikel sequence o numbers (I fe rar cases hea sor wil bea it sinc th improve quicksor stil ha ba wors case whil hea sor take about the same time for best and worse case lists.)"O޻X }_e᯽ԛ_YXO} X|Q,'YN]좽oʫSW= QtsXOb4/'lg^m7u7Jt!;K5,'1 K6]6+tƬ7]NRw )Iea|>a8ho}S PhM8 ~YY)`iq}|ٻXҶ6$ه]4W?ؽQ ba>IӅs}S>w- NßC@,'i+?,-Oh]˾ª)b>PWXZ|Ыߵ\ qnwR }%G Ke_pzpQ~ӅU!IiY7K.wC+7yTtai} +o5 Nï@E}"̫/'\4~yR(%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i|32heo5!1Gw/}SG-`9z2ah}Ӽ+KYO&ӞA+, 9b9# u98r͕D05@]Xz"|32he5!1G,td.X6\i's:@e_7ޯѭmK/^+eh}Ӽ+4!1GsE&$.o,7,tA`9[嚐rNG<,Yq9`9#krNG&,7[[\ 4 D>0i4]ȧU,U&S|Ks:C . r SW)d9Snb9Sr9D,,=Ὓ^|nCϕY!\ eoq\T,7-mܴHm|ȃL@i6n0:P7?L#A`iyk(2j觱@ Ot5U~E8E$h@,7-/r9~  bTXT42 DOCTXT42 ASM .9TEXTCOM LIBNnDOC COMP TXT42.DOC: - TXT42.CO͠ i upgrad o th progra TXT40.COM Se TXT42.AS͠ fo th modificatio histor an credit t origina authors. - Terry Hazen 07/14/84 TXT42.COMimethoocreatininstan.CO͠filethawil젍 prinoutextuamessagesThprintouothmessagmab堍 intercepte wit ^ ^X an wit th ESCAP key ^ wil caus the display to pause. I i basicall shor progra tha sit a th hea o .CO fil tha i create i Wordstar' NON-documen mode standar W tex fil i the adde t creat a instan tex displa .CO file Se TXT42.AS fo th listin i cas yo ar intereste i examinin o modifyin it. TXlXaM)xOŵ1 uôş#4y 9ꦽ^?S7ۈaiyꦽ~?8E&r"fǵy{Z^TEv]K_r%{mO\^mMhEKYC򴼝A1~MngKtm5~6Mk@AĊRH3|?454}ouOݴwӫ?Go7~zn46,MfiyMh#XUrvƘ4Oݴwӫ?u[_?oܴ&DKY-A2MDcG{-Onzu ҝzo6a ;ˁ "3]UzL7wӫ?#Ao |5X9j7E{7yGj",],My#~ꦽ#Ao |5XZNEJiy,ȴ,Y0IǵyܴMEO-+e4K z,7UGp]>~qbaw\Uk², mwy/Kt_︪:V@CHf:YXY O-xᗅaU deaXSg̡,Y,,É 2A\T,7-mܴHm|ȃL@i6n0:P7?L#A`iyk(2j觱@ Ot5U~E8E$h@,7-/r9~#T42.COMhabeerenameTEXTCOM.LI ithi.LBRIneve run o it own s ca b calle b an convenien nam t avoi confusing it with a working .COM file. ~ Loa TEXTCOM.LB wit Wordsta an yo wil notic tha i look like this: !^V^A......and.assorted.junk..............................^ Inseryoutexbetweeth"?anth"^@" ^ Thiith堠shorprograthawilprinwhatevetexi inserte䠠betweeth"?linanth"^@lineThtexmus bterminatewitnul(^@) nul (^@ ha bee include a th en o th file whic mean tha yo ca jus inser you tex betwee th o th thir lin an th ^ o th fift line. Th progra permit th us o th tild characte i th tex t mak th displa paus unti an ke i hit Formatte scree page ma b create b addin sufficien CRLF' t th tex t creat th desire scree pag formats usuall ever 2 line t forma; TXT v4.2 - MESSAGE UTILITY PROGRAM 07/14/84 ; ; Terry Hazen ; ; TXT42.COMimethoocreatininstan.CO͠file ; thawilprinoutextuamessagesThprintouo ;thmessagmabinterceptewit^àan^ andwit ; ESCAPŠkey ; ; ThfilTXT42.COMibasicallshorprograthasit ;athheaotexfilthaicreateiWordstar' ;NON-documenmode ; ; Thprograpermitthusothtilde characte ; ithtex tmakthe display pauseFormatted screen ; pages may be created by adding sufficienCRLF'tthe ; text to create the desiredscreen pag formats. ; ; TXT42.COM has been renamed TEXTCOM.LIB in this .LBR. It ; never runs on its own, so can be called by any convenient ; name to avoid confusing it with a working .COM file. ; ; Usthfollowinprocedurtseutexfil ; FILENAME.COM ; ;1LoaWӠangintnon-documenmode ;2UsFILENAME.CO͠fothfiltedit ;3WӠwilrespon complet screen o 2 lin display. ~ Us th followin procedur t se u tex displa fil FILENAME.COM: 1. Create your text file using WS, and save it. 2In Non-Document mode, create new file FILENAME.COM. 3Us^KҠtreathfilTEXTCOM.LI into FILENAME.COM. 4Use ^KR to read your text file into FILENAME.COM between the "?" and the following "^@". 5Savthfilanruia.CO͠file Whil shor tex line ma b inserte directly longe fil ma mor easil b create an formatte a separat WӠ fil create i eithe th Documen o Non-documen mode Inser tilde ever 2 line o a desire fo paging. AL̠ character u t th fina ^ wil print I i VER importan tha th fina ^ b i plac a th en o th file otherwis strang thing wil b printe unti nul i encountered. DOC.COMatexfilprintinthiinformatiowacreateusin thprocedwitNEנFILE ;4Us^KҠtreaintmemorthfilTXT401.COM ;5Use ^KR to read into memore yourtexfile ; betweeth堿anthfollowin^@ ;6Savthfilantheruia.CO͠file ; ; AL̠characteru t th fina ^ wil print I i ; VER importantha th fina ^ b i plac a th en o ; th file otherwis strang thingwil b printe unti ; nuli encountered. A null (^@) has been included at ; the end of the file so that text may be inserted without ; worrying about how to create a null on your terminal. ; Note that the ^@ is a null, NOT a "^" character plus a ; "@" character. ; ; For more information on its use, see TXT42.DOC or run ; DOC.COM, an example of a finished .COM file. ; ;*********************************************************** ; ; 07/14/84 Added a line of code to strip hi-order bits ; v4.2 from text to make text creation with WS Doc- ; ument mode easier. Now reads tildes even if ; created in DocumeurdescribeabovewitTXT42.DOCathtexfile ~ Whausialthis """"""""""""""""""" Yomawelask..Ihabeeuseoarcp/thelwitth probleosomusertypinQUIԠoLOGOFƠetcinsteaoBYE Instea䠠ohavintcreataassemblefilwitD linean䠍 writ堠routintprinmessagthasay"PleasusBYŠt loofthisystem......(pluotheinfo)antheassembl堍 i an the loa it w simpl follo th procedur outline earlie an creat a 'instant .CO fil usin th editin capabilitie o WS. I ha als bee use t displa hel file i busines environment Th operato simpl type th nam o th ite she/h wishe t kno mor abou an get a instan listing. Whopyofinthiausefuawhave.... (Notthath^terminatinthfilireallnullnoޠ charactepluacharacter! ~ $nt mode. Added abort with ; <^X> to previous abort characters. ; - Terry Hazen ; ; 07/12/84 Program and documentation re-written. ; v4.1 'Hit ' was replaced with '[more]' to ; be consistant with other programs. Now ; aborts with <^C> or . <^S> pauses the ; text display. ; - Terry Hazen ; ; 06/15/84 Revised file and added , abort char- ; v4.0 acter etc. Named it TXT40.ASM to get a jump ; on the version numbers, as this version is ; based on my version 2.5 and incorporated Bob ; Schultz direct I/O calls dated 01/17/84 and ; Walt Wheeler, Justus Addiss's idea of the ; tilde character (this is a neat idea) from ; their version NTXT3.ASM dated 06/12/84, ; allowing the creator of a file to implement ; paging by inserting a tilde (~) in the ; source text file, to PAUSE until the reader ; strikes a key. Suggest including a tilde ; not less often than every 22nd line. ; - Harry Kaemmerer ; ; 01/01/84 8080 version N-TXT.COM mess ;done with message, so pause ; EXIT: POP H ;clean up the stack ;do a conin before exit CONIN: MVI E,0FFH ;direct input MVI C,DIRIO ; CALL BDOS ; ORA A ;set flags RET ; ; MESS1: DB '[more] ',0 ;paging message ; DB CR,LF,'Insert your text between' DB ' the "?" and the "^@":',CR,LF DB '?',CR,LF ;start of buffer marker ;----------------------------------------------------------- ; Message space starts here, and is as large as your TPA ; - 512 bytes ;----------------------------------------------------------- BUFFER: DB CR,LF ;add blank line to make ; insertion easier DB 0,CR,LF,EOF ;force a NULL and an EOF ; ;marker to keep the Wordstar END START ;clean !~T~<_U7(U"TTT#!^~_#~A"[more] Insert your text between the "?" and the "^@": ? age utility. ; - Harry Kaemmerer ; CP/M NET EAST ; (201) 249-0691 ; ; Original Z80 TXT.COM version ; - Simon Ewins ; e-mx rcp/m ; (416) 484-9663 ; ;*********************************************************** ; ; ; ASCII CHARACTERS CR: EQU 0DH ;carriage return LF: EQU 0AH ;line feed CNTRLC: EQU 03H ;control C CNTRLS: EQU 13H ;control S CNTRLX: EQU 18H ;control X EOF: EQU 1AH ;end of file marker ESC: EQU 1BH ;escape character TILDE: EQU 7EH ;tilde character ; ; CP/M EQUATES BDOS: EQU 5 ;bdos entry point DIRIO: EQU 6 ;direct console I/O ; ;*********************************************************** ; ; ; PROGRAM STARTS HERE ; ; ; ;*********************************************************** ; ; ORG 100H ; ; START: LXI H,BUFFER ;point to text ; LOOP: PUSH H ;save pointer MOV A,M ;get character CPI 0 ;at end? JZ EXIT ;yes, so quit ANI 7FH ;strip hi-order bit CPI TILDE ;is it page character? !~T~<_U7(U"TTT#!^~_#~A"[more] Insert your text between the "?" and the "^@": ? TXT42.DOC: - TXT42.CO͠ i upgrad o th progra TXT40.COM Se TXT42.AS͠ fo th modificatio histor an credit t origina authors. - Terry Hazen 07/14/84 TXT42.COMimethoocreatininstan.CO͠filethawil젍 prinoutextuamessagesThprintouothmessagmab堍 intercepte wit ^ ^X an wit th ESCAP key ^ wil caus the display to pause. I i basicall shor progra tha sit a th hea o .CO fil tha i create i Wordstar' NON-documen mode standar W tex fil i the adde t creat a instan tex displa .CO file Se TXT42.AS fo th listin i cas yo ar intereste i examinin o modifyin it. TXT42.COMhabeerenameTEXTCOM.LI ithi.LBRIneve run o it own s ca b calle bJZ PAGING ;yes, then pause MOV E,A ;move character to e MVI C,DIRIO ;console out CALL BDOS ;bdos CALL CONIN ;check for key pressed JZ LOOP2 ;if no key then continue CPI CNTRLS ;is it ^S? JNZ CHECK ;if not, check for ESC or ^C ; LOOP1: CALL CONIN ;check for key pressed JZ LOOP1 ;loop until key pressed ; CHECK: CPI ESC ;is it an ESC? JZ EXIT ;if so, exit CPI CNTRLC ;is it a ^C? JZ EXIT ;if so, exit CPI CNTRLX ;is it a ^X? JZ EXIT ;yes, quit ; LOOP2: POP H ;get pointer INX H ;and bump to next character JMP LOOP ;go on doing it ; PAGING: PUSH H ;save pointer LXI H,MESS1 ;get the message MOV A,M ;get first character ; LOOP3: MOV E,A ;need it in E for bdos call MVI C,DIRIO ;set bdos function call PUSH H ;save pointer CALL BDOS ;ok, send the character POP H ;return pointer INX H ;set up for next character MOV A,M ;get next character CPI 0 ;is it the end? JNZ LOOP3 ;nope, loop POP H ;return pointer JMP LOOP1$ an convenien nam t avoi confusing it with a working .COM file. ~ Loa TEXTCOM.LB wit Wordsta an yo wil notic tha i look like this: !^V^A......and.assorted.junk..............................^ Inseryoutexbetweeth"?anth"^@" ^ Thiith堠shorprograthawilprinwhatevetexi inserte䠠betweeth"?linanth"^@lineThtexmus bterminatewitnul(^@) nul (^@ ha bee include a th en o th file whic mean tha yo ca jus inser you tex betwee th o th thir lin an th ^ o th fift line. Th progra permit th us o th tild characte i th tex t mak th displa paus unti an ke i hit Formatte scree page ma b create b addin sufficien CRLF' t th tex t creat th desire scree pag formats usuall ever 2 line t forma complet screen o 2 lin display. ~ Us th followin procedur t se u tex disp h-02FEB85 DOC COMq2Z;TXT50 AQM3>.TXT50 COM1TXT50 DOC/' ***************************************************************** * * * TXT version 5.0 * * * * A Message Utility Program * * * * Terry Hazen * * Los Gatos, California * * 02/09/85 * * * ***************************************************************** INTRODUCTION... TX i la fil FILENAME.COM: 1. Create your text file using WS, and save it. 2In Non-Document mode, create new file FILENAME.COM. 3Us^KҠtreathfilTEXTCOM.LI into FILENAME.COM. 4Use ^KR to read your text file into FILENAME.COM between the "?" and the following "^@". 5Savthfilanruia.CO͠file Whil shor tex line ma b inserte directly longe fil ma mor easil b create an formatte a separat WӠ fil create i eithe th Documen o Non-documen mode Inser tilde ever 2 line o a desire fo paging. AL̠ character u t th fina ^ wil print I i VER importan tha th fina ^ b i plac a th en o th file otherwis strang thing wil b printe unti nul i encountered. DOC.COMatexfilprintinthiinformatiowacreateusin thprocedurdescribeabovewitTXT42.DOCathtexfile ~ Whausialthis """""""""""""""" progra tha allow wor processo suc a WordSta t creat 'instant tex displa .CO͠ file t displa tex message o termina o t sen contro sequence t terminal o printers TX permit th us o th tild characte (~ i th tex t caus th displa t pause creatin formatte displa pages Non-printin characters suc a ESC ma b synthesize fo us i contro sequence o t creat revers vide o othe specia displa effects. SOME APPLICATIONS... Instant RCP/M Message Files... Instea o writin a assembl languag fil wit D  line t prin message the assemblin an loadin i eac tim yo nee ne message TX an WordSta ca d i fo yo muc mor quickl an easily Instant HELP Files... TX ca b use t creat HEL files Typ th nam o th ite o procedur yo nee hel wit an ge a instan display. Terminal or Printer Control Sequences... TX ca synt""" Yomawelask..Ihabeeuseoarcp/thelwitth probleosomusertypinQUIԠoLOGOFƠetcinsteaoBYE Instea䠠ohavintcreataassemblefilwitD linean䠍 writ堠routintprinmessagthasay"PleasusBYŠt loofthisystem......(pluotheinfo)antheassembl堍 i an the loa it w simpl follo th procedur outline earlie an creat a 'instant .CO fil usin th editin capabilitie o WS. I ha als bee use t displa hel file i busines environment Th operato simpl type th nam o th ite she/h wishe t kno mor abou an get a instan listing. Whopyofinthiausefuawhave.... (Notthath^terminatinthfilireallnullnoޠ charactepluacharacter! ~ ZvZ~z>?lObiT|SN9izrY~w7)ߺJEizrY~w7F5."/7.HĚ<R61U%5VE7.ڛtK=izr%hesiz ES an othe non-printin character use t contro printer an terminals Yo ca quickl creat file t initializ printer an terminal fo specia situations Yo ca als includ ES sequence withi tex display fo revers video underlining blinking double-hig double-wid characters selectin specia graphic characte sets o an effec you termina supports PAGING... Wheneve TX see tilde characte i th text i wil paus an wai fo an ke t b hit Formatte displa page ma b create fo lon tex display b th inclusio o extr lines Th us o ^ b th operato wil als paus th display Th us o ^ o th ESCAP ke wil sto th printout SYNTHESIZING NON-PRINTING CHARACTERS... Non-printin characters suc a ES (1BH whic canno b directl adde t th tex messag b WordSta ca b synthesize usin two-characte string Th first o intercep characte ma b prin strang堠 thing afte th tex messag unti NUL̠ i encountered. - Save FILENAME.COM and run it as a .COM file. EXAMPLE... TX wa use t creat DOC.CO fro thi file TXT50.DOC Ru i a a exampl o wha migh b done Notic tha blan line wer adde o delete t forma th displa pages an tha th tilde characte wa eliminate fro th actua text Th backslas wa use a a intercep characte sinc '^' wa use ofte i th text ES sequence wer no use i DOC.CO sinc thei us i highl termina dependent. I'v foun th capabilitie o TX ver usefu fo lot o 'od jobs tha hav com u fro tim t time suc a settin VT10 compatibl termina t emulat VT52 settin a EPSO printe t prin i Emphasize mod whe printin listing of th screen an i quickl testin th desig o scree layouts suc a menus tha featur revers vide o othe specia define b th use befor assembly I i se t '^' i the distribution version of TXT50.COM Th intercep characte canno appea anywher i th tex excep whe non-printin characte i t b synthesized I you tex wil includ '^ (a thi on does) whil i WordSta chang th intercep characte (i lin 1 co 11 t somethin els (lik backslash tha won' b use i th text. Whe TXԠ i run th intercep characte wil b recognized dropped an th nex characte wil hav 40 subtracte fro i t synthesiz th non-printin character Thus i yo wante t sa ES yo woul writ ^ whic i 5B ([ - 40 1B (ESC) I othe words writ th non-printin characte a it equivalen contro characte (^ fo BEL ^ fo LF ^ fo CR etc). Not tha eac non-printin characte take u tw space i th tex fil tha wil no appea i th display s tha th numbe o space i lin containin non-printin c display effects. I hope you find it just as useful! - Terry Hazen !~Y^c~A_Z<-Z'YYY#!l~_#~F'#~@[more] Insert your text between the "?" and the "^@": ? vTXT50.ASM  !"#$%&_o'()*+,-./012345678 9:;<=>?@ABCDEFGHIJKLMN SOPQRSTUVWXYZ[\]^_`abcdQefghijklmnopqrstuvwxyz{|}+ V<:72~Xu,rOB?=8531/-$!wU}|hvpB&Jharacter ma nee t b adjuste whe revers vide o othe specia effect ar use i th messag text. USING TXT TO CREATE A TEXT DISPLAY FILE... - Wit WordStar creat th ne fil FILENAME.COM Thi ma b don i eithe th Documen o Non-Documen mode a TXԠ wil ignor th hig orde bit. - Rea TXT50.COM int memor (usin ^K o equivalent) an yo wil se somethin lik th following: !)^Ae...and..lots..of..other..junk.............................^A Insert your text between the "?" and the "^@": ? <<--------(Insert your text on this line)------------------. ^@ | | - Inser you messag tex o contro sequenc o thi lin ^ addin a man extr line a yo need I th tex i long creat i ahea o tim an inser i fro anothe file MAK SUR THA TH ^ (NULL REMAIN A TH END o TX wil%Jw]*(F1!\aYH^`؉]?u>.wxH /:pO696c( 9FI:p/> EwU--Fag4^zh9n99} r /6vbLlB]e,CmlIO!5||@2$qSBs0n(e q5z9|.Lt)F15# &ӕJ܀/Im"Y@R9LW*Q9`稍TL&>tN_CM+y UhbU`YR&HLs<çGpV`:9hb*2օ/rԢt#,սk(e q5G-&U; #g9bB?芫9fq8(^hbyd{^jH%Z/r$CNY3#֔RƺWA%=_8n9n901vFiC|@|@HE;\}QLwdA;-F*2I,=#;+j҈I,*,%?(||@m2Y"F A=VR݃4ncaq>@e(3Ykj[SNY̑ M  Mz5/52]/B=X|@|@HEXYPzho:n99} IaV@2$v09Y8D}*Hs&*Saa߁"CFXJ~ 0M#HYM2օX~|@|@yLW*Q VRC*Qzhr>r>s8B\((ʇ ,g4j6RT2aDb2kh" Ul F*&dR">ȁO;H/52]/"\a Z_8 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 h9Â>8#Z4uUе' #[_vGcC*ڂ`v^W76xu6:z8^kRF::-PJoxA,Bjy=\zgwcuqkyz~u(HXtkpk|p~c<^9nlx}uHX@m(F*/7sCamF,p Hv5peӡAFH******** INTRODUCTION... TX i progra tha allow wor processo suc a WordSta t creat 'instant tex displa .CO͠ file t displa tex message o termina o t sen contro sequence t terminal o printers TX permit th us o th tild characte (7EH i th tex t caus th displa t pause creatin formatte displa pages Non-printin characters suc a ESC ma b synthesize fo us i contro sequence o t creat revers vide o othe specia displa effects. ~ SOME APPLICATIONS... Instant RCP/M Message Files... Instea o writin a assembl languag fil wit D  line t prin message the assemblin an loadin i eac tim yo nee ne message TX an WordSta ca d i fo yo muc mor quickl an easily Instant HELP Files... TX ca b use t creat HEL files Typ th nam o th ite o procedur yo nee hel wit an ge a instan display. Terminal or PrinPO/A>Pz2P #$C7tt:Jv^WFz8:uy:hR#xzebV*&mP%fM[(:dLŃ1h&VRM s9WL!Bmb2ӑ?>wuT PTt)F1!uuc MdLxk뺿uPD%$C*1F$QGz9F XZ$yreQj+q^W76xuJpFH0"1xEok qcj+q^O!1)F$&>Wb(:dLz2Z!H/7ִy2^ZCJd/x\PZEXJХń-jDr>8?u9W+z[  M E|p~8^_tΝmCi! 3XCCGz94R ;zr<:8ǻzU1($:wup>8?d}MWaBJdףSuT PtH0"1ʕ:DqBTLy}0~]h&H0"1H?:fF$m+zc<^uX 1Cml@s喾5;?֡&RbBoٿ9R caCƌxIn:/MpFxgwo};-}" ;v3k2 sa8ńkሌ C2BDL"ba*|v3LQ·Zp~ʝ;k-=߸ue Y!uRآ+AoHɰ $$㼾;$ UB(w}3+u2`D58#o5;q<8ډ<}k-˞R"D;)%zDD$z-;9grθ;9gwrɵ c-X0r??y㺝/vu~k-X0ֲAD`fX-. Ih!!ղIݑ;rGf̐rGf,$"3LI]"e,# I3Cq9&eمEFEF"$#Ɍ$eم ))d$$SZ]ȑ;r DaekFn><~:qf>ml/:O:s']m2 c-˛9I̢r9&o|}?q)v)TTYPEXB.DAT?  o!"#$%&'()*+,-./0123456789:;<=>>^b(5R~< Lӂ o tim an inser i fro anothe file MAK SUR THA TH ^ (NULL REMAIN A TH END o TX wil prin strang堠 thing afte th tex messag unti NUL̠ i encountered. - Save FILENAME.COM and run it as a .COM file. ~ EXAMPLE... TX wa use t creat DOC.CO fro thi file TXT50.DOC Ru i a a exampl o wha migh b done Notic tha blan line wer adde o delete t forma th displa pages an tha th tilde characte wa eliminate fro th actua text Th backslas wa use a a intercep characte sinc '^' wa use ofte i th text ES sequence wer no use i DOC.CO sinc thei us i highl termina dependent. I'v foun th capabilitie o TX ver usefu fo lot o 'od jobs tha hav com u fro tim t time suc a settin VT10 compatibl termina t emulat VT52 settin a EPSO printe t prin i Emphasize mod whe printin listing of th screen an i quick' |TXTL COMTXTL DOCTXTL MQC'3ن>222S ~SqS!]~ !e~ w#\ڋ?$Sh\̈́Ϸr!o6$} o> > !"DbY 2-ͯ(!*k\ѷ(!~ #V!X>A2~(:<2>.~N# #"n1b(;(2@G(0 0* ͈~(~#( *͈~ ̈́_ #~(0:( (9   ~(b_yO>G> Text library by D.Amos. December 1983. << With Printer facility >> $For Printing? Y/N $Library file menu:- $Choose A\Z keys. ;=View all. ^C=Exit. $CR=Page. ESC=Menu. ^C=Exit. $ Default disk LIB files. $? $1AH in LIB text. $????????LIB?Load a .LIB file using CP/M cold start, i.e. A>TXTL D:TNNNNNNN $sk LIB files. $? $1AH in LIB text. $????????LIB?Load o tex file useable no an goo fo extensiv busines󠠠 applications bu usefu젠 fo man FOǠ members/hom programers/students, applications.  Th operatio o TXT an th creatio o useabl tex librar fil ar shown here. ToperatWordsta(o an tex edito,a lon a contro characterar enterable wit it, ente th 'D mod (fo documen files) A filename with a filetype .LIB, must be entered next to fill the 'D' prompt fo file endin i Afte settin u you require scree width creat you TEX MEN firs i th file D NO labe eac men lin b numbering aTXT wilmakeac lin lette fro th alphabetfo yo t chooswhic sectioo th fil t viewAfte entr o th menu ^P o contro the mus b place a th beginnin o th nex line th sam musb entered afteeac sectio o tex excep th las, whic use 1A o SU controcharactet mar th en o filethi i don autINTRODUCTION TO THE SUBJECT OF A TEXT LIBRARY. THE ENHANCMENTS OF THIS VERSION. OPERATION INSTRUCTIONS FOR WORDSTAR AND TXTL.COM.  Firstly a short explanation of the use for a text library; Informatio tha ca b displaye quickl usin simpl A- menu coverin th entrie i .LI tex file withou havin t mak t muc effor t achiev it Simplicit fo settin u th printe t prin th sam informatio i a acceptabl format Thes ar th reason fo th followin program TXTL.COM. <<<<<<< SPECIAL NOTICE >>>>>>> Thi fil TXTL.DO ha bee formatte int th TEX LIBRAR FORMA an ca b use no wit th TXTL.CO contro program jus retur t CP/͠ war start and at the A> prompt; A>TXTL TXTL.DOC ------------------------------  A thi fil i programe i Z8 assembl languag an ha standar BDOS/BIOS addressin throughou i will wor fo an CP/M system includin th Osborn omaticall b Wordstasneeno b don b you An numbe o men line an tex section ar possibl unti th 26th Afte entr o you tex leav Wordstar by ^KX or control K then X and you are now ready to use TXTL.COM. comman strin mus b entere fro CP/ col star an you tex fil should have the filetype .LIB. A or B disk can be used. Here is an example; A>TXTL B:MYTEXT Othe filetype ca b used i formatte fo TXTL bu the mus b entere in the CP/M command string with the new type, as; A>TXTL TXTL.DOC TXTL.COM written by: D.AMOS. 68a FINDLAY AVE, ROSEVILLE, N.S.W. AUSTRALIA. 2069. A member of a Sydney based software group for better assembly files. ------------------------------ vѤTXTL.MACW   an th Executive Bu compute wit a 808 CP wil no run TXTL.COM, unless re-programed to do so. Th TXTL.MA fil ha bee writte t compil int 1 TXTL.CO file, smal enoug fo use t forge abou dis spac problems Thi woul leav th resoth dis availabl fo the uses TEX LIBRAR files! Any scree widt proble i totall th user an ca b setu a th tim o writin th tex file I Wordsta ^O 52?@ABCDoEFGHIJKLMNOPQRSTUV#<hqJnR#bTTF+f< 5.`0]1L͓] \ /:ۼF[-W9ʥQ"Ug[/`}Z+iv9ZpCo.y(5\|ZK.gx2%f `&Xd9d"] ʘ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