100 NumberOfInstructions=128 110 UnExpSpeed=.538346 120 MaxNumOfInstr=5460 130 MODE 4: CLS 140 PRINT '******************** RAM SPEED TEST version 2.6 **********************' 150 REMark Kees van der Wal, Delft -- 1988.01.02 160 MemoryArea=6*NumberOfInstructions+36 170 IF NumberOfInstructions>MaxNumOfInstr THEN 180 PRINT\'Number of instructions too high. Reduced to'&MaxNumOfInstr 190 NumberOfInstructions=MaxNumOfInstr 200 END IF 210 PRINT \'Reserving '&MemoryArea&' bytes of RESPR area for '&NumberOfInstructions&' instructions.' 220 CodeStart=RESPR(MemoryArea): REMark CodeStart=131072 230 PRINT 'Startaddress = ';CodeStart: REMark HEX$(CodeStart,20) 240 : 250 PRINT 'Filling area with instructions ... '; 260 POKE_W CodeStart,20032: REMark TRAP #0 270 POKE_W CodeStart+2,124: POKE_W CodeStart+4,1792: REMark ORI.w #$0700,SR 280 POKE_W CodeStart+6,29439: REMark MOVEQ -1,D1 290 POKE_W CodeStart+8,17401: POKE_L CodeStart+10,131072: REMark LEA.l $20000,A1 300 POKE_W CodeStart+14,16889: POKE_L CodeStart+16,98304: REMark LEA.l $18000,A0 310 POKE_W CodeStart+20,4225: REMark MOVE.b D1,(A0) --> clear clock 320 : 330 REMark instruction MOVE.L $xxxxx,D0 340 FOR i=0 TO NumberOfInstructions-1 350 POKE_W CodeStart+22+6*i,8249 360 END FOR i 370 : 380 REMark Fill xxxxx with address CodeStart 390 FOR i=0 TO NumberOfInstructions-1 400 POKE_L CodeStart+24+6*i,CodeStart 410 END FOR i 420 : 430 POKE_W (CodeStart+22+6*NumberOfInstructions),20937: POKE_W (CodeStart+24+6*NumberOfInstructions),(-2-(NumberOfInstructions*6)): REMark DBRA D1,herhaal 440 POKE_W CodeStart+26+6*NumberOfInstructions,8848: REMark MOVE.l (A0),(A1) 450 POKE_W CodeStart+28+6*NumberOfInstructions,636: POKE_W CodeStart+30+6*NumberOfInstructions,-12033: REMark ANDI.w #$D0FF,SR 460 POKE_W CodeStart+32+6*NumberOfInstructions,28672: REMark MOVEQ #$0,D0 470 POKE_W CodeStart+34+6*NumberOfInstructions,20085: REMark RTS 480 : 490 PRINT 'ready.'\\ 500 MemoryAccesses=65536*(NumberOfInstructions*10+4) 510 ProcessorCycles=65536*(NumberOfInstructions*40+18) 520 MinDuration=ProcessorCycles/7.5E6 530 MaxDuration=MinDuration/UnExpSpeed 540 PRINT 'The test takes between '&Round(MinDuration,0)&' and '&Round(MaxDuration,0)&' seconds.' 550 PRINT 'Press any key when ready ... '; 560 BEEP 1000,32 570 Dummy$=INKEY$(-1) 580 PRINT 'running test now ... '; 590 CALL CodeStart: TestDuration=PEEK_L(131072)+.5 600 PRINT 'ready.' 610 BEEP 10000,32 620 AverageMemAc=1E6*TestDuration/MemoryAccesses 630 PRINT\'The test took '&TestDuration&' seconds for '&Round((MemoryAccesses/1E6),3)&' million memory accesses.'\ 640 PRINT\'The average time for a memory acces was ';Round(AverageMemAc,4);' microseconds;' 650 PRINT 'what equivalents to ';Round(7.5*AverageMemAc,2);' clockcycles at 7.5 MHz.' 660 PRINT\'The minimum is 4 clockcycles,' 670 PRINT 'so the average number of waitstates was '; Round(7.5*AverageMemAc-4,2);'.' 680 SpeedFactor=(4/7.5)/AverageMemAc 690 PRINT\'The speedfactor is ';Round(SpeedFactor,3) 700 PRINT 'A speedfaktor of 1 is the fastest possible.' 710 PRINT 'An unexpanded QL has a speedfactor of about '&Round(UnExpSpeed,3)&'.' 720 PRINT\'This is '&Rating$(SpeedFactor)&' speed memory; '; 730 PRINT'about '&Round((SpeedFactor/UnExpSpeed),3)&' times standard speed.' 740 : 750 DEFine FuNction Rating$(Factor) 760 LOCal RFactor 770 RFactor=100*Factor 780 SELect ON RFactor 790 =85 TO 105: RETurn 'high' 800 =63 TO 85: RETurn 'medium' 810 =49 TO 63: RETurn 'low' 820 =0 TO 49: RETurn 'very low' 830 =REMAINDER : RETurn 'impossible' 840 END SELect 850 END DEFine Rating$ 860 : 870 DEFine FuNction Round(Number,Places) 880 RETurn INT((Number*10^Places)+.5)/10^Places 890 END DEFine Round 900 : 910 STOP 920 REMark >>>>>>>>>>>>> end of listing <<<<<<<<<<<<<<<<<<<<<<