rWP32

Products: rWP32
Developer(s): Bob Orrfelt
Date: 1985
Type: ROM
Platform(s): TS 2068

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 with LOAD U$ DATA B$() and SAVE 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 A and 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,251 selects a bold font in RAM (presumably set up by the machine code) and POKE 23607,60 returns to the ROM font, so LPRINT prints in the chosen style.
  • ON ERR GO TO 2340 catches errors while typing and treats them as a space.

Potential Issues

  • Line 1430, in the delete-line routine, updates A$(330) instead of B$(330). A$ is never dimensioned, so deleting a line appears to stop the program with an error, and the line count is not reduced.

Related Products

Word processing program on dock cartridge. 1/4″ high headlines, figures in text, full screen editor, extra character sets, printer format control, banners and more.

Image Gallery

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.