[net.micro.atari16] TRAPs from an interrupt handler and micro C Shell

braner@batcomputer.TN.CORNELL.EDU (braner) (11/03/86)

[]

Following this posting you will find a posting of source code
for a program that compresses ST pictures AND codes them into
a text file that can be sent through e-mail.  The text file's
length depends on the picture, but for simple pictures (e.g.
an image of a desktop with some icons and an open dialog box)
it is about 4000 to 8000 chars, i.e. 12 to 25% of the bitmap
size in RAM.  The combination code/compress algorithm is the
culprit for those ratios.

The program is installed in RAM, and activated later upon an
Alt-Help.  Then, instead of printing the screen, it codes it
and saves it on the disk.  (I have also written a program that
decodes and decompresses the text file, shows the picture on
the screen, and can also save it uncompressed in DEGAS format.
I am waiting for net.atari16.sources to post it, and the 2
executables.)

To do what it does, the program calls various OS routines (via TRAPs).
But, the program is called from the keyboard interrupt handler,
and it is officially verboten to do OS calls from there!!
I did it anyway, because I didn't know what else to do.  And
it seems to work - from the desktop.  But when called from
inside micro-C-Shell, the system hangs.  Removing all the TRAPs
makes the program docile (but also futile...).

Can some expert out there tell us what to do about it, and/or how
to write files without TRAPs?

- Moshe Braner