51 REM ATARI RAM TEST PROGRAM
52 REM BY ED STEWART 03/82
53 REM 11025 SAGEBRUSH AVE
54 REM UNIONTOWN OHIO 44685
99 REM SETUP SOME REQUIRED CONSTANTS
100 N1 = 1 : N2 = N1 + N1 : N255 = 255 : N256 = N255 + N1
200 DIM S$(N2) : S$(N1, N1) = CHR$(157) : S$(N2, N2) = CHR$(159)
299 REM READ IN THE MACHINE LANGUAGE PROGRAM
300 GOSUB 2900
399 REM GET LOW AND HIGH MEMORY BOUNDS
400 L = PEEK(15) * N256 : H = PEEK(742) * N256 : IF PEEK(14) <> NO THEN L = L + N256
499 REM DISPLAY BOUNDS AND GET REPLY
500 ? CHR$(125); S$; "ATARI MEMORY TEST PROGRAM"; CHR$(155); S$; "MEMORY BOUNDS ARE "
600 ? S$; "LOW = "; L : ? S$; "HIGH = "; H
700 ? S$; "GIVE TEST BOUNDS"; CHR$(155)
800 TRAP 800 : ? S$; "LOW = "; : INPUT LOW : IF LOW < L OR LOW > H THEN 800
900 TRAP 900 : ? S$; "HIGH = "; : INPUT HIGH : IF HIGH > H OR HIGH < L OR HIGH-LOW < N256 THEN 900
999 REM SETUP BOUNDS FOR THE MLP
1000 POKE 205, NO : POKE 206, INT(HIGH/N256)
1100 TRAP 32767 : POKE 203, NO : POKE 204, INT(LOW/N256)
1200 POKE 764, N255
1299 REM INVOKE THE MLP TO DO THE TEST
1300 POKE 559, NO : POKE 764, N255 : X = USR(1536)
1399 REM CHECK RETURN FROM MLP
1400 IF PEEK(208) = NO THEN 2200
1499 REM SHOW MEMORY ERROR ON SCREEN
1500 ? " ERROR AT "; (PEEK(203) + PEEK(204) * N256); " EXP = "; PEEK(207); " ACT = "; PEEK(209)
1600 SOUND NO, PASS, 6, 8 : FOR I = N1 TO 5 : NEXT I : SOUND NO, NO, NO, NO
1699 REM SETUP NEXT BYTE TO TEST SO WE DONT STOP WITH FIRST ERROR
1700 IF PEEK(203) = N255 THEN POKE 204, (PEEK(204) + N1) : POKE 203, NO : GOTO 1900
1800 POKE 203, (PEEK(203) + N1)
1900 POKE 764, N255 : POKE 559, 34
1999 REM CONTINUE ONLY IF KEY PRESSED
2000 IF PEEK(764) = N255 THEN 2000
2099 REM CONTINUE TESTING BAD RANGE
2100 GOTO 1300
2199 REM GOOD TEST PASS SO SAY SO
2200 PASS = PASS + N1 : ? " GOOD PASS NUMBER "; PASS : SOUND NO, PASS, 10, 8
2300 FOR I = N1 TO 5 : NEXT I : SOUND NO, NO, NO, NO
2399 REM STOP AND DISPLAY STUFF IF KEY IS PRESSED
2400 IF PEEK(764) <> N255 THEN 2600
2499 REM CONTINUE WITH NEXT PASS
2500 GOTO 1100
2600 POKE 764, N255
2699 REM WAIT HERE UNTIL A KEY IS PRESSED
2700 POKE 559, 34 : IF PEEK(764) = N255 THEN 2700
2799 REM CONTINUE WITH NEXT PASS
2800 GOTO 1100
2899 REM READ IN MACHINE LANGUAGE PROGRAM
2900 FOR L = 1536 TO 1576 : READ H : POKE L, H : NEXT L : RETURN
3000 DATA 104, 169, 0, 160, 0, 24, 145, 203, 209, 203, 208, 18, 105, 1, 208, 246, 200, 208, 242, 230, 204, 166, 204, 228, 206
3100 DATA 208, 234, 133, 208, 96, 133, 207, 177, 203, 133, 209, 169, 1, 133, 208, 96
