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

Darren A. darccml at hotmail.com
Fri Jan 25 01:29:20 EST 2008


Roger,

> Are you 100% sure your code is fully compatible with all CoCo 3's and 
> Disk ROM versions?  Tested?  There's some odd DOSes out there that 
> may have their own way of implementing LOADM that doesn't call on 
> those hooks.  I see direct ROM calls in your source code which is 
> about the same worry as expecting a certain value to be in the 
> floating-but-assumed-not-random upper 2 bits of the MMU.


I have tested the code on a CoCo 2, a CoCo3 and MESS.  No assumptions are made about the version Disk Basic that is present. The only ROM calls made are to Color Basic (A000-BFFF), not to the Disk Basic ROM. Those calls are to the Error Driver (in case an 'IE' error is detected), to cleanup the stack and to return to the main interpreter loop when done. I think its safe to say that those entry points are set in stone. You could actually remove those last two calls and just have the code jump directly to your EXEC address instead, alleviating the need to have an auto-start segment at the end of your file. If you really wanted to remove all ROM calls, you could also change the IE error detection to do a warm start (JMP [$FFFE]) rather than call the error driver.

The only 'hook' used is RVEC4. This hook is not directly called by Disk Basic, but rather by Color Basic's Console In routine. LOADM calls Console In to read the file's data. In fact, Console In is used for sequential input from all standard devices (keyboard, cassette, disk, and the bit-banger port for DLOAD). I find it highly unlikely (but not impossible) that some other DOS would have re-implemented LOADM to bypass the system's core device input routine.

By the way, if there is a version of DOS whose LOADM does not call Console In, then the patch code would never be invoked. It would just operate as if the patch were not present. This means you could still design your code to assume the '01' pattern as a fall-back in case the DOS desn't play nice. The patch segments would provide the main line of defense for most, if not all, implementations.

You can view the source code in my earlier post. If you like, I can email the file to you.

Darren


_________________________________________________________________
Need to know the score, the latest news, or you need your Hotmail®-get your "fix".
http://www.msnmobilefix.com/Default.aspx


More information about the Coco mailing list