[comp.sys.cbm] C-ASSM Sources - Introduction

mark@unisec.usi.com (Mark Rinfret) (05/14/87)

	Ok, so now you've got C-ASSM for the C-Power environment, what do you
do with it?  Obviously, the first choice is to write assembly language
routines to augment your C-Power programs, either optimizing for size or
speed.  However, you will also find that the combination of C-Power's
editor, C-ASSM, and the linker provide an unmatched (he said objectively)
combination for assembly language development, supporting truly modular
program development and SEPARATE assembly of source modules.  I'm not
sure quite where the "breaking point" is as far as program size goes, but
I believe I've produced programs as large as 128 blocks (128*254 = approx
32k bytes) using this environment.
 
    What follows (and will follow) is a collection of routines which make
up a general purpose runtime library and a multi-function terminal emulator.
These were NOT written to be compatible with C-Power, yet the C-Power
environment was used to develop them.  These first two postings contain
all of the "general-purpose" support routines which can be used by any
application that needs them.  They provide such things as keyboard and
screen support, block moves and fills, string manipulations, etc.  They
are by no means complete.  Some of the code is good, some is not so good.
All of it works.  One of the little gems that I enjoyed creating was
"printpkt" (print packet) which packetizes a screen message along with
a set of parameters (cursor position, reverse video, beep/buzz, wait
for acknowledge, etc.), reducing many similar calls to simply
 
 ldx #<pktaddr
 ldy #>pktaddr
 jsr printpkt
 
and the overhead for the packet is only 5 bytes.  Also included is a
modified version of the Punter protocol source.
 
    In order to use this library, assemble all of the source (.a) modules.
Next, build the libraries "syslib" and "stdlib", using the appropriate
".ctl" files, redirected into the "lib" utility:
 
$ lib < syslib.ctl
 
Make sure that syslib and stdlib do not exist prior to building!  You
by now are probably wondering "What's he doing?  Those are the names
of the C-Power runtime libraries!"  Right.  However, since these routines
are for stuff not compatible with C-Power, we can take advantage of the
linker's automatic library retrieval mechanism (up-arrow) to scan these
libraries for automatic inclusion of the routines referenced by our
application.  You should note at this time that the separation of routines
has not been optimized fully here.  If you break up the sources into
even smaller clusters (individual subroutines, if you like), the number
of files you must maintain will be larger (thus increased complexity) but
library selection will be more efficient (fewer unused routines will be
linked with your application).  You will also have to redo the control
files for the libraries.
 
    In a few days, I will be releasing the source to MRterm, a multi-function
terminal emulator for the Commodore 64.  It includes Punter protocol, fast
XMODEM (CRC and checksum), user-defined parameter set (saved to disk), 
phone book, capture buffer, full-screen text editor and more.  As with the
libraries, some of it's good, some of it's not so good.  All of this
stuff is no-restrictions-at-all public domain stuff (no copyrights, even!).
If you make enhancements, please share them with everybody.  If anyone
finds the time to add 80 column support to MRterm, I would be
quite grateful for updates.  I've written an 80 column package in MAE but
just don't have the time to convert it.  Now that I have my Amiga, my
poor little 64 is sadly neglected.  However, I realize that the C64 is
still selling so there must be some "new blood" out there full of enthusiasm
for exploring this neat little machine.  I hope you enjoy this and that
it serves you well.  Have fun!
 
Mark

-- 
| Mark R. Rinfret, SofTech, Inc.		mark@unisec.usi.com |
| Guest of UniSecure Systems, Inc., Newport, RI                     |
| UUCP:  {gatech|mirror|cbosgd|uiucdcs|ihnp4}!rayssd!unisec!mark    |
| work: (401)-849-4174	home: (401)-846-7639                        |