|
Commodore PET
Memory Test
Taken from pages 8 & 9 of "The PET Revealed" by Nick
Hampshire (c) 1979 reprinted 1980
...The number of bytes of user memory available is
displayed on the screen when the machine is switched on, this is a fairly good
way of detecting any memory faults. If on an 8K machine the number of bytes free
is less than 7167 then there is a memory fault in the byte at location -number
of bytes free + 1025. Some memory faults are however not detected by the system
diagnostics, to find some of these a slightly more sophisticated diagnostic
program is required. One way of doing this is to load each byte with 10101010 -
or decimal 85, then test if the byte contains this bit pattern. If it does, then
the same byte is loaded with - 01010101 -or decimal 170 and again tested. Other
values used to load and test each byte are 0 and 255. This procedure will detect
most faults due to pattern sensitivity or leaky bit locations.
The following Basic program will test the memory of a standard 8K PET, and
indicate the location and bit pattern of the fault. It is written in Basic and
therefore prevents one from testing the bottom 2K of memory, rewritten in
machine code this problem could be overcome. The program also detects time
dependent errors by displaying the time taken to test each 1K block.
Though this
program tests only an 8K machine it could be modified for larger machines.
The
program starts by requesting the start and end memory locations of the test:
5 INPUTA,B
10 PRINT" [CLEAR]":TI$="OOOOOO"
20 FORI=ATOB
21 FORY=1TO4
22 READN
23 POKEI,N:X=PEEK(I)
24 IFX=NTHEN26
25 GOSUB200
26 NEXT
27 RESTORE
30 DATAO,85,170,255
110 PRINT "[HOME,DOWN 11]";I-1024,I,TI$
120 NEXT
130 PRINT "END OF TEST"
140 END
200 IFX=1ORX=2ORX=4ORX=8ORX=81ORX=84ORX=87ORX=93THEN300
210 IFX=162ORX=164ORX=171ORX=174ORX=247ORX=251ORX=253ORX=254THEN3O0
220 IFX=16ORX=32ORX=64ORX=128ORX=21ORX=69ORX=117ORX=213THEN350
230 IFX=42ORX=138ORX=186ORX=234ORX=127ORX=191ORX=223ORX=239THEN350
300 A$="I":GOTO400
350 A$="J"
400 IFI<=2047THEN500
410 IFI<=3071THEN510
420 IFI<=4095THEN520
430 IFI<=5119THEN530
440 IFI<=6143THEN540
450 IFI<=7167THEN550
460 GOTO 560
500 B$="2":GOTO600
510 B$="3":GOTO600
520 B$="4":GOTO600
530 B$="5":GOTO600
540 B$="6":GOTO600
550 B$="7":GOTO600
560 B$="8":GOTO600
600 PRINT"YOU HAVE A FAULT AT ADDRESS ";I;"IN ROW ";A$;B$;".",N,X
605 RETURN
commodore,pet,ram,memory,fault,diagnostic,test,chips,sockets,nick hampshire,pet
revealed
|