|
Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment. |
|
Thread Tools |
8th Oct 2015, 10:41 pm | #1 |
Octode
Join Date: Jan 2005
Location: Hyde, Greater Manchester, UK.
Posts: 1,074
|
ZX81 memory test program.
Hi all, I've been playing with a sinclair zx81 computer and have been experimenting with replacing the two 2114 4bit ram ic's with a HM6264 8bit x8k SRAM I built a little daughter board so as to minimize modifications to the ZX81 only having to pick up A11 and A12 from the board. the computer works fine but now i need help, I should have 8k but am not sure the best way to test, all the software i have ether runs in 1k or 16k. does anyone know a bit of basic i can run that will show the amount of ram found on screen? Ill freely admit the electronics is the fun bit for me and my basic programming skills are very limited.
Jay
__________________
The light at the end of the tunnel is probably the headlight of an oncoming train |
8th Oct 2015, 11:27 pm | #2 |
Nonode
Join Date: Oct 2014
Location: West Midlands, UK.
Posts: 2,181
|
Re: ZX81 memory test program.
From memory ,there was an inbuilt test program on Sinclairs. but what models and ow to access it, I can't remember .I remember it on the +2 as pressing a set of keys simultaneously
|
9th Oct 2015, 12:34 am | #3 |
Dekatron
Join Date: May 2006
Location: Invercargill, New Zealand
Posts: 3,458
|
Re: ZX81 memory test program.
Did a quick google and found this page - it's for the Timex US version, but should be the same. You should be able to PEEK 16388 to get RAMTOP, which is given as:
18431 For 2k internal ram 32767 for 16k Ram Pack 49511 for 32k Ram Pack 65535 for 64k Ram Pack Based on that, I'd expect to see 17407 for the internal 1k, and 24575 if your 8k upgrade is recognised. |
9th Oct 2015, 12:46 am | #4 |
Nonode
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,681
|
Re: ZX81 memory test program.
Somewhere deep in my memory was the word RAMTOP, which I think is the highest address available in RAM on the ZX81, possibly with the exception of the screen memory. A quick web search revealed this:
PRINT PEEK 16388+256*PEEK 16389 as a way to find out what it is. However, it may be that the ROM isn't clever enough to figure out the value of RAMTOP for itself as anything other than 1K or 16K, so to use your 8K you may have to manually set it: POKE 16389, 96 The first 16K of the ZX81 memory map is the 8K ROM, then a repeat of the 8K ROM. RAM starts at 16K, so location 16389 (the high byte of RAMTOP) will contain 68 for a 1K machine. It will be interesting to see what RAMTOP is on your 8K machine. Chris
__________________
What's going on in the workshop? http://martin-jones.com/ |
9th Oct 2015, 12:56 am | #5 |
Nonode
Join Date: Oct 2008
Location: Warsaw, Poland and Cambridge, UK
Posts: 2,681
|
Re: ZX81 memory test program.
I've just written this little program which seems to work:
10 FOR N=16640 TO 65536 STEP 256 20 POKE N,0 30 IF PEEK N<>0 THEN GOTO 50 40 NEXT N 50 PRINT "MEMORY SIZE ";(N/1024)-16;"K" Try it out! Chris
__________________
What's going on in the workshop? http://martin-jones.com/ |
9th Oct 2015, 5:46 am | #6 |
Dekatron
Join Date: May 2006
Location: Invercargill, New Zealand
Posts: 3,458
|
Re: ZX81 memory test program.
|
9th Oct 2015, 9:33 pm | #7 |
Octode
Join Date: Jan 2005
Location: Hyde, Greater Manchester, UK.
Posts: 1,074
|
Re: ZX81 memory test program.
Thanks Chris that was just what I was after. unfortunately I've had a bit of a setback, the HM6264 8bit x8k SRAM ic I have been using seems to have died (it was one from my stocks and I'm unsure of its origins) I've tried the zx81 with its original 2114s back in and it works fine. need to find another SRAM to try.
Jay
__________________
The light at the end of the tunnel is probably the headlight of an oncoming train |
10th Oct 2015, 2:51 am | #8 |
Dekatron
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
|
Re: ZX81 memory test program.
I'm sure I've had situations with an overheating 16K RAM pack sometimes not showing up as the full 16K when peeking RAMTOP -- I think the machine does a primitive memory test on reset, writing 00 to locations in turn and trying to read back until it returns FF, indicating that the inputs are floating high in the absence of anything connected to them. And obviously the warm chips returned something wrong and stopped the test short.
As a quick and dirty test, you can use the DIM statement in BASIC to create an array. The ZX81 will try to reserve space for it and if there is not enough memory, it will crash with error 4 (out of memory). To test for 8K, try Code:
DIM A(1400) If you then try Code:
NEW DIM A(3000) A pair of 6264s and a single transistor to invert A13 (so as select one of the two chips when A13 is low and the other when A13 is high) would give you the full 16K, of course.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments. |
10th Oct 2015, 9:11 am | #9 |
Nonode
Join Date: Aug 2010
Location: Resolven, Wales; and Bristol, England
Posts: 2,614
|
Re: ZX81 memory test program.
ISTR that Clive used to buy 'regrade' RAM chips and use whichever half worked. Lots of problems with memory in those early Sinclair machines. There must be an on-board test to see what RAM is available.
__________________
Richard Index: recursive loop: see recursive loop |
10th Oct 2015, 1:16 pm | #10 |
Dekatron
Join Date: May 2008
Location: Derby, UK.
Posts: 7,735
|
Re: ZX81 memory test program.
That was for the upper 32K on the Spectrum. Refreshed by the Z80 (which is only supposed to be able to refresh 16KB of DRAM) -- the lower 16K is refreshed by the video ULA (part of the reason for the weirdy byte ordering; the address lines are deliberately used out-of-order so the mere act of reading the display buffer is enough to keep the whole 16K refreshed.
The ZX81 used static RAM internally; RAM expansions were generally built with DRAM, with their own internal refresh logic. (The Z80 helpfully lets you know when it is doing a register-to-register operation and so not needing to address memory, so you can interleave accesses.
__________________
If I have seen further than others, it is because I was standing on a pile of failed experiments. |
14th Oct 2015, 8:50 am | #11 |
Nonode
Join Date: Aug 2010
Location: Resolven, Wales; and Bristol, England
Posts: 2,614
|
Re: ZX81 memory test program.
Ah, thanks Julie. I wasn't overly familiar with the Sinclair computers after the Mk14 - I went on to a NASCOM. It's a long time since I did any work in Z80 machine code, and we were writing computer games using mostly EPROM and only a little bit of RAM.
__________________
Richard Index: recursive loop: see recursive loop |