Automatic Proofreader
termKept in this browser · My desk
A small program printed by the American publisher Compute! in the 1980s that showed a one-byte checksum for each line a reader typed in, to be compared with the number printed at the end of that line in the listing.
In the version printed in a Compute! book of 1984 it is 133 bytes of 6502 machine code, loaded at addresses 886 to 1018. It puts itself in the path of the computer's input routine, adds the code of every character typed on a line except spaces to a total kept in one byte, and when RETURN is pressed prints the total, 0 to 255, at the top of the screen. The listing prints the expected number after ':rem', so a reader who typed it by mistake added only a harmless remark.
What it is. The Automatic Proofreader was a small program printed by the American publisher Compute! in the 1980s that showed a one-byte checksum for each line a reader typed in, to be compared with the number printed at the end of that line in the listing. It turned a chore, hunting for a typing error in a page of BASIC, into a comparison of two numbers.
How it works. In the version printed in Robert Camp's Compute! book Creating Arcade Games on the Commodore 64 (Greensboro, 1984) it is 133 bytes of 6502 machine code, loaded by a BASIC program that pokes them into addresses 886 to 1018 and refuses to run unless the 133 numbers add up to 17,539 (they do, in the text layer of the scan). It puts itself in the path of the computer's input routine, through the vector at 0324 and 0325 hexadecimal that normally points to the Kernal's CHRIN routine at F157, adds the code of every character typed on a line except spaces to a total kept in one byte, and when RETURN is pressed prints the total, 0 to 255, at the top of the screen. The listing prints the expected number after ":rem", so a reader who typed it by mistake added only a harmless remark. The book's Appendix J adds two warnings: the Proofreader is "not picky with spaces", and a line typed with abbreviated keywords gives a different number until the line is LISTed and entered again in full.
Worked by hand. The line "80 NEXT:NEXT" has the characters 8, 0, N, E, X, T, colon, N, E, X, T, with codes 56, 48, 78, 69, 88, 84, 58, 78, 69, 88, 84. Their sum is 800; one byte keeps 800 − 3 × 256 = 32, and the listing prints ":rem 32". The book's "Screendemo" lines carry the checksums 197, 83, 73, 85, 76, 236 and 32, and all of them can be recomputed the same way. A second line, "20 GOTO 10", has the characters 2, 0, G, O, T, O, 1, 0 once the space is dropped, with codes 50, 48, 71, 79, 84, 79, 49, 48; their sum is 508, and one byte keeps 508 − 256 = 252. Typing "20 GOTO 1O", with the letter O for the digit 0, changes the last code from 48 to 79, the sum from 508 to 539 and the checksum from 252 to 539 − 2 × 256 = 27, which the reader sees at once.
What it catches and what it misses. Any single wrong character changes the sum by the difference between two codes, so it is always caught ("NEXR" gives 30, since R is 82 where T is 84). Two characters swapped ("NETX") give the same sum and pass, as do two errors that cancel (A for B and S for R). Spaces are ignored by design.
Why so simple. The adding part is three instructions, four bytes: clear the carry, add, store (ADC in zero-page mode is 65 hexadecimal, 101 decimal). A check that weighed each position would have been longer, slower on every keystroke and harder for the reader to type in correctly, and the reader had to type the checker too. Its loader was itself checked by a sum: the 133 numbers must add up to 17,539.
Its sibling for machine code. For machine-language programs Compute!'s Gazette printed MLX, the "machine language entry program". Its June 1988 issue explains the difference: each MLX line holds eight data bytes and a checksum computed from those bytes and from the address, so a line typed at the wrong address fails; MLX catches transposed characters, A0 typed as 0A; and, "because of the checksum formula used", it cannot notice FF typed in place of 00 or the reverse. The Gazette's page on typing in its programs gives the context: listings were marked for the Commodore 64, 128, Plus/4 and 16, all 64 programs ran on the 128 in 64 mode, a mistyped number in a DATA statement could lock up the machine, and a program should therefore be saved before it was first run. The same issue tells readers to use the Automatic Proofreader to type in the new MLX itself, and by then its BASIC listings carried a two-letter code before each line number instead of the ":rem" numbers of 1984.
The lesson. Every checksum is a bet about which errors matter. A single mistyped key is one kind of error, and a plain sum catches it; a swap is another, and a check that depends on position, such as MLX's, which also takes in the address, is the price of catching it. Neighbours: checksum, Compute!, type-in program, ASCII, MOS 6502, hash.
Also known as: proofreader, compute! proofreader, revisor automático, type-in checksum, rem checksum
Sources
- Robert Camp, Creating Arcade Games on the Commodore 64, COMPUTE! Publications, Greensboro, 1984, Internet Archive scan and text layer (read 2026-11-23): the checksum printed after ':rem' at the end of every line; Appendix J: the Proofreader displays a number that must match the listing's, is 'not picky with spaces', and is fooled by abbreviated keywords until the line is LISTed; the BASIC loader poking 133 bytes into 886 to 1018 and checking that they sum to 17,539 (they do, in the text layer); 'Screendemo' lines with checksums 197, 83, 73, 85, 76, 236 and 32
- Norbert Landsteiner, 6502 Instruction Set, mass:werk (read 2026-11-23): opcodes and addressing modes used to read the Proofreader's bytes (ADC zeropage is 65 hexadecimal, 101 decimal)
- Michael Steil and others, Commodore 64 memory map, pagetable.com C64 reference (read 2026-11-23): 0324-0325 hexadecimal, IBASIN, vector to the Kernal CHRIN routine, normally at F157
- Compute!'s Gazette issue 60, June 1988, Internet Archive text (read 2026-11-23): MLX, the machine language entry program: eight data bytes and a checksum computed from the bytes and the address; transposed characters (A0 for 0A) caught; FF in place of 00 not noticed 'because of the checksum formula used'; use the Automatic Proofreader to type the new MLX; BASIC listings with a two-letter code before each line