MediaWiki:Sitenotice:
2024-03-02: The wiki ran out of disk space, so things were not working. This has been resolved by adding another 5GB of quota ;-) Thanks to Tim Lindner for reporting the issues. 2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)

Undercolor/840101/Memory Test

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Revision as of 00:22, 2 February 2009 by Cocomag (talk | contribs) (New page: {{NavTop}}<br /> UnderColor, Volume 1, Number 1, December 10, 1984 * Title: Memory Test * Author: Stephen P. Allen * Synopsis: Do you really have 64k? * Page Scans: [[Undercolor/840101/Mem...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Home Articles Companies Publications Hardware People Software Timeline ... Emulators Internet Resources
(Don't see something listed? Click "edit" and add it! Together we can build this database. When making a new info page, refer to this InfoBox Template for guidelines.)



UnderColor, Volume 1, Number 1, December 10, 1984

  • Title: Memory Test
  • Author: Stephen P. Allen
  • Synopsis: Do you really have 64k?
  • Page Scans: Link

Article

Memory prices the way they are now make it easy for a lot of people to upgrade their computer to a full 64K. It's a great feeling of satisfaction—"Aah, now I've got more power!"
"Wait a minute, how do I know I've really got 64K? Radio Shack says I've got to get a disk drive and OS·9 to use it. I don’t really know if I even have it! I wish there was some way to test."
ls that you? Run this program.
RAMCHECK will give your computer memory a proper workout. lf your memory chips extend all the way to 64K, you'll return from this program running Basic in RAM. And instead of ok, y0u’lI see co as the prompt. If your RAMs flunk the test, RAMCHECK will tell you where your memory effectively ends.
The Program
The assembly language routine will alter the contents of all memory above 16K. The first job of the Basic program is to move the 6809’s stack out of the way (leaving room for the routine). Don't change the addresses in Lines 30 and 40! lf you move them higher there’s the good chance the routine or the stack will be over-written during the test.
After the necessary space is cleared, the routine is POKEd in and called with a USR function. The value of AR, returned by the assembly language subroutine, will be zero if you have 64K, or it will be the address where memory "ceased to exist." GIVABF, at $B4F4, will treat any number given it that's larger than 32767 as negative. That's why 65536 is added if AR<0.
Switching between ROM and RAM is done by the 6883, that 40-pin mystery responsible for so much behind-the-scenes footwork. In all those 40 pins there are no data lines-the 6883 is controlled by simply writing to one of its 32 memory addresses. What’s written doesn't matter; it can’t read data, only addresses. The addresses that matter to us here are $FFDE (select ROMs) and $FFDF (select equivalent RAMs).
The byte values used to test the RAMs are $55 and SAA. In binary these correspond to 01010101 and 10101010. The values were chosen because these are the most difficult for memory to store—a one next to a zero may "influence" that zero to leak up to one, and vice-versa. I say may influence; I haven't seen it happen yet. (end)

Listings

Program Listing.  RAM Check (Basic)
10 ' RAMCHECK
20 '
30 ' TESTS FOR 64K RAMS
40 ' IF YOU HAVE THEM YOU RETURN
50 ' IN ALL RAM MODE
60 ' ELSE END OF MEMORY IS
70 ' DISPLAYED
80 '
90 CLS:PRINTSTRING$(32,42)
100 PRINT@75,"RAMCHECKER
110 CLEAR200,12200
120 AD=12202:DEFUSR0=AD
130 READ OP:IFOP=1000 THEN150
140 POKEAD,OP:AD=AD+1:GOTO130
150 PRINT"CHECKING NOW...":HR=USR0(0)
160 IFHR=0THEN190ELSEIFHR<0THENHR=HR+65536
170 PRINT"RAM TEST FAILS AT $"HEX$(HR)
180 CLEAR200, HR-1:END
190 PRINT"NOW IN RAM!":CLEAR200,&H7FFF:END
200 DATA 142,63,255,26,80,183,255
210 DATA 223,134,85,167,132,161,132
220 DATA 38,44,72,104,132,161,132
230 DATA 38,37,48,1,140,255,0
240 DATA 37,234,1&2,128,0,183,255
250 DATA 222,166,132,183,255,223,167
260 DATA 128,140,240,0,37,241,13&
270 DATA 71,198,79,253,171,238,79
280 DATA 95,126,180,244,183,255,222
290 DATA 31,16,126,180,244,1000
Program Listing. RAM Checker (Assembly Language)
00100 * RAMCHECKER
00110
00120 * Tests for 64K rams     ERROR 003C
00130 * If you have them it copies LOOP1 0008
00140 * Basic to Ram and returns.                 LOOP2 0021
00150 * Else it tells where the Ram ends. START 0000
00160
00170
00180
0000 8E 3FFF 00190 START LDX   #$3FFF *Point to start of 32K
0003 1A 50   00200       ORCC  #$50  *Interrupts off
0005 B7 FFDF 00210       STA   $FFDF *Select "A11 Ram" mode
00212
0008 86 55   00220 LOOP1 LDA   #$55 *Binary 01010101
000A A7 84   00230       STA   ,X *Store it
000C A1 84   00240       CMPA  ,X *Did we get it back?
000E 26 2C   00250       BNE   ERROR *if not, this is end of Ram
0010 48      00260       ASLA   *binary 10101010
0011 68 84   00270       ASL   ,X  *Same to Ram
0013 A1 84   00280       CMPA  ,X *Did the Ram follow?
0015 26 25   00290       BNE   ERROR *if not, end of Ram
0017 30 01   00300       LEAX  1,X *Test OK, move up one
0019 8C FF00 00310       CMPX  #$FF00 *Start of PIAs?
001C 25 EA   00320       BLO   LOOP1 *not yet-- keep going
00330
00332 * TEST SUCCESSFUL:
00340 * COPY BASIC TO RAM
00350
001E 8E 8000 00360 LDX #$8000 *Start of Basic
0021 B7 FFDE 00370 LOOP2 STA $FFDE *Se1ect Roms
0024 A6 84 00380 LDA ,X *Grab a byte from Rom
0026 B7 FFDF 00390 STA $FFDF *Se1ect Ram mode
0029 A7 80 00400 STA ,X+ *Dup1icate byte in Ram
002B 8C F000 00410 CMPX #$F000 *End of Roms?
002E 25 F1 00420 BLO LOOP2 *Not yet
00430
00440 * CHANGE "OK" TO "GO"
00450
0030 86 47 00460 LDA #'G
0032 C6 4F 00470 LDB #’O
0034 FD ABEE 00480 STD $ABEE *"OK" location
00490
00500 * GIVE A ZERO T0 BASIC:
00510 * SHOW RAM TEST OK
00520
0037 4F 00530 CLRA
0038 5F 00540 CLRB
0039 7E B4F4 00550 JMP $B4F4 *GIVABF
00560
00570 * ERROR: GIVE ERROR ADDRESS
00580 * BACK T0 BASIC
00590
003C B7 FFDE 00600 ERROR STA $FFDE *Se1ect Rom mode
003F 1F 10 00610 TFR X,D *Last Ram address to D
0041 7E B4F4 00620 JMP $B4F4 *and back to Basic's GIVABF
0000 00630 END
00000 TOTAL ERRORS