ROM Test

Author(s): Cliff Danielson
Pub Details: Sinclair Timex User Group Newsletter v1 n6 (Volume 1, Issue 6)
Date: December 1982
Pages: 7

Often I marvel at the amount of information stored in my computer — both in RAM, a user changeable random-access memory, and in ROM, a fixed, read-only memory which makes user programs work. In the ROM, 8 K bytes of program and data are stored. This is 8 x 1024 = 8192 bytes or 65,536 bits of information. Each bit is either a 1 or 0 depending on what the designer wanted to do.

If one of those 64 K bits were in error, would the computer operate properly? It is conceivable that the error would be such that it would never be noticed. However, it could cause the computer to bomb. ROM errors don’t occur frequently, but I felt I needed a means of reassuring myself that my ROM did not contain an error. Thus, I devised a ROM checksum. This error checking technique is similar to “Syncsum” in Sync or “Syntactic Sum” in Syntax (which are used to verify correct program entry). The program is capable of running on any Sinclair or Timex computer.

5 LET K=8
10 LET A=0
20 LET B=0
30 FOR I=1 TO 1024*K
50 LET A=A+PEEK(I-1)
60 IF A<1000 THEN GOTO 90
70 LET B=B+1
80 LET A=A-1000
90 NEXT I
100 PRINT B;A

Using this program, which takes a few minutes to run in FAST mode, I got the checksum, 855106. So did several of my friends. This indicates that we probably all have the same ROM (the test is not foolproof). If you have the old 8 K ROM (the one with known bugs in it), let us know what sum you get. This technique could be used to identify ROMs. Changing line 5 to LET K=4, the sum is 428876. With a 4 K ROM (ZX-80) and K=4, the sum is 390829.

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