

This Week With My Coleco ADAM  9711.05

by Richard F. Drushel  (drushel@apk.net)


I.  Administrivia.
    I'm behind a week in my TWWMCA series because of a non-
maskable interrupt from 2 weekends ago.  In brief, my kids got 
wild playing in the kitchen and knocked over a plant sun-lamp 
onto the floor, shade-down, which destroyed some of the 25-year
old floor tile when it sat there undetected and hot for
several minutes...guess who had to spend 18 hours retiling the
entire floor?
    We were lucky, though, because the old tile were *asbestos*
(yes, that great flame-proof and falsely-maligned-as-more-car-
cinogenic-than-plutonium building material).  If they had been 
the modern, not-(yet)-proven-to-cause-cancer-in-some-damned
rodent vinyl or polyurethane tile, they would have ignited 
quickly and we would be now be living in a Salvation Army
shelter...
    Anyhow, the Drushel household (and its attendant Coleco ADAM
museum) is still in good shape, and the junior inhabitants have 
gotten a good scare...and they also owe me $132 when they get 
their first jobs :-)

II.  SmartWriter Reverse Engineering Progress.
    My project to reverse engineer R80 SmartWriter to assemblable
source code and make some bugfixes is stalled where it was before
the floor tile adventure.  That is, I have it patched to recog-
nize drive D (disk 2, ADAMnet device 5), and it will be able to 
recognize an EOS RAMdisk (device 26) whenever EOS gets
evolved enough to install it automatically at boot.  There are
some SmartKey menu inconsistencies between the GET FILE menus and 
the various STORE menus which I need to work out.  Basically, I 
want the STORE menus to work exactly like the GET FILE menus.  
The reason for this is that, in the GET FILE setup, I can easily 
accommodate extra drives as SmartKey choices; while I can't under
the current STORE menu arrangement.  This is just time and
tinkering.  I still plan to put up the fixed binary for anonymous 
ftp for people to play with under Marcel de Kogel's ADAMEM emulator.

III.  Assembly Source for SmartBASIC 1.x.
    While reorganizing the files on the computer that used to be
my Tandy 2800 HD laptop (a 286-12 mHz whose guts now reside in a 
stand-alone CPU box after the built-in keyboard and LCD screen 
died; see wk960930.txt in the archive for the whole story), I 
discovered a copy of the reverse-engineered source code for
my SmartBASIC 1.x interpreter, from 1991.  It is in the format
for a very junky cross-assembler (runs under MS-DOS, writes Z80 
binaries) which I found long ago at the famed (defunct) SIMTEL 
ftp archive at wsmr-simtel20.army.mil.  I couldn't quickly lay 
my hands on the cross assembler, so by bits and pieces at 
lunchtime the last couple of weeks I've been editing it so it
can assemble correctly under my current assembler, Z80ASM+ from 
SLR.  I now have it down to only 2 errors during assembly.  When 
I get it totally converted, I'm going to put the source up for 
anonymous ftp.  It's fairly well commented, but it's not
great, and not up to my current standards for documentation.

    One of the reasons that it is so ugly is that it will exactly
regenerate every single binary patch that was made to the original
SmartBASIC 1.0 binary.
I haven't done any cleanup or reorganization of the code, so it
still has the same memory map as SmartBASIC 1.0 as described in 
Ben Hinkle's "The Hackers Guide to ADAM Volume II".  Another 
reason for its ugliness is that SmartBASIC 1.x was created with-
out the benefit of an assembler program--I wrote code on
paper, assembled it by hand, wrote the decimal values of the
machine code as DATA statements, POKEd them in, and finally 
BSAVEd the entire binary.  My paper code has lots of comments, 
but at the time I abandoned work on the reverse-engineered 
electronic version, I had typed in only some of these comments.
For the rest, I still need to dig out the original paper source 
from 1990 and early 1991.
    As you might imagine, the near-disaster in my kitchen has
made me rather uncomfortable about the amount of irreplacable 
ADAM code and documentation that I'm sitting on here.  I want 
to get some of this stuff out in multiple copies (preferably 
electronic) so that it doesn't get lost forever in some accident.
And already I'm finding that I've misplaced things; to fulfill a
Xerox request, I've been looking for Volume I of my ADAM Tech-
nical Manual, and I *can't* find it!  I have Volume II with all 
the EOS-6 and OS-7PRIME source, but not Volume I with all the 
hardware descriptions, ADAMnet and EOS Users Manuals, and the
descriptions of the ADAMlink modem and SuperGame software
loaders.  This is the 2-volume set that Shaun McCallum was 
selling at ADAMcon IV, and the only other set I know of is 
Chris Braymen's...

    So, once I put this stuff up for ftp, please grab it and 
archive it away somewhere!  As far as SB1.x source is concerned, 
I doubt I will ever sell another copy, so if you have the SLR 
assembler and want to play with it, go ahead--just don't sell it.
The SB1.x manual source (a WordPerfect 5.0 file) I am holding 
onto for the time being, though (if HLM-GMK don't shoot me for
giving away something they still sell) I might consider convert-
ing it into HTML and letting Dale Wick put it up on his ADAM 
Home Page (or include it with an ADAM CD/ROM collection, if such 
a thing ever gets made).


IV.  Disassembly of the ADAM CP/M 2.2 BIOS.

    Also on the ex-laptop hard disk was a long-forgotten
disassembly I had made in August 1992 of the ADAM CP/M 2.2 BIOS.
I even remember how I made the disassembly:  I used the CP/M SAVE 
command to dump the 64K RAM contents to disk, then used the IMP 
modem program to transfer it by direct serial link to my then-
laptop.  I then ran the BIOS portion through my UNSAMHEX9.EXE
disassembler (a SmartBASIC 1.x program converted to Microsoft
QuickBASIC 4.5), and started to edit it in WordPerfect 5.0 for 
MS-DOS.  I think the ADAM CP/M manual told what memory address 
the BIOS started at, or maybe I just looked around for the BIOS 
jump table; this part I don't remember.  Anyway, the listing 
starts at the BIOS jump table.  Since UNASMHEX9.EXE was never 
intended to generate assemblable source code, the disassembly 
listing can't directly be used to reverse-engineer the ADAM 
CP/M 2.2 BIOS :-(  

    More's the pity, because I commented some parts of it very
thoroughly, specifically those relating to the AUX:, PUN:, and 
RDR: devices, which (according to the manual) were for use by 
the ADAMnet serial/parallel board (which was prototyped but 
never sold).  As I recall now, my rationale was to figure out 
from this (presumably working and tested) code how the serial/
parallel board worked, so that I could emulate it correctly (on
3rd-party serial boards) in my new EOS-8.  That I did so correct-
ly is borne out by the fact that I could run SmartBASIC 2.0 under 
EOS-8 and use a serial terminal for console I/O using IN#4 and 
PR#4 (which were vectors to the ADAMnet serial device).

    I did at that time, however, actually make a separate file of
the BIOS code used for the serial board (AUX:, supplemented by
disassembling the part of CONFIG.COM which actually sets the 
serial port baudrate, parity, etc., since the BIOS does not 
provide those functions directly).  This is a nice package, so 
I'm putting it up for anonymous ftp at:
     ftp://junior.apk.net/pub/users/drushel/dev14.lst

Seeing the final commented disassembly gives little hint how
difficult it was to actually deduce from code alone how the 
thing worked :-)
    I'm going to hold onto the disassembly listing of the entire
BIOS for a little longer, in the hopes of cleaning it up somewhat
There are still some large areas which are pretty "raw" (e.g., 
data areas which aren't resolved as data but are still present 
as "garbage" assembly code).

V.  SmartBASIC 1.x and Clock Bugs?
    Ron Mitchell has posted (to the mailing list) an interesting
account of problems he's had with the SmartBASIC 1.x clock 
drivers, namely, the weekdays being off by one for certain clock 
hardware types.  I haven't had time to investigate in detail.  
I know for *certain* that the motherboard ROM-based
no-slot clock driver works perfectly well, because that's the
clock type I have in my Mini Wini hard drive system.  From Chris 
Braymen, I inherited one of Syd Carter's Dy-No-Mite Sound 
Digitizer/Clock cartridges; but there is no clock chip installed,
so I can't immediately test it.  As for the Eve/Orphanware
clock, I never owned one.

    Historically, my SB1.x clock driver code was written and
tested using 
    (1) my own no-slot clock, obtained from Steve Major's ADAM
        Connection (I got it free for purchasing so many $$$ of 
        other stuff);
    (2) a Digitizer/Clock cartridge borrowed from Alan Neeley, 
        for the express purchase of writing the driver code; and
    (3) the original wire-wrap prototype of the Orphanware clock,
        built by Orphanware founder John Lingrel and now owned 
        by Herman Mason.

All these worthies are credited in the Acknowledgements section
of the SB1.x manual, if memory serves.  So far as I can remember,
the final driver code worked properly with all three clock types.
I will have to buy a Dallas SmartWatch from JDR for my Digitizer
/Clock and beg/borrow the Orphanware clock prototype from Herman 
Mason to definitively address Ron Mitchell's bug report.


    See you next week!


    *Rich*

*****************************************************************


Note:  TWWMCA is archived.  Back issues are available via
anonymous ftp.

        ftp://junior.apk.net/pub/users/drushel/twwmca/

Files have the form wkyymmdd.txt, where yy=year, mm=month,
dd=day.

*****************************************************************
