Date : Mon, 27 Mar 2006 12:10:12 +0100
From : Fragula <fragula@...>
Subject: Re: Z-modem sourcecode
Hi!
>>> Does anyone have Basic or Assembler source for Z-modem file transfer
>>> routines?
There were/are some bones that needed chewing.. Obviously the (Chuck
Forseberg?) sources wouldn't fit on a beeb, for several reasons.
One: the CRC-32 routines took too long.. This was fixed by doing
essentially the same thing, but a different way, in assembler. The beeb
can do CRC-32s faster than the serial port can go, no bother.
heh! thought I was mustard until a Certain Individual Who Reads This
List (go on, own up!) effortlessly pointed out my redundant byte.
Two: RAM requirements are fairly hefty. It would be barely doable (a
terminal with Zmodem) on a tape based model B in mode 7, but no space
for much else, so not very pretty. Certainly not mode 3.
My solution to this is to put the X/Y/Zmodem routines in a either a
sideways RAM bank, or, for the more permanently minded, a "protocol
module" (a 2764 that's stacked with a 6264 and a 7404(iirc) on the most
significant address line to handle the device selection. Obviously this
needs a flying wire for the 6264's /WE signal.
This system has limited window (packet) sizes, and limited window "in
flight" overlap, but should work ok.
The plan, itself part of a greater one, was to make this a "service ROM"
image which could be freely used by third party comms softwares using
either *commands or calls to OSWORD, with a view to enabling BBS
software, Terminal programs, FTN (Fidonet) mailers/offline readers etc.
to be reasonably implemented.
Back then of course, there was also the problem of disk space, as not
many people had winchesters, compatible arc/zip/lzh/tar/arj/zoo etc. So
there was a limit to its compatibility, in a time already dominated by
DOS PCs.
The skeleton code for the ROM (and others) is done. Its just a skeleton
"demo" though.
A schematic for the ROM/RAM assembly with simple build instructions is
drawn. Its probably not that neccessary now. Everyone has plenty of
sideways RAM, right?
A justification for my blatant disregard for being anal about timings is
written. (on the "if it works, don't knock it" lines).
A disclaimer "and if it doesn't, you get to keep the smoking pieces" is
done, or stolen from someone else, too. I had a fair few netmails back
then from other (more anal) fidonutters discouraging my encouraging
people from using screwdrivers and soldering irons.
The CRC-32 (and IIRC CRC-16 too) code is done. (and again, IIRC, the
code is mostly shared between both systems)
Alternative interrupt-driven and polling 6850 routines are done
someplace too. Coincidentally, I wrote these when rewiring the 6850 to
run at 2MHz (stolen from the cassette ULA socket) with a opto-isolator
input/collector output to do MIDI. But they might come in handy. They
used to handle (chunked into 16K parts due to memory restrictions)
sample dumps from/to an Ensoniq Mirage at 31250 Baud, though I suspect
this might not work on all machines. It might be possible to do 19k2
more efficiently though.
The fledgeling zmodem implementation method got scrapped, as it was too
long winded and spider-like, too "linear". I was going to re-write it
using a "Finite State Machine" notion. That never happened.
When i've finally resurrected my BBC systems (getting there, impromptu
firework displays and house evacuations are just healthy signs of
progress, right? :-) and figured out which are the
latest/lastest/bestest versions and filling up the various bits of
source code with comments and releasing them for general hacking and
turning into something usefull.
[Excerpt for entertainment only follows: Comments are new]
Comtext EQUW &FF17 ; WTF is all this??? Cursor mod?
EQUD &66995A3C ; Gahh.. I hate senile moments.
EQUD &C33CC3BD ; "I Must Use Comments"
EQUW &20FF ; "I Must Use Comments"
EQUS "Ninja Computer" ; Woohoo! Where's the map?
EQUB 0 ; a string terminator?
Lie LDA #&00 ; display a notional amount of RAM. Didn't this
used to be
LDX #Lies MOD 256 ; counted properly?
LDY #Lies DIV 256
JSR SD
RTS
Lies EQUS " 320K" ; Uh-Oh.. Where is the SRAM counting code?
Must be a later vers.
EQUW &007 ; *Secret* code?
[End Excerpt]
Cheers!
M.