TRS-80 software I wrote
Library of C
CMD File Utils
Your donation gives me time
to develop more cool free stuff
Nick Andrew - TRS-80 - Zeta BBS
TRS-80 - Zeta BBS
My Zeta BBS evolved through many iterations. I started writing code
(in BASIC!) in December 1984. After a while I rewrote everything in
Assembler (and even later, in C). The official birthdate of Zeta BBS
was 1st February, 1985.
Zeta started from the most humble beginnings. I had bought a 300 bps
modem around September 1984, so I could dial into BBSs and the
University modems just like my friend Mark McDougall, who was in
the same course and year as me. But the modem wasn't the beginning -
Zeta's germination started with something even smaller - a single
The LED was attached to a circuit called "visual ring detect". The
circuit came from one of the hobbyist magazines. The idea was to
connect the circuit to a telephone line and the LED would flash
when the telephone rang. Of course this was illegal because the
device was not TELECOM-approved, so the magazine published the
circuit but labelled it for private telephone use only.
Anyway my reasoning was as follows: If a telephone ring signal
(a nasty jumble of 50 volt AC pulses) could be reduced to light
in a single LED, then the LED could be replaced by an opto-coupler
(which is basically a LED and a photo-detector inside a chip)
and the detector could be coupled to the computer, which would be
able to tell when the phone was ringing. Knowing when the phone
was ringing, the computer could then flip a relay which would
connect the (approved) modem to the telephone circuit. The modem
being in ANSWER mode would start to talk to the other party's
modem and there would be a connected data circuit!
This was in the days before auto-answer modems existed, before
Hayes brought out the famous AT command set (the source of so
much modem trouble over the years). At least I did not
have access to any fancy gear, I only had a very crappy
Dick Smith Dataphone modem and a ring-detect circuit...
So I wired up the computer as described above. I managed to blow
up a few opto-couplers and also the computer's cassette relay
as I've always been hopeless at analogue electronics, but eventually
I got something which sorta worked.
I setup the gear on my parents' telephone, which was also a
business line, between the hours of 11pm and 7am daily. Many
people called outside those times and my mother got quite used
to hearing the persistent whine of a 300 baud modem at the other
end. Zeta BBS was born!
And to cut a long story short, Zeta was a free service for a
while as I experimented and wrote more software for it. I
hooked it up to Fidonet, joining the first group of Fidonet
users in Australia (net was run by a chap called Brian Gatenby)
and I wrote a gateway between Fidonet and ACSNet which ran
between my computer and a minicomputer at NSWIT and Larry Lewis'
Prophet BBS. It was called ACSGate.
Here are a bunch of packages which contain a fairly complete
picture of the source code for the Zeta BBS. Nothing has been
Zeta BBS - Catalogs
This package contains some programs to maintain the online files catalog.
The BBS was floppy based (3 x 80 track double sided, double density) and
so sometimes files were "available" but not "online".
- This program "builds and maintains file catalogues".
- This C program "merges CATALOG/NEW and FILELIST/ZMS
into CATALOG/UPD with unknowns filed in CATALOG/UNK".
- This C program rearranges the CATALOG/ZMS format to put
the filenames at the start of each line.
- This program determines if a particular volume (diskette)
Zeta BBS - Communications
I tried to gather low level communications routines and some
protocols into this package.
- Protocol handler for ACSnet news and email. I don't know what
protocol this program was implementing, but from the code it looks
- This program took care of the initial modem handshake and
invocation of Fidonet protocol call reception too. No
messing with Ring Indicate here, this program was used when I
got an auto-answer modem.
- This resident program monitored the carrier signal at all
- This resident program sets up and implements all the special
- This program dials out and initiates Fidonet protocol transfers.
- This program performs the Fidotalk connection protocol.
- This program sends a mail "packet" (and file attaches).
There's also "ftalk2" which combines the functions of ftalk
- This program receives a Fidonet "packet".
Zeta BBS - File Transfer
This package contains some file transfer programs which I used
within and maybe outside the Zeta BBS environment.
- This is a non-protocol upload program (ASCII data capture).
- This program provides a menu for file transfers.
- There are various incarnations of Xmodem transfer programs
in this directory.
Zeta BBS - Games
At one time I had the original Adventure running on Zeta. I believe that
it required a reboot to get back to the BBS though. Later I got Zork
running ... by disassembling the infocom executor, massaging it into
a source code format, and then reassembling the source code to live
within the Zeta BBS environment.
This package contains my work on the Zork 1 executor. It's modified
Infocom code, but I don't think Infocom are around to care any more.
Anyway, there are free Infocom executors around, so it's not as if
you need this code. I'm just showing it here for research
purposes, as the work that I did on it. Please note that the Zork 1
datafile is not included in this package.
- Massaged Z-machine executor including Zeta BBS patch to make the
lamp flicker and go out after 30 moves (only cripples non-members).
Zeta BBS - High Memory
This package contains some files which manipulate my 256 Kbyte RAM
modification and/or stay resident in high memory.
- This program hooks into DOS errors (how?) and logs certain errors
(such as permission denied) to the LOG_MSG device.
- This program logs all output from LOG_MSG to disk.
- This program uses my Real Time Clock circuit.
- This program sets up the Zeta BBS environment (event hooks
and global variables in high memory area, for example).
Zeta BBS - Include
This package contains the standard assembly include files which
were required to compile almost anything for the Zeta BBS
- Treeboard message-base file I/O functions.
- A file open function which checks privileges first.
- Check if we are running as the sysop.
- Our identity within Fidonet (and peer identities).
- Message output function.
- Function to return the current user name.
- Variant of the Small C Standard I/O library for Zeta environment.
- A sophisticated line input routine.
- Pagination and word wrap routine.
- Format of the MSGHDR.ZMS file.
- Format of the MSGTOP.ZMS file.
- A template for assembling a C program for execution in the Zeta environment.
- A bunch of common routines.
- Definitions for my RS-232 interface.
- Format of the STATS.ZMS file (keeps caller counts, etc).
- Routines for standard device usage.
- Provides the system(cmd) call for Small C programs.
- Some routines for time handling.
- Format of one USERFILE entry.
- uopen(), uclose() and others. Possibly was not used.
Zeta BBS - Internal
This package contains some "internal" programs - things which the
system ran without the user's knowledge.
- Like the Unix utility, "cron" executes commands at certain times
and at certain intervals. Unlike Unix, it didn't run as a daemon and
so it updated its control file with "next execute" datestamps.
I have provided a sample crontab.
- This program runs each time a user logs out.
- This program accepts a user's name and password and starts
- This program executes some commands for the user who has
just logged in.
- This program prepares the computer for use as a remote system.
- This program uses my 256 Kbyte memory subsystem to allow multiple
programs to be resident in memory concurrently (although not to
execute concurrently). A program can call another program, and the
older program will be transparently "swapped" into inaccessible
physical memory, while fresh memory pages will become available
for the newer program. When the newer program exited, its pages
would be freed and the pages belonging to the older program would
be replaced at their physical locations, and the older program
would resume executing from where it left off. It was quite a
Zeta BBS - Mail System
This package contains everything related to the Zeta BBS
private message system (including email).
- This directory contains the source to the end-user mail
- This directory contains a C language reimplementation of
the Zeta Mail system. I don't know if the program is complete.
- This program deletes mail messages older than a certain date.
Zeta BBS - Maintenance
- Add a new user to the user file or give a person member status.
- Alter a person's credit. In the latter years of the lifetime
of the Zeta BBS I ran it as an optional-payment system. $1 per month.
- Delete a user or lock out the user.
- Delete unwanted lines from the system logfile.
- Truncate from the front of the (to be?) printed log.
- Print the log file, but only complete pages.
- List the contents of the user file.
- Delete inactive non-members.
Zeta BBS - Networking
This package contains a bunch of programs which contributed to
the Zeta BBS exchanging messages with the Fidonet and ACSNet
- Process all incoming files from other network nodes, including
email, message bundles, Fidonews, USENET News files and Nodediffs.
Name is a pun on "arcmail".
- "Copies an ACSnet file into NEWSTXT".
- This directory contains a compendium of programs which I have
previously released as "fidonet-packet-handlers".
There are programs here to scan the message bases for messages
which need to be sent elsewhere, which reformat them into transport
files of various formats, and do the reverse actions, unpacking
files which we have received from other nodes and inserting
the messages into the MAIL or BB message bases. And much more!
- Split a big packet into smaller packets.
"packet" was the Fidonet terminology for a collection of messages
wrapped up in a binary file of the appropriate format. Not an IP
- Check out what's inside a packet.
- "A filter for echoarc messages". I'm afraid I don't know
what that means now.
Zeta BBS - Treeboard
The Treeboard was the jewel in the crown of Zeta BBS. It was a public
message board, as all BBSs needed, but with a difference. It used a
tree hierarchy of topics and users could create their own topics. Like
the "room" idea of the Citadel BBS, which came well before Zeta, but
a little more nerdy as a person who didn't like, say, sports, could
skip sports at the top level and that would avoid all sporting-type
The topics were organised as a tree. In the first incarnation I
used a single 8-bit byte for each topic code, organised bitwise
as AAABBBCC, where AAA represents the major category of the
tree: 00100000 was a top-level category, 00100100 was a second-level
category under that, and 00100101 was a third-level category.
You can see that the system is limited to 7 top-level categories,
7 x 7 mid-level categories, and 7 x 7 x 3 third-level categories,
for a grand total of 203 if the tree was filled evenly.
In the second incarnation I realised that keeping the hierarchy
information in the topic code byte itself was inefficient and so
I made that a simple integer (extending the range of the system
to 255 total categories) and made some other arrangement to
store the category structure.
Treeboard, or BB as it was called on the system, also had quite an
advanced user input routine. One could use line commands (pressing
enter after each line) or one could press the key while the menu
was being output, and cancel the menu and jump straight to the
requested function. One could also string commands together
in line-input mode, by separating them with semicolons.
- This directory contains the treeboard source code and HELP file.
- This is an 8086 port of the treeboard which I wrote for the
NSW Disadvantaged Schools Project BBS. It was a straight port,
in other words I read the original code and rewrote that in 8086
line by line, and I added some glue functions to tie it to
the operating system (which was MP/M-86). The program worked
- This program archives the oldest messages on the tree. Due to
the Zeta BBS having only floppy disks the message base was limited
to some maximum size. I think architecturally it was limited to
512 Kbytes, and so it was necessary to regularly free up some
space. I think maybe I implemented a circular buffer after a while
so that new messages would simply wipe out the oldest ones.
- This program "squashes" treeboard messages. Obviously this
came before the circular buffer mentioned above.
- This program "compresses message system in-place". Not sure
if it relates to the mail or bb system or both.
- This program converts message files from the old to the
new format. This might represent the transition point to the
Zeta BBS - Utilities
This package contains commands which end-users were expected to use.
As a budding Unix-phile I was keen on seeing things happen through
the command line (or the shell I started to write) and so I resisted
providing a menu-driven system for a long, long time. Even when I
put my SunOS box online, users were mostly in the bash shell.
- Ask a yes/no question.
- Request logout from the system.
- Concatenate files, like Unix.
- Every BBS needs one ... a little program to chat to the Sysop
(who naturally spends much time hovering around his BBS to just
make sure that it is still running and keep an eye on what's going
on in case some Skr!pt |<idd13 is trying to 0wn his box).
- Lists all .CMD files on drive zero.
- Leave a user comment for the Sysop to read. Strangely enough
most Sysops craved attention from their users and so there was
the interactive chat, special "message to sysop" options and
of course the obligatory "leave a comment" at the end of the
- Copy files (I think usage of this command was limited to
- It prints a random wise saying. This program was written
by Ross McKay, and I don't think he will mind it appearing here.
Ross is also
the author of the "Portable GUI Development Kits FAQ" which is
archived on www.faqs.org.
- Print current date and time.
- Print a diskette directory.
- Print directory of all disk drives.
- My "DIRECT" utility, which appears and is well documented
in another of my TRS-80 packages (maybe trs80-file-utils).
- Echoes its command line input.
- A simple editor. I think even end-users were allowed to use
this. This looks like it is adapted from the TRS-80 Lisp
- Find out how much free disk space there is.
- Search for a string of characters in a text file.
- Displays documentation for commands and other topics, and
provides a simple pagination and manner of navigation.
- Shows the current user number and user name.
- Deletes a file. End-users were only allowed to modify
one file which was called TEMPFILE. So the kill command
would permit end-users to delete TEMPFILE.
- Output the contents of a text file.
- Logout from the system.
- Print timestamp and a message on the printer. This program
was used very early on - last modified 1986-07-06 - and was
probably replaced by LOG/ZMS which accumulated all log output
and sometime later a utility would print a page of that file
at a time. I probably got sick of hearing my line printer
chirp at random intervals during every night, so I arranged
to save paper and get it all done quickly by buffering the
log output and flushing the buffer when I felt like it.
- Output a directory listing.
- Message entry for the Treeboard.
- Provide a menu for people who found all those commands were
- Output the contents of a text file, with pagination.
- Send and receive short notes.
- The Unix "pack" command, reimplemented in assembler.
- Let a user change their password.
- A Small C program to act as a newsreader. It is probably
- Remove files, analogous to "kill".
- Clear bit 7 from file contents and convert text files from
CP/M (now DOS) to TRS-80 format.
- A user shell which is re-entrant and can execute simple
- A file sorter. This one looks like it uses the bubble
sort algorithm too (sigh).
- A quite impressive version of stty. Many options, but
some probably did nothing. The user can change their terminal
width and length, at least!
- Ask some questions of the user (there's that Sysop craving
- List members and non-members.
- Analogous to "cwiz", again a program by Ross McKay.