[Coco] "Reading" non-readable bytes with PEEK vs ZBUG

Robert Gault robert.gault at worldnet.att.net
Thu Jan 24 19:13:24 EST 2008


Roger Taylor wrote:
> At 10:11 PM 1/23/2008, you wrote:
> 
>> Darren A. wrote:
>>
>>>> Does it make any difference in these tests if the CPU is in 
>>>> double-speed mode?
>>>
>>>
>>> -- 
>>> No Roger. I have tested it on a 128K CoCo3 68B09 at both speeds. 
>>> There is no difference in behavior. I believe Robert G. has confirmed 
>>> that the same results are seen on a 6309 in emulation mode (don't 
>>> know about native mode).
>>> One thing to consider about your LOADM trick is that the behavior is 
>>> dependant on the sequence of instructions executed. Chances are 
>>> fairly good that all third-party versions of Disk Basic have simply 
>>> copied the LOADM code used in Tandy's version, but that's just a 
>>> guess. As someone stated in a previous post, creating a process that 
>>> relies on some undefined behavior makes the entire process undefined.
>>> Darren
>>
>>
>> The one thing clear from this discussion is not whether the CPU or 
>> GIME are misbehaving or if clock speed is important. What is clear is 
>> we should not try to read non-readable bits! Any attempt to get info 
>> from the MMU registers should mask off non-active bits. It is silly to 
>> insist that it is safe to take the entire byte as meaningful.
> 
> 
> 
> I agree it's normally silly, except for a much needed LOADM approach to 
> loading stuff into the extended RAM.  Since LOADM always sees 01xxxxxx 
> for 128k/512k CoCo 3's until someone reports otherwise, the bits are 
> readable and useable and assumed '01'.  I can't think of any other 
> reason someone would want to use the bits.  However, there's no danger 
> if the programmer knows what they're doing and has fully tested what 
> they're doing.  This is how Sock has given so many impossible demos, by 
> doing things to the GIME and video registers that some people would say 
> is "not legal".
> 
> 

Roger, regardless of whether a Coco3 has 128K, 512K, or more memory, 
when you send $38-$3F to a GIME MMU register you get the same result. If 
you have only 128 or 512K memory, it does not matter what values you 
give to the two most significant bits because it won't change anything 
regardless what you send to these bits on a Store! Those bits are only 
important with more than 512K RAM when you write to them. They are 
meaningless on a Read regardless of memory present.

That means it does not matter in your program what you are doing during 
a LOADM as long as you don't store a value less than $38 or higher than 
$3F in an MMU register. Depending on the code in your program, it may 
not matter whether you only use MMU values of $00-$0F because the net 
result will can still be the same as long as you don't need the full 
address of the bytes those MMUs control.

If you would post the code you are using during the LOADM (or send it by 
private e-mail) I could show why the results of the survey don't matter. 
In terms of LOADM, the survey of what can or can't be read from an MMU 
register has been pointless except for the interesting results caused by 
"floating" bits in a Coco3 system. By the way, you get the same 
"incorrect" values with a Paul Barton 8Meg RAM board installed. Just 
tested that.



More information about the Coco mailing list