A 144-byte machine-code routine that makes screen output wrap at word boundaries, like a word processor, instead of splitting words at the right edge. The BASIC loader reads it from hex DATA lines into the printer buffer at 23408 (ON ERR ends the reading at the last DATA line), then redirects channel S output to the routine with POKE 26694,91: POKE 26693,128 and LISTs itself to show the effect.
A CLS turns the routine off: repeat the POKEs of line 70 to turn it back on. Since it lives in the printer buffer, do not use it with the TS2040 printer. ON ERR and RESET are TS2068 keywords.
Note: the listing has a printing error. Line 9991 is printed DATA “3A005BB9D46805CD”: the bytes D4 68 05 are CALL NC,0568h, but the TS2068 ROM’s new-line routine starts at 0566h. As printed, the screen is scrambled as soon as a line wraps. The download has the tape as printed and a second tape marked [f] with that one byte changed to 66 (DATA “3A005BB9D46605CD”), which wraps words as the article describes. Run in Browser uses the fixed tape. The listing here is as printed.
Published in Sinc-Link May-June 1989 (Wordwrap).
Source Code
1 REM Wordwrap by Steven V. Gunhouse
2 LET x=23408
3 ON ERR GO TO 70
5 LET a=10: LET b=11: LET c=12: LET d=13: LET e=14: LET f=15
10 READ a$
20 FOR n=1 TO 15 STEP 2
30 LET w=16*VAL a$(n)+VAL a$(n+1)
40 POKE x,w: LET x=x+1
50 NEXT n
60 GO TO 10
70 ON ERR RESET : POKE 26694,91: POKE 26693,128
80 LIST
100 REM A routine to cause screen output to "wordwrap" like a word processor
110 REM NOTE a CLS will require POKEs in line 70 be repeated to turn back on!
120 REM Resides in printer buffer - DO NOT USE WITH 2040 PRINTER
130 REM (Could be modified to work with a printer instead of screen.)
9981 DATA "00000000F5973200"
9982 DATA "5B11805BCD9705F1"
9983 DATA "FE213838FE803034"
9984 DATA "FE7B380ACB47282C"
9985 DATA "FDCB016628262100"
9986 DATA "5B6E23777D32005B"
9987 DATA "FE21C021005B7EA7"
9988 DATA "00C84F0600E5D123"
9989 DATA "EDB02E001B7E73CD"
9990 DATA "000518E7F5CD1A06"
9991 DATA "3A005BB9D46805CD"
9992 DATA "A35BF100320E5CFE"
9993 DATA "10380BFE1830071E"
9994 DATA "EA165BC39705FE20"
9995 DATA "2005CD1A060DC8C3"
9996 DATA "0005320F5C3A0E5C"
9997 DATA "1EF9FE1630E33A0F"
9998 DATA "5C11805BC3A10500"
9999 REM End of dataNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
