rWP32 is a 32-column word processor on an 8K cartridge (ROM) for the TS2068, written in BASIC by R. Orrfelt. The main menu loads text, enters text, formats it to the printer, saves text, or returns to BASIC. Text is typed straight onto the screen with a flashing cursor and the line and column shown in the top right corner; words that run past the end of a line wrap onto the next. The cursor keys move around the text, and the edit key switches to an edit mode where I inserts a blank line, C inserts a copy of the current line and D deletes one. The input menu offers review or edit from a chosen line, add to the end, a new file, and deletion of a block of lines.
Printing is driven by a format line typed in the Format menu: T prints the whole text, P asks for a range of lines, a space prints a blank line, and X and N switch bold and normal type. Text is kept in a 330-line array and saved to tape as a data file.
Program Analysis
Structure
- Lines 10–50: title REMs and
RANDOMIZE USR 40937, a machine code routine at the end of the cartridge’s 8K block. - Lines 300–930:
DIM B$(330,32), the main menu, and load and save withLOAD U$ DATA B$()andSAVE U$ DATA B$(). - Lines 1200–1970: edit mode (insert line, delete line and block delete); lines 2000–2985: the input menu and the typing loop with its cursor keys, insert, caps lock, delete, Enter and word wrap.
- Lines 4000–4830: the Format menu and printing.
Notable Techniques
- The number of lines in use is stored as text in the last row of the array,
B$(330), so it is saved and loaded with the file. - The cursor is an attribute, not a character: the program keeps the address of the cursor’s attribute byte in
Aand POKEs 184 (flashing, white paper, black ink) into it, restoring the original value when the cursor moves. - Bold printing works by changing the character set pointer, CHARS (23607):
POKE 23607,251selects a bold font in RAM (presumably set up by the machine code) andPOKE 23607,60returns to the ROM font, soLPRINTprints in the chosen style. ON ERR GO TO 2340catches errors while typing and treats them as a space.
Potential Issues
- Line 1430, in the delete-line routine, updates
A$(330)instead ofB$(330).A$is never dimensioned, so deleting a line appears to stop the program with an error, and the line count is not reduced.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.


