L?KP-TYPEROBJ$XM-TYPER OBJ&$XOS-TYPEROBJJ$PTYPER C n;BaTYPER DOC/*+%"H%"F%"D " " "y 6"C+6+!^6 F+N+<!* !!9~#ʗ RO"k'k +}|+#~ʂu6#~#<ʷ>!4R6#6*!f * |ʴ!ͯ"r! ͯ" R Can't open > or < file.$èw*6 )! 9!"6*:B<*C 2B ́F  €> _*C~+#4N s> > !+:EºF2B_~ý   > G ʘG!* ͟> !+}  > _con:rdr:pun:lst: ==_~O7 !"# !  #¾i& ~º!h~#~#F6%pw6237!9Ly=S>wD<!gs 6#6 ~+|s#r{{ ڟ!+#^{!!Pw#w!g~<6 !|~r!N!nL}*eyb>w#%!=)${=Sbtx h&{ !~!nN#F{p+pH#x¯ ڽ+!9~ !~b!5> 6> *e w`i#Q᯾%,!$|!!9n&:ʟɯ2>[!9L):|!PwL#4!^w>2>2-:Ecx:-O”! DMi:- !Write error - Disk full $`i7.!9~=+SV+^+F+N "I> w+ w w##w w #~+:&~##K@~#.7K&*I++Kw#=a O! ~_#V!$r+sbk#|}o|g}o|g}o|g|!,|}!­­,ɯ|ʙ!|}!-z{!,zz{!-|!|g|}! -ɵz{!-||g}o).{ozg+|/g}/o~og~#fos#rN#F#xr~#~#[[`iDM!z>‚S\))Ҋ =‚ɯßz>|>MD!x<³z>ڸjS\>))#  =¸>>H}(i{&]@*( !}2E!9L++|ʥ !!* N9!!Z N9!9L##L!K | !9L##!Q!!9L##Lg "( *( !* ͐ !*( "( * !" !9L* F!9L* F͛e * #" +!9LF|b !"  !9L* F!9L* F4[ ;* * * !}2E!" # !99}#͓ !9F< | * !9F}* #" !9F|) * | ! & ! !* +" !9FͯH !9F͓ͯg * !ͣ !" !9F|’ * * ͣ * " !9F+++ͯ° !9F͓ͯ !# !" !" !9Fͯ !9F͓ͯ !9F͓ͯʊ * 6!" * * M 2 * #"  * F! 9L͟( ! ! 9L͟!" * w * #" # * !ͣ !9F| !! 9LN9!" !" !# í * 6!" * *  * #" * F! 9L͟ " " " 3S* !! N" !9F Y !9F͓*] !9L!ͯ"] *] ʕ *] "] !_ NͨÎ !9F }!9F }!!=!9F!9F!!R!9L6 ! !9L#Q!9L!͔͓>!9LP͓ !9L*L!"L*L)!9LL͓ʔ|*L#"L+X*L)!9LL͙q"L!9LF|!9L#Q+FÙ! TYPER Ver. 2.0 by Harvey G. LordPlaced in the public domain on 10/14/83Simple line editor. Sends one line at a time to theLST: device (printer) or to a disk file: especiallygood for addressing individual envelopes.Usage: TYPER <== Prints instructions, output goes to LST: TYPER PRINTER <== No instructions, output to LST: TYPER d:file.typ <== No instructions, output to disk fileEditing Commands: ^H = Destructive backspace ^U or ^X = Cancel current line ^C or ^S = Clear screen ^P = Display prompts , ^J, or ^M = Send line to indicated device ^Z = End of session ^B = AbortThis version of TYPER is Lear-Sielger ADM-3A terminal dependant.Press any key to continue.Press any key when your printer is plugged in and ready to run.^B aborts.PRINTERL----!----!----!----!----!----!----!----!----!----!----!----!----!----!----RSorry, I can't open the file.w*+%"H%"F%"D " " "y 6"C+6+!^6 F+N+<!* !!9~#ʗ RO"k'k +}|+#~ʂu6#~#<ʷ>!4R6#6*!f * |ʴ!ͯ"r! ͯ" R Can't open > or < file.$èw*6 )! 9!"6*:B<*C 2B ́F  €> _*C~+#4N s> > !+:EºF2B_~ý   > G ʘG!* ͟> !+}  > _con:rdr:pun:lst: ==_~O7 !"# !  #¾i& ~º!h~#~#F6%pw6237!9Ly=S>wD<!gs 6#6 ~+|s#r{{ ڟ!+#^{!!Pw#w!g~<6 !|~r!N!nL}*eyb>w#%!=)${=Sbtx h&{ !~!nN#F{p+pH#x¯ ڽ+!9~ !~b!5> 6> *e w`i#Q᯾%,!$|!!9n&:ʟɯ2>[!9L):|!PwL#4!^w>2>2-:Ecx:-O”! DMi:- !Write error - Disk full $`i7.!9~=+SV+^+F+N "I> w+ w w##w w #~+:&~##K@~#.7K&*I++Kw#=a O! ~_#V!$r+sbk#|}o|g}o|g}o|g|!,|}!­­,ɯ|ʙ!|}!-z{!,zz{!-|!|g|}! -ɵz{!-||g}o).{ozg+|/g}/o~og~#fos#rN#F#xr~#~#[[`iDM!z>‚S\))Ҋ =‚ɯßz>|>MD!x<³z>ڸjS\>))#  =¸>>H}(i{&]@*( !}2E!9L++|ʥ !!* N9!!Z N9!9L##L!K | !9L##!Q!!9L##Lg "( *( !* ͐ !*( "( * !" !9L* F!9L* F͛e * #" +!9LF|b !"  !9L* F!9L* F4[ ;* * * !}2E!" # !99}#͓ !9F< | * !9F}* #" !9F|) * | ! & ! !* +" !9FͯH !9F͓ͯg * !ͣ !" !9F|’ * * ͣ * " !9F+++ͯ° !9F͓ͯ !# !" !" !9Fͯ !9F͓ͯ !9F͓ͯʊ * 6!" * * M 2 * #"  * F! 9L͟( ! ! 9L͟!" * w * #" # * !ͣ !9F| !! 9LN9!" !" !# í * 6!" * *  * #" * F! 9L͟ " " " 3S* !! N" !9F Y !9F͓*] !9L!ͯ"] *] ʕ *] "] !_ NͨÎ !9F }!9F }!!=!9F!9F!!R!9L6 ! !9L#Q!9L!͔͓>!9LP͓ !9L*L!"L*L)!9LL͓ʔ|*L#"L+X*L)!9LL͙q"L!9LF|!9L#Q+FÙ! TYPER Ver. 2.0 by Harvey G. LordPlaced in the public domain on 10/14/83Simple line editor. Sends one line at a time to theLST: device (printer) or to a disk file: especiallygood for addressing individual envelopes.Usage: TYPER <== Prints instructions, output goes to LST: TYPER PRINTER <== No instructions, output to LST: TYPER d:file.typ <== No instructions, output to disk fileEditing Commands: ^H = Destructive backspace ^U or ^X = Cancel current line ^C or ^S = Clear screen ^P = Display prompts , ^J, or ^M = Send line to indicated device ^Z = End of session ^B = AbortThis version of TYPER is Lear-Sielger ADM-3A terminal dependant.Press any key to continue.Press any key when your printer is plugged in and ready to run.^B aborts.PRINTERL----!----!----!----!----!----!----!----!----!----!----!----!----!----!----RSorry, I can't open the file.w*+%"H%"F%"D " " "y 6"C+6+!^6 F+N+<!* !!9~#ʗ RO"k'k +}|+#~ʂu6#~#<ʷ>!4R6#6*!h * |ʴ!ͯ"r! ͯ" R Can't open > or < file.$èw*6 )! 9!"6ɼ*:B<*C 2B ́F  €> _*C~+#4N s> > !+:EºF2B_~ý   > G ʘG!* ͟> !+}  > _con:rdr:pun:lst: ==_~O7 !"# !  #¾i& ~º!h~#~#F6%pw6237!9Ly=S>wD<!gs 6#6 ~+|s#r{{ ڟ!+#^{!!Pw#w!g~<6 !|~r!N!nL}*eyb>w#%!=)${=Sbtx h&{ !~!nN#F{p+pH#x¯ ڽ+!9~ !~b!5> 6> *e w`i#Q᯾%,!$|!!9n&:ʟɯ2>[!9L):|!PwL#4!^w>2>2-:Ecx:-O”! DMi:- !Write error - Disk full $`i7.!9~=+SV+^+F+N "I> w+ w w##w w #~+:&~##K@~#.7K&*I++Kw#=a O! ~_#V!$r+sbk#|}o|g}o|g}o|g|!,|}!­­,ɯ|ʙ!|}!-z{!,zz{!-|!|g|}! -ɵz{!-||g}o).{ozg+|/g}/o~og~#fos#rN#F#xr~#~#[[`iDM!z>‚S\))Ҋ =‚ɯßz>|>MD!x<³z>ڸjS\>))#  =¸>>J*k}(_*<*( !}2E!9L++|ʧ !!* P9!!Z P9!9L##L!G | !9L##!Q!!9L##Li "( *( !* ͒ !*( "( * !" !9L* F!9L* F͛g * #" +!9LF|d !"  !9L* F!9L* F4] ;* * * !}2E!" % !99}#͓ !9F> | * !9F}* #" !9F|+ * | ! ( ! !* +" !9FͯJ !9F͓ͯi * !ͥ !" !9F|” * * ͥ * " !9F+++ͯ² !9F͓ͯ !% !" !" !9Fͯ !9F͓ͯ !9F͓ͯʌ * 6!" * * O 4 * #"  * F! 9L͟* ! ! 9L͟!" * y * #" % * !ͥ !9F| !! 9LP9!" !" !% ï * 6!" * *  * #" * F! 9L͟ " " " 3O* !!! P" !9F [ !9F͓*_ !9L!ͯ"_ *_ ʗ *_ "_ !a PͨÐ !9F }!9F }!!=!9F!9F!!R!9L6 ! !9L#Q!9L!͔͓@!9LP͓ !9L*N!"N*N)!9LL͓ʖ~*N#"N+Z*N)!9LL͛s"N!9LF|!9L#Q+FÛ! TYPER Ver. 2.0 by Harvey G. LordPlaced in the public domain on 10/14/83Simple line editor. Sends one line at a time to theLST: device (printer) or to a disk file: especiallygood for addressing individual envelopes.Usage: TYPER <== Prints instructions, output goes to LST: TYPER PRINTER <== No instructions, output to LST: TYPER d:file.typ <== No instructions, output to disk fileEditing Commands: ^H = Destructive backspace ^U or ^X = Cancel current line ^C or ^S = Clear screen ^P = Display prompts , ^J, or ^M = Send line to indicated device ^Z = End of session ^B = AbortThis version of TYPER is Televideo 920 terminal dependant.Press any key to continue.Press any key when your printer is plugged inand ready to run.^B aborts.PRINTERL----!----!----!----!----!----!----!----!----!----!----!----!----!----!----RSorry, I can't open the file.w/* TYPER.C Ver. 2.0 - simple line editor sends each line to device * indicated on the command line. * * Usage: TYPER <== prints instructions, output goes to LST: * TYPER PRINTER <== no instructions, output to LST: * TYPER d:file.typ <== no instructions, output to disk file * * Commands: * ^H = Destructive backspace * ^U or ^X = Cancel current line * ^P = Display prompts * ^C or ^S = Clear screen * , ^J, or ^M = Send line to device or file * ^Z = End of session * ^B = Aborts * * Written for the C/80 C compiler, Ver. 3.0. * With the compiler on A: and this source file on B: * compile with the -c switch, thus * c -c1020 b:ostyper2 * * Televideo 920C terminal dependant - Osborne 1 emulates a Televideo 920. * * Written and placed in the public domain by Harvey G. Lord on 10/14/83. * Please send bug reports via modem (300 or 1200 baud) to 203-429-8044. * Enjoy. */ #define EOF -1 #define NULL '\0' #define EOS NULL #define TRUE 1 #define TAB 5 /* If you change TAB, change the ruler, too */ #define CTRLC 0x03 #define CTRLH 0x08 #define CTRLI 0x09 #define CTRLJ 0x0A #define CTRLL 0x0C #define CTRLM 0x0D #define CTRLP 0x10 #define CTRLS 0x13 #define CTRLU 0x15 #define CTRLX 0x18 #define CLS putchar(26) #define ESC putchar(27) #define HOME putchar(30) #define BUF_SIZE 80 #define SCREEN_HEIGHT 23 char line_buf[BUF_SIZE]; main(argc,argv) int argc; char *argv[]; { extern char Cmode; int fdes; /* File descriptor */ static char *instructions[] = { "TYPER Ver. 2.0 by Harvey G. Lord", "Placed in the public domain on 10/14/83", "", "Simple line editor. Sends one line at a time to the", "LST: device (printer) or to a disk file: especially", "good for addressing individual envelopes.", "", "Usage: TYPER <== Prints instructions, output goes to LST:", " TYPER PRINTER <== No instructions, output to LST:", " TYPER d:file.typ <== No instructions, output to disk file", "", "Editing Commands:", " ^H = Destructive backspace", " ^U or ^X = Cancel current line", " ^C or ^S = Clear screen", " ^P = Display prompts", " , ^J, or ^M = Send line to indicated device", " ^Z = End of session", " ^B = Abort", "", "This version of TYPER is Televideo 920 terminal dependant.", "", "Press any key to continue.", NULL }; static char *print_mes[] = { "", "", "Press any key when your printer is plugged in", "and ready to run.", "", "^B aborts.", NULL }; Cmode = 0; /* Single byte I/O */ if(argc != 2) /* No arguments */ { CLS; display(instructions); /* Display explanations */ getchar(); CLS; display(print_mes); getchar(); } if(strcmp(argv[1],"PRINTER") == NULL) /* If argument is "PRINT" */ argv[1] = "LST:"; /* Then send buffer to LST: */ CLS; fdes = file(argv[1]); /* Open file for writing */ typer(fdes,instructions); /* Get stuff on screen and send it to the file or LST: */ CLS; fclose(fdes); /* Close file */ } int strcmp(s,t) /* Return <0 if s0 if s>t */ char s[], t[]; /* from Kernighan and Ritchie */ { int i; i = 0; while (s[i] == t[i]) if (s[i++] == '\0') return NULL; return s[i] - t[i]; } /* End of strcmp */ typer(fdes,instructions) /* Get array; send to file or LST: */ char *instructions[]; int fdes; { char c; int i, j, vert; /* i is the array subscript j is a counter vert is the vertical line counter */ Cmode = 0; /* Single byte I/O */ vert = 1; /* Begin at line #1, not line 0 */ ruler(); while((c = getchar()) != EOF) /* Get characters one at a time */ { if(isdisplayable(c)) /* Displayable ASCII char */ { line_buf[i] = c; /* Put char into buffer */ ++i; } else if(c == CTRLH) /* Backspace */ { if(i == 0) /* Beginning of line */ putchar(CTRLL); /* Move right */ else /* Not beginning of line */ { putchar(' '); /* Write a space */ putchar(CTRLH); /* Backspace */ --i; /* Decrement subscript */ } } else if(c == CTRLU || c == CTRLX) /* Cancel line */ { cursor(vert,0); /* Beginning of line */ del_line(); /* Delete whole line */ i = NULL; /* Zero subscript */ } else if(c == CTRLI) /* Tab */ { cursor(vert,i); i = detab(i); /* Place spaces in array & on screen */ } else if(c == CTRLC || c == CTRLS) /* Clear screen command */ { CLS; /* Clear screen */ ruler(); /* Replace ruler line */ i = NULL; /* Beginning of buffer */ vert = 1; /* First line below ruler */ } else if(c == '\n' || c == CTRLJ || c == CTRLM) /* CR/LF */ { line_buf[i] = EOS; /* End of string */ for(j = 0;j <= i;++j) /* Send buffer to file or LST: */ putc(line_buf[j],fdes); putc('\n',fdes); i = NULL; /* Beginning of buffer */ if(vert < SCREEN_HEIGHT) /* If not at screen bottom */ ++vert; /* Increment vert counter */ ruler(); cursor(vert,0); } else if(c == CTRLP) /* Display instructions */ { CLS; display(instructions); getchar(); vert = 1; /* First line below ruler */ i = NULL; /* Beginning of buffer */ CLS; ruler(); } } line_buf[i] = EOS; /* End of string */ for(j = 0;j <= i;++j) /* Send buffer to file or LST: */ putc(line_buf[j],fdes); } /* End of typer */ ruler() /* Put ruler line at screen top */ { int i; static char *ruler_line[] = { "L----!----!----!----!----!----!----!----!----!----!----!----!----!----!----R", NULL }; HOME; display(ruler_line); } /* End of ruler */ isdisplayable(c) /* True if char is displayable */ char c; { return(c >= ' ' && c <= 127); } /* End of isdisplayable */ file(fname) /* Open output file in write mode */ char *fname; { int i; static char *error[] = { "", "Sorry, I can\'t open the file.", "", NULL }; i = fopen(fname,"w"); /* Open the file */ if(i > 0) return i; /* Return channel number */ display(error); /* If no channel #, display an error message */ exit(); } /* End of fileout */ cursor(v,h) /* Televideo 920C cursor positioning */ char v, h; { v += 32; h += 32; ESC; putchar(61); putchar(v); putchar(h); } /* End of cursor */ del_line() /* Delete line to right of cursor */ { /* Televideo 920C dependant */ ESC; putchar(82); } /* End of del_line */ detab(i) /* Expands tabs into spaces until next tabstop */ int i; { do /* Every tab expands to at least one space */ { line_buf[i] = ' '; /* Put space in buffer */ putchar(' '); /* Put space on screen */ ++i; /* Increment the array subscript */ } /* And check to see if we're on a tabstop now. */ while((i % TAB) != NULL && i <= BUF_SIZE) /* If not tabstop, again */ return i; /* If tabstop, inform typer */ } /* End of detab */ display(array_name) /* Displays large char arrays */ char *array_name[]; { int i; for(i = 0;array_name[i] != NULL;i++) puts(array_name[i]); } /* End of display */ puts(string) /* Display string & append a cr/lf */ char *string; { while (*string) putchar(*string++); putchar('\n'); } /* End of puts */  Documentation for TYPER.COM Ver. 2.0 and it's relatives, OS-TYPER, KP-TYPER, M-TYPER ... by Harvey G. Lord Did you ever need to address one envelope, not have a typewriter handy, and want the Post Office to be able to read the address? TYPER turns your computer printer into a simple typewriter for small, one-shot jobs. *** USAGE *** ==> TYPER displays one screen of prompts, asks you to get your printer ready, then displays a ruler line at the top of the screen. Anything you type goes to the printer (CP/M LST: device) when you press . ==> TYPER PRINTER avoids the initial prompt screen and printer warning. ==> TYPER d:file.typ avoids the initial prompt screen and redirects output to a disk file instead of the printer. *** EDITING COMMANDS *** TYPER responds to eleven editing commands. ==> Destructive Backspace: CTRL-H To correct typing errors on the current line, ^H. Many terminals generate a ^H with their left arrow key (<-) or with their backspace key. ==> Delete Current Line: CTRL-U or CTRL-X To delete the current line (so you can do it right this time), ^U or ^X are identical. These are the same as CP/M's command line editing functions. ==> Display Prompts: CTRL-P To display one screen of prompts, ^P. The prompts are the same ones displayed when you type the program's name without the word "PRINTER" or a disk file name after it. When you type ^P in the middle of a line, that line is lost. ==> Clear Screen: CTRL-C or CTRL-S To clear the screen, leaving the ruler line at the top, ^C and ^S are identical. When you press ^C or ^S in the middle of a line, that line is lost. These commands do NOT pause the program or abort. ==> Print line: , ^J, or ^M To send the current line to the printer or designated disk file, , ^J, and ^M are identical. This sets the cursor on the next line. Once a line is printed on the printer or a file, TYPER cannot edit it. ==> End of session: ^Z To end the session gracefully, ^Z. This sends that line's characters to the printer (or file), closes the LST: device (or file), and exits to CP/M. ==> Abort: ^B To abort the program, ^B. This discards any characters in that line and exits to CP/M immediately. There are three ways to delete the current line. (1) ^U or ^X visibly clears the line on the screen and lets you start over, (2) ^C or ^S clears the whole screen, including the current line, and (3) ^P clears the screen and displays the prompt message. It's best, therefore, to press ^C, ^P, or ^S when the cursor is in the left-most column. In that case, there's nothing in the line and nothing to accidently lose. The ruler line is a reference only. Its right margin is not a hard margin, only a guide to tell you when the right side of the screen is nearby. After the eightieth column, the TAB key generates single spaces, not five-space tabs. *** Editing Command Summary *** ^H = Destructive backspace ^U or ^X = Cancel current line ^P = Display prompts ^C or ^S = Clear screen , ^J, or ^M = Send line to device or file ^Z = End of session ^B = Abort *** SUGGESTION *** If you get a customized version of TYPER like OS- TYPER, KP-TYPER, or M-TYPER (Osborne 1, KayPro II, and Morrow MicroDecision respectively) rename it to TYPER. That's easier to type on the command line and the prompts make more sense. *** CUSTOMIZATION NOTES *** TYPER is terminal dependant. I've customized it for the Televideo 920C terminal and for the Lear Siegler ADM-3A terminal. The Televideo version is called OS-TYPER and the ADM-3A version is called KP-TYPER. To modify TYPER for a different terminal, three changes are required: (1) The #define statement for CLS may require modification. If your terminal requires a complex screen-clearing sequence, you may need a function to do the job. (2) The cursor(v,h) function may need modification, though the same one works for the Televideo and the Lead Siegler. (3) The del_line() function may need changing. Once you've changed these functions and the #define statement, recompile: c -c1020 d:typer. To change the tab stops, change the #define statement for TAB and change the ruler line in the ruler() function. Recompile as above. *** ACKNOWLEDGEMENTS *** Version 1.0 of TYPER was written by Dave Blair in 8080 assembly code. His version permitted no editing at all. It was interesting, but not very useful; typographical errors weren't correctable. Walt Wheeler suggested that a few editing commands plus constant ruler-line display would make this a useful program. TYPER Ver. 2.0 was written for the C/80 C compiler Ver. 3 by Walt Bilofsky (Software Toolworks, 15233 Ventura Boulevard, Suite 1118, Sherman Oaks, CA 91403). *** OWNERSHIP NOTICE *** TYPER was written on 10/13/83 by Harvey G. Lord. After debugging and adding a few improvements, it was placed in the public domain by the author on 10/14/83. You may do with this as you please; use it, sell it, eat it for breakfast. I ask that you do not delete my name. If you find TYPER useful, please give it to friends. Please report any bugs or improvements to me at 203- 429-8044 after 5:00 P.M. EST, or on weekends. Enjoy. H.G.L.