;Bob Schultz contributed this change to txt.asm because of the fact ;that bdos handles the ^S in a strange way: if the first character ;entered is not a ^S then it ignore the first and subsequent valid ;^S entries. ; ;-------------------------------------------------------------------- ; BDOS EQU 5 ;system call entry point BELL EQU 7 ;a bell if you whant one CONDIR EQU 6 ;direct console I/O CR EQU 13 ;carriage return LF EQU 10 ;line feed ; ;-------------------------------------------------------------------- ; ---- START OF PGM ---- ; 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 MOV E,A ;move character to e MVI C,CONDIR ;console out CALL BDOS ;bdos CALL CONIN ;check for key pressed JZ LOOP2 ;if no key then continue CPI 'S'-40H ;is it ^S? JNZ CHECKC ; if not check ^C LOOP1: CALL CONIN ;check for key pressed JZ LOOP1 ;loop until key pressed CHECKC: CPI 'C'-40H ;is it ^C? JZ EXIT ; if so exit LOOP2: POP H ;get pointer INX H ;and bump to next character JMP LOOP ;go on doing it ; EXIT: POP H ;clean up the stack RET ;return to CCP CONIN: MVI E,0FFH ;direct input MVI C,CONDIR CALL BDOS ORA A ;set flags RET DB '?',CR,LF ;start of buffer marker ;-------------------------------------------------------------------- ; Message space starts here, and is as large as your TPA -512 bytes ;-------------------------------------------------------------------- BUFFER: DB '<<-- Insert your Text between' DB ' the "?" and the "^@" -->>',CR,LF DB 0,26 ;force a NULL and an END of file marker END ;to keep the WordStar file clean