Date : Sun, 28 Dec 2008 16:43:28 +0000
From : adsb@... (Andrew Benham)
Subject: Using stack page for temp vars
John Kortink wrote:
> What kind of approach to programming is this anyway,
> trying to make some assumption stick when you know
> you don't have to make any if you put in a little
> more effort ? Pretty much a waste of time, if you
> ask me.
Seconded. If you're going to program making assumptions,
then you need to verify that those assumptions are correct
at run-time. If the assumptions aren't correct, then you
can't continue.
So you could:
1/. Check that the tube isn't active
2/. Do an Osbyte 252 to get the current language ROM number,
and an Osbyte 187 to get the BASIC ROM number.
3/. See if these ROM numbers are the same: iff they are, then
you know that &70-&8F are available for the user.
4/. But the user may already be using some of these locations,
so you'd have to push them on to the stack
5/. And hope that the user isn't using any of the locations for
an event vector or similar
6/. And hope nobody else is doing the same as you
....
By the time you've done a vigorous run-time check, you might as
well have coded it properly in the first place.
I'm not on the moral high ground here. I discovered that the Beebug
Master ROM (which I used to maintain) used the zero page locations
which Terminal on the Master used for (as I recall) vectors for
XON/XOFF processing :-(
--
Andrew Benham adsb@...
Southgate, London N14, United Kingdom
The gates in my computer are AND OR and NOT, not "Bill"