[Coco] Question about RAM

Little John sales at gimechip.com
Wed Oct 27 23:18:12 EDT 2010


Burke & Burke sold QuarterMeg, a 256K RAM upgrade that used the 128K from 
the CoCo 3 and added another 128K to that. The quarterMeg could be expanded 
to a full 512K though - it came out during the time the DRAM chip price went 
thru the roof....

----- Original Message ----- 
From: "William Astle" <lost at l-w.ca>
To: <coco at maltedmedia.com>
Sent: Wednesday, October 27, 2010 9:54 PM
Subject: Re: [Coco] Question about RAM


> On 10-10-27 08:29 PM, Arthur Flexser wrote:
>> I think that ghosting would cause that LPOKE/LPEEK method to fail, so 
>> that
>> you'd see the value you poked in even if the machine was 128K.
>> You'd need to Lpoke an address and then Lpeek an address that differed 
>> from
>> that by 128K;  if the second address contained what you Lpoked in, the
>> machine is 128K.  That is, ghosting =>  128K;  lack of ghosting =>  512K 
>> or
>> greater.
>
> That is correct. However, to make it bullet proof, you need to put a known 
> value in the "ghost" location before setting the real location. You can 
> actually detect 256K as well using that method. (I don't know anyone that 
> ever did 256K but it's theoretically possible.)
>
> If you're assuming only 128K or 512K, then the following would do:
>
> 1 LPOKE &H40400,0
> 2 LPOKE &H00400,1
> 3 IF LPEEK(&H40400) == 1 THEN M=128 ELSE M=512
>
> I chose 40400 and 00400 to guarantee that nothing crashes during the test 
> since that will be the 32 column text screen on a 128K machine and
> random unused memory on a 512K machine. I used 4xxxx and 0xxxx because
> that pretty much guarantees that if you run into a guy with 256K, it will 
> detect as 128K instead of 512K. The opposite would not be desirable. This 
> will also detect 512K on machines with more than 512K installed.
>
> The reason that works is that on a 128K machine, the 128K is mirrored four 
> times, at $00000-$1FFFF, $20000-$3FFFF, $40000-$5FFFF, and $60000-$7FFFF. 
> If I recall correctly, Basic uses the top mirror while OS9 uses the bottom 
> one.
>
> Note that a similar algorithm can be used in assembly language, in that 
> case twiddling the MMU registers directly, which can easily detect up to 
> 2MB.
>
> -- 
> William Astle
> lost at l-w.ca
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco 




More information about the Coco mailing list