; TXTCOM.ASM v2 04 Aug 87 ; copyrighted (c) 1987 ; by Irvin M. Hoff ; ; This program lets you insert DB strings at the initial ++++ location, ; and after assembling, have a .COM file that will type out the text in ; those DB strings with pauses each screen. It has advanced pause and ; abort features and will advance one line at a time with the space bar. ; ; Ideal for help files, etc. on a RCPM. Only needs the one program and ; is VERY FAST. Suggest this sequence: ; ; 1) write the text file with your normal editor. ; 2) run through FILT7A to remove tabs, trailing spaces, ; high bits set, unwanted control characters, etc. ; D) assume your text is named HELPME.TXT and you want to ; convert that to a HELPME.COM file ; 4) convert to DB strings: ; ; B>TXT2 HELPME.TXT ; ; 5) this makes a file named HELPME.DB, now ready to use ; your editor to merge that file into this program: ; ; B>WS TXTCOM.ASM HELPME.ASM ; ; 4) then insert the original HELPME.DB file into the ; area of this program marked +++ ; ; (you may want to erase the very last line ; (of the HELPME.DB file with the '$' character ; (as it is not use and will otherwise show at ; (the end of the listing when displayed.) ; ; 5) assemble into HELPME.COM and ready to use ; ; This may sound like some nuisance compared with using SYNONYM, etc., ; and probably it is. However the end results will really be worth the ; effort. This program paginates automatically, stopping at each full ; screen with a [more] pause. You can turn up one line at a time with ; the space bar, pause or abort easily: ; ; s S ^S pauses (after completing current line) ; c C ^C, k K ^K, x X ^X aborts (after completing current line) ; ; - Irv Hoff, Sysop ; PRACSA RCPM ; ;----------------------------------------------------------------------- ; ORG 100H ; CR EQU 13 LF EQU 10 BDOS EQU 5 ; START: LXI H,0 ; HL=0 DAD SP ; HL=stack SHLD STACK ; Save stack pointer LXI SP,STACK ; Initialize local stack ; ; CALL ILPRT ;=============================== ; ++++ (Insert your text strings here, no terminating character ; ; ; ++++ (End of your text strings here, no terminating character ;=============================== DB 0 ; JMP EXIT ;..... ; ; Inline print routine - prints string pointed to by stack until a zero ; is found. Returns to caller at next address after the zero terminator. ; ILPRT: XTHL ; Save HL, get message address ; ILPLP: MOV A,M ; Get character PUSH H CALL CKABRT CALL CKPAG LDA STRCHR MVI C,6 ; Direct console output MOV E,A CALL BDOS ; BDOS POP H INX H ; Point to next MOV A,M ; Test ORA A ; For end JNZ ILPLP XTHL ; Restore hl, ret addr RET ; Ret past msg ;..... ; ; Check for a CTL-C or CTL-S entered from the keyboard. Jump to EXIT if ; CTL-C, pause on CTL-S. ; CKABRT: STA STRCHR CPI CR RNZ ; If not return ; MVI C,6 ; Direct console call MVI E,0FFH ; To receive rather than send CALL BDOS ANI 7FH ; Strip off any parity ORA A RZ ; No character, exit ; CPI 'S'-40H ; CTL-S JZ CKAB1 CPI 'S' ; Capital 'S' JZ CKAB1 CPI 'S'+20H ; Small 's' JNZ CKAB2 ; None of these, exit ; CKAB1: MVI C,1 CALL BDOS ; CKAB2: CPI 'C'-40H ; CTL-C? JZ CKAB7 ; Yes, quit CPI 'K'-40H JZ CKAB7 CPI 'X'-40H JZ CKAB7 CPI ' ' ; Any other CTL-character, abort JC CKAB3 JZ CKAB4 ANI 5FH CALL CKAB6 ; Clear the character from screen CPI 'C' JZ CKAB7 CPI 'K' JZ CKAB7 CPI 'X' JZ CKAB7 ; CKAB3: LDA STRCHR ORA A JZ CKAB5 RET ; CKAB4: STA STRLF ; Provides one line per space char. ; CKAB5: MVI C,9 LXI D,GOMSG CALL BDOS RET ; CKAB6: PUSH PSW MVI C,9 LXI D,CKMS2 CALL BDOS POP PSW RET ; CKAB7: MVI C,9 LXI D,CKMS1 CALL BDOS POP H ; Reset the stack to normal LHLD STACK ; Now exit back to CCP SPHL RET ;..... ; ; Exit with message (error or informational) ; MSGXIT: POP D ; Get msg MVI C,9 CALL 5 ; ; Exit, restoring DMA and stack, then return to CCP ; EXIT: LXI D,80H ; Reset DMA address to normal MVI C,26 CALL 5 LHLD STACK ; Get old stack SPHL ; Restore it RET ; Return to CCP ;..... ; ; Get console input via direct CBIOS call ; CKPAG: LDA STRCHR ; Get the character back CPI LF RNZ ; Return if not a LF ; LDA STRLF ; Increment counter INR A STA STRLF CPI 21 ; See if screen is nearly full RC ; If not, return ; ; Screen is nearly full, stop until reader is ready to go again. ; MVI C,9 ; Display the [more] message LXI D,MORMSG CALL BDOS XRA A ; Reset the line counter STA STRLF STA STRCHR ; Zero the character JMP CKAB1 ;..... ; ; Messages ; CKMS1: DB 13,10,13,10,'++ ABORTED ++',13,10,'$' CKMS2: DB 8,' ',8,'$' GOMSG: DB CR,' ',CR,'$' MORMSG: DB CR,LF,'[more] ','$' STRCHR: DB 0 STRLF: DB 0 DS 60 ; Stack depth ; STACK: DS 0 END