Typing In Magazine Listings: TYPO, TYPO II, the Automatic Proofreader and MLX

In the 1980s the cheapest way to get new Atari software was to type it in from a magazine or book. Antic, ANALOG Computing and COMPUTE! printed pages of BASIC every month, and each magazine developed its own checksum proofreader, a small program that catches typing mistakes line by line. Those listings are still fun to type today, on real hardware or in an emulator, and the proofreaders still work. This guide explains the listing conventions, how each proofreader works, and how to use them.

What you'll learn: how to read special characters in printed listings, how to use Antic's TYPO and TYPO II, COMPUTE!'s Automatic Proofreader and MLX, what ANALOG used, and how to avoid the classic typing traps.

What you need: an Atari with Atari BASIC (built into XL/XE machines; a cartridge on the 400/800/1200XL), a disk drive or cassette to save your work, and the proofreader that matches the magazine your listing came from. The checksums only mean something with that magazine's own checker.

1. Before you start: general habits

COMPUTE!'s book appendices give advice that still holds:

  1. Type lines in order, pressing RETURN at the end of each.
  2. Watch the look-alikes: letter O versus zero, letter l/I versus one.
  3. SAVE before you RUN, and SAVE often. A mistyped POKE can lock the machine, and everything in memory goes with it.
  4. If an error is reported in a line that READs DATA, the mistake is usually in the DATA statements, not the READ line.
  5. When saving a work in progress on a real machine, keep two copies.

2. Reading special characters

Atari listings often contain inverse-video letters, graphics characters (CONTROL plus a letter) and cursor-control codes inside quotes. The magazines handled them differently:

  • Antic printed listings in a custom font that shows each ATASCII character as it appears on screen. A "special characters" table explained the keystrokes: hold CTRL or SHIFT while pressing the next key, press and release ESC before the next key, and toggle inverse video with the Atari logo key. XL models have a Reverse Video key instead, and the 1200XL controls inverse from the function row.
  • COMPUTE! used braces. {CLEAR} means ESC then SHIFT-CLEAR. {UP}/{DOWN}/{LEFT}/{RIGHT} mean ESC then CTRL plus the arrow key. {T} means CTRL-T, the ball graphic. {10 SPACES}, {3 LEFT}, {20 R} mean repeat the character that many times. A brace item printed in inverse means type it with the Atari key on.

When a line is full of these, type slowly and use the proofreader to confirm before moving on.

3. Antic's TYPO (1982)

TYPO, short for "Type Your Program Once," was written by Bill Wilkinson of Optimized Systems Software and published in Antic's third issue (August 1982). Antic later said it was the first automatic proofreading program for type-ins ever printed in a computer magazine. It works on a finished program rather than line by line:

  1. Type in TYPO and LIST it to disk (LIST "D:TYPO.LIS") or to its own cassette.
  2. NEW, then type the magazine program.
  3. LIST the program to disk, NEW, and ENTER it back. This puts the variable table in a clean order.
  4. ENTER "D:TYPO.LIS" to merge TYPO onto the end.
  5. GOTO 32000. TYPO prints a table of line ranges, each with a byte length and a two-letter code, plus a variable checksum. Compare it with the table printed beside the listing.

How to read the result: if the length matches but the code doesn't, you've misspelled something or used the wrong punctuation. If the length differs, you've added or dropped characters, often in a quoted string or REM. If the variable checksum differs, you've misspelled a variable name or entered lines out of order, and you must repeat the LIST/NEW/ENTER ritual after fixing it. Keywords are tokenized to one byte, so abbreviations are fine as long as the LISTed result matches. Wilkinson warned that BASIC A+ gives different codes because its tokens differ.

4. Antic's TYPO II (1985 onward)

TYPO's weakness was that it couldn't say which line was wrong. Starting with the January 1985 issue, Antic switched to TYPO II by Andy Barton, with ideas contributed by Bill Wilkinson. It's a short all-BASIC program that sits at line 32000 and up and works on any Atari of any memory size:

  1. Type in TYPO II and SAVE a backup. BASIC XL users must type SET 5,0 and SET 12,0 first.
  2. GOTO 32000. The screen says "Type in a program line."
  3. Type the first line of the listing without the two-letter code printed at its left. Press RETURN.
  4. The line reappears near the bottom of the screen with TYPO II's two-letter code. If it matches the magazine's code, type the next line. If not, press RETURN and the line moves up for editing.
  5. To recheck any earlier line, type * and its line number (no space), e.g. *120. This is also how you check TYPO II itself.
  6. To LIST your work, press BREAK and type LIST. To resume, type GOTO 32000.
  7. To remove TYPO II when you're done: LIST "D:FILENAME",0,31999 (cassette: LIST "C:",0,31999), then NEW, then ENTER "D:FILENAME", then SAVE.

TYPO II enters each line by putting the screen editor into "forced read" mode. The trick: POKE 842,13 makes the editor read the screen as if RETURN were pressed, and POKE 842,12 restores normal keyboard input. Antic also noted that TYPO II catches transposed characters, which the original TYPO couldn't see. One thing to watch: ? and PRINT give different codes.

Antic published several reader enhancements: Turbo TYPO II (June 1985), a speed-up with a three-line fix; the TYPO II Double Feature (November 1985); and AutoTYPO by Brian Sandford (November 1986). With AutoTYPO you type the two-letter code before the line number. A wrong line sounds a beep and turns the screen red. CTRL-R enters a review mode, CTRL-L lists to a device, and CTRL-B returns to BASIC. Neither TYPO II nor AutoTYPO can tell you a line is missing, so tick lines off as you go.

5. COMPUTE!'s Automatic Proofreader

COMPUTE! magazine and its books printed a checksum to the left of each line, for use with "The Automatic Proofreader" by Charles Brannon. Unlike TYPO II, it hides in memory and checks every line you enter at the normal READY prompt:

  1. Type it in (listing below), being especially careful with the DATA.
  2. SAVE it at least twice before running it.
  3. RUN. It totals its own DATA and stops with an error message if the total isn't 19072.
  4. When it says it's activated, type programs as usual. After each RETURN, two letters appear at the top of the screen. Compare them with the checksum printed beside the line. Don't type the printed checksum.
  5. SYSTEM RESET disables it. PRINT USR(1536) turns it back on.

Its quirks: it ignores spaces entirely, so check spacing by eye where it matters. It can't detect transposed characters, since the order of characters doesn't change the sum. Abbreviated keywords give the wrong checksum, but you can fix that by LISTing the line, moving the cursor onto it and pressing RETURN again. That doesn't work for ?, which is never the same as PRINT to the Proofreader.

100 GRAPHICS 0
110 FOR I=1536 TO 1700:READ A:POKE I,A:CK=CK+A:NEXT I
120 IF CK<>19072 THEN ? "Error in DATA Statements. Check Typing.":END
130 A=USR(1536)
140 ? :? "Automatic Proofreader Now Activated."
150 END
1536 DATA 104,160,0,185,26,3
1542 DATA 201,69,240,7,200,200
1548 DATA 192,34,208,243,96,200
1554 DATA 169,74,153,26,3,200
1560 DATA 169,6,153,26,3,162
1566 DATA 0,189,0,228,157,74
1572 DATA 6,232,224,16,208,245
1578 DATA 169,93,141,78,6,169
1584 DATA 6,141,79,6,24,173
1590 DATA 4,228,105,1,141,95
1596 DATA 6,173,5,228,105,0
1602 DATA 141,96,6,169,0,133
1608 DATA 203,96,247,238,125,241
1614 DATA 93,6,244,241,115,241
1620 DATA 124,241,76,205,238,0
1626 DATA 0,0,0,0,32,62
1632 DATA 246,8,201,155,240,13
1638 DATA 201,32,240,7,72,24
1644 DATA 101,203,133,203,104,40
1650 DATA 96,72,152,72,138,72
1656 DATA 160,0,169,128,145,88
1662 DATA 200,192,40,208,249,165
1668 DATA 203,74,74,74,74,24
1674 DATA 105,161,160,3,145,88
1680 DATA 165,203,41,15,24,105
1686 DATA 161,200,145,88,169,0
1692 DATA 133,203,104,170,104,168
1698 DATA 104,40,96

Listing from COMPUTE!'s Atari Collection, Volume 1 (1985), checked against the copy in Volume 2. The 165 DATA values sum to 19072, the total line 120 tests for.

How it works. The routine loads into page 6 (1536–1700), so it can't share memory with a program that also uses page 6. It searches the OS handler table HATABS at 794 ($031A) for the E: entry, copies the screen editor's vector table from ROM at $E400 into page 6, and points E: at the copy with its "get byte" vector redirected to a small wrapper. Every character passing through the editor, except spaces, is added into location 203 ($CB). Locations 203–209 are the only zero-page bytes guaranteed free under BASIC. When RETURN (ATASCII 155) comes through, the wrapper clears the top screen line and writes the two halves of the sum as inverse letters A–P (via SAVMSC at 88), then zeroes the total. Pressing RESET rebuilds HATABS, which is why it switches the Proofreader off.

6. COMPUTE!'s MLX for machine language

For long machine-language listings, COMPUTE! used MLX, a "Machine Language Editor" by Charles Brannon. Each listing line holds six numbers plus a checksum. MLX accepts only digits, rejects values over 255, and won't accept a line whose checksum doesn't match. It buzzes and makes you retype it. On the Atari, MLX asks for a starting address, ending address and run/init address, then whether to make a tape (T) or disk (D) file, and whether to write a boot disk or a binary file (F). Use CTRL-S to save, CTRL-L to load, CTRL-N for a new address and CTRL-D to display, so you can finish a long listing over several sessions. MLX can't check itself, so type MLX carefully.

7. ANALOG Computing's checkers

ANALOG listings came with their own checker. Articles told readers, for example, to "check your typing with D:CHECK2" (Tom Hudson's BOFFO, ANALOG #24, November 1984), and modern hobbyists still mention ANALOG's later Unicheck when typing those listings. ANALOG checksums only match ANALOG's checkers, so don't run an ANALOG listing through TYPO II or the Proofreader and expect the printed codes to agree.

Troubleshooting

  • Codes never match, even on simple lines: you're using the wrong magazine's checker, or (for TYPO II) BASIC XL without the SET commands.
  • Every line is off by the same amount after a certain point: with TYPO, suspect the variable order. Do the LIST/NEW/ENTER sequence.
  • The Proofreader's letters disappeared: you pressed RESET or ran a program that rebuilt the device table. PRINT USR(1536).
  • The program you typed crashes even though every code matched: check for missing lines and the O/0 and l/1 swaps inside DATA. The Proofreader also misses transpositions.
  • Typing a particular line locks the machine: this can happen with Revision B BASIC (built into the 800XL) while a resident checker such as Unicheck and DOS are loaded; the same line may go in fine on a Revision C cartridge, or on Rev. B without the checker. If a line hangs, save, then try another BASIC revision or drop the resident checker for that line. Antic's I/O Board likewise steered readers away from Revision B, which can add 16 garbage bytes to saved programs, toward Revision C.
  • Can't type a control character: use the magazine's table, or check whether the article offers a helper. Antic's AutoTYPO came with a short program that generates its trickiest line for you.

Further reading

  • Best of Antic, Volume 1 (Antic Publishing): includes TYPO and the listing-convention tables.
  • COMPUTE!'s Atari Collection, Volumes 1 and 2 (COMPUTE! Publications, 1985): appendices "A Beginner's Guide to Typing In Programs," "How to Type In Programs" and "The Automatic Proofreader."
  • COMPUTE!'s Second Book of Machine Language: the MLX appendix.
  • Related guides on this site: Saving and loading BASIC programs, Atari BASIC essentials, and the Type-ins section.

Credits