;--------------------------------------------------------------------------- ; TXT ver. 7.1 - A System Message Utility Program ; ; Note - If you feel the urge to improve upon this routine please ; send a copy to CP/M-NET(tm) EAST (201) 249-0691 thank you. ; ; See TXT-XX.DOC for usage information. ;--------------------------------------------------------------------------- ; Revisions in revers order: ; ; 05/04/85 - v7.1 ; Added forced first message display (until first pause) for EMX ; user level triggered abort. This is so that ONE message (the most ; important one) is always seen. - Harry Kaemmerer ; ; 04/30/85 - v7.0 ; Re-installed EMX conditionals and hooks (this program was designed ; for EMX... other uses came to light when we notice how nice it was ; to use Word Star(tm) or any other editor to edit text). Cleaned up ; some extra code and general display format. - Harry Kaemmerer ; ; 04/09/85 - v6.0 ; Corrected some revision numbers and credit problems and again bumped ; the version to 6.0 to get a jump on the version numbers as somehow ; this file never comes back to me until parallel versions have been ; distributed. If you can't send a copy of your modified version to ; CP/M-NET(tm) EAST then don't put it out to the public, else I will ; STOP letting you have my work. - Harry Kaemmerer ; ; 02/09/85 - v5.0 ; Added code to allow non-printing characters such as ESC to be ; synthesized in the text. This allows terminal control sequences and ; printer control codes to be sent. Rewrote documentation. - Terry Hazen ; ; 07/14/84 - v4.4 ; Added a line of code to strip hi-order bits from text to make text ; creation with WS Document mode easier. Now reads tildes even if ; created in Document mode. Added abort with <^X> to previous abort ; characters. - Terry Hazen ; ; 07/12/84 - v4.3 ; Program and documentation re-written. 'Hit ' was replaced ; with '[more]' to be consistant with other programs. Now aborts with ; <^C> or . <^S> pauses the text display. - Terry Hazen ; ; 06/30/84 - v4.2 ; Removed all of the exit commands so this program will work ; correctly with EMX systems. - Harry Kaemmerer ; ; 06/15/84 - v4.0 ; Revised file and added , abort character 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 original N-TXT.ASM version by Harry Kaemmerer ; 12/15/83 - Z-80 original TXT.ASM version by Simon Ewins ;--------------------------------------------------------------------------- ; NO EQU 0 ;define no YES EQU NOT NO ;define yes ;--------------------------------------------------------------------------- ; USER MODIFIABLE EQUATES: ; ; NON-EMX users set EMX to NO and ignore the rest ; EMX EQU NO ;yes if you are running EMX else no LEVEL EQU '5' ;level = > 5 may abort ABORT EQU 23 ;<^W> sysop private abort char. ACCESS EQU 0FFF8H ;EMX - ASCII access byte location ;--------------------------------------------------------------------------- ; Intercept character for synthesizing non-printing characters. ; ; Set to a character you will NOT be using in your text! Presently ; set to '^'. The character FOLLOWING the intercept character ; in the text will have 40H subtracted from it, then printed to the ; console and/or printer as a contol code (be sure you use UPPER ; case to indicate your code letter). ; INTCPT EQU '^' ;this character is for marker TILDE EQU '~' ;tilde character for pause marker ; ;--------------------------------------------------------------------------- ; ASCII CHARACTERS ; LF EQU 10 ;line feed CR EQU 13 ;carriage return CNTRLC EQU 3 ;control C CNTRLS EQU 19 ;control S CNTRLX EQU 24 ;control X EOF EQU 26 ;end of file marker ESC EQU 27 ;escape 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 ANI 7FH ;strip hi-order bit CPI 0 ;at end? JZ EXIT ;yes, so quit CPI INTCPT ;is it the intercept character? JZ SYNTH ;yes, go synthesize it ; LOOP4: CPI TILDE ;is it the page character? JZ 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: IF EMX ; CPI ABORT ;sysop special abort character JZ EXIT ;yes, abort MOV C,A ;save the input character in [C] for now LDA ACCESS ;what is the users level? CPI LEVEL ;minimum access level for abort JC LOOP2 ;bypass exit codes execept for sysop code LDA FSTIME ;first pause past? CPI 0 ;non-zero has paused JZ LOOP2 ;no MOV A,C ;yes, return character to [A] register ENDIF ;(emx) ; 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: LXI H,MSG1 ;point to the paging message CALL PRT ;print message LOOP5: CALL CONIN ;check for key pressed JZ LOOP5 ;loop until key pressed ; IF EMX ; CPI ABORT ;sysop special abort character JZ EXIT ;yes, abort MOV C,A ;save the input character in [C] for now LDA ACCESS ;what is the users level? CPI LEVEL ;minimum access level for abort MVI A,1 ;pause flag STA FSTIME ;save pause flag... MOV A,C ;and return character to [A] register JC TOOLOW ;bypass exit codes execept sysop code ENDIF ;(emx) ; 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 ; TOOLOW: LXI H,MSG2 ;clear message line CALL PRT ;do it... JMP LOOP2 ;look for input ; PRT: 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 ;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 RET ;done with message ; EXIT: POP H ;clean up the stack ; CONIN: MVI E,0FFH ;do a conin before exit MVI C,DIRIO ;direct input CALL BDOS ; ORA A ;set flags RET ; ; SYNTH: POP H ;get pointer INX H ;point to next character PUSH H ;save pointer MOV A,M ;get character SUI 40H ;subtract 40H JMP LOOP4 ;ok process special character now ; MSG1: DB ' [More...]',CR,0 ;paging message MSG2: DB ' ',CR,0 ;clean up line with spaces ; IF EMX ; FSTIME: DB 0 ;first time pause flag (zero no pause) ENDIF ;(emx) ; DB CR,LF,'Insert your text between' DB ' the "?" and the "^@" below:',CR,LF,CR,LF ;--------------------------------------------------------------------------- ; Message space starts here, and is as large as your TPA - 512 bytes ; ;--------------------------------------------------------------------------- DB '?',CR,LF ;no extra space, as it makes editing harder BUFFER: DB 0,CR,LF,CR,LF ;force a null DB 'Do not delete the null <^@> above,' DB ' it must be at the end of your text.',CR,LF DB EOF ;EOF marker to keep WordStar happy END ;