[Coco] BASIC-09 signals (sorry!)
aawolfe at gmail.com
Sat Jan 30 03:00:28 EST 2010
Thanks for the link, lots of interesting articles there!
The signal handler presented in Joel's article is almost identical to the
one Wayne and I created a few days ago. It also has the same problem, it
misses signals if they are sent too quickly.
We came up with a nice way to mostly solve this issue. Rather than have the
signal handler set a single variable with the signal's value, we use the
signal value as an offset into a Basic09 data structure. A byte array works
well. So instead of STB ,u we do STB b,u.
This sets value x in array(x) where x is the signal's value. It allows you
to catch multiple signals of different values (in our case, a port closing
(HUP) signal and/or PD.INT or PD.QUT signal), but still misses multiple
occurrences of the same signal.
To deal with multiple identical signals, I think the handler could be
further improved to increment the element of the array corresponding to the
signal's value, so something like INC B,U. The Basic09 code that is looking
at the array for signals can decrement the corresponding element each time
is processes a particular signal's occurrence, and so catch each and every
signal sent to the process. I think this technique would be reliable, but
have not done any testing yet.
On Sat, Jan 30, 2010 at 2:08 AM, Bob Devries <devries.bob at gmail.com> wrote:
> Joel's website has them:
> Besides a mathematical inclination, an exceptionally good mastery of one's
> native tongue is the most vital asset of a competent programmer.
> Edsger W.Dijkstra, 18 June 1975
> ----- Original Message ----- From: "Willard Goosey" <goosey at virgo.sdc.org>
> To: "CoCoList for Color Computer Enthusiasts" <coco at maltedmedia.com>
> Sent: Saturday, January 30, 2010 5:34 PM
> Subject: [Coco] BASIC-09 signals (sorry!)
> Sorry to drag this up again, but I KNEW I'd seen BASIC-09 code with a
>> signal handler somewhere. I just had to find it.
>> "OS-9/OSK Answers! by Joe Mathew Hegberg", September 1993 Issue.
>> This guy is good! His articles are very well done.
>> Should be on the net somewhere (that's where I got it), I'm not sure
>> if I have it in electronic form or not...
>> Willard Goosey goosey at sdc.org
>> Socorro, New Mexico, USA
>> I search my heart and find Cimmeria, land of Darkness and the Night.
>> -- R.E. Howard
>> Coco mailing list
>> Coco at maltedmedia.com
> Coco mailing list
> Coco at maltedmedia.com
More information about the Coco