[Coco] bug in Basic09
Gene Heskett
gene.heskett at verizon.net
Sat Aug 12 12:13:52 EDT 2006
On Saturday 12 August 2006 06:54, Bob Devries wrote:
>People, I've come across a bug in Basic09 that is related to our Y2K
>problem.
>
>It is the DATE$ function.
>If I issue the command:
>
>PRINT DATE$
>
>in my Basic09 programme, it returns:
>:6/08/12 20:50:00
>
>It *should* either return:
>
>106/08/12 20:50:00
>or
>06/08/12 20:50:00
>or
>2006/08/12 20:50:00
>
>Has anyone looked at patching Basic09 (and RunB) to deal with this issue?
>
There are some 'fixed' clocks and date display utils about, I even wrote
one of them. But basic09 and runb were never fixed. The problem is the
the era for os9 starts with the year 1900, and no one when that code was
being written, had any idea there would still be working systems in the
years>1999.
The size of the year in the date packet the system maintains is a byte
only, which limits the year to 1900+255 in range. We haven't exceeded
that (yet, and I won't be around when we do), but no provision was ever
made to handle that binary to decimal conversion where the year was
>99decimal.
ISTR in my own fixes, I used 1999 as a breakpoint, subbing 100decimal from
values>63hex, and then fixed the date utility so it added 100decimal if
the result of that subtraction was <1970. But fixing that date utility
didn't of course fix the basic09 or runb internal versions.
The clock module itself doesn't care if the year byte goes greater than
64hex (year =100+1900=2000), so its as happy as a clam clear up to dec 31
2155, at which point it will simply roll over to 00hex as there's no check
for a carry there. At that point, the fixed date utils will be wrong
until 1970 rolls around again 70 years later. By then I have serious
doubts there will be any functioning coco/os9 systems left, nor anyone who
might care.
Dissing basic09 or runb would be quite a project in itself, and I have no
idea if its ever been done. Once dissed, then one would search thru the
dis to find the os9 f$gettim call and begin editing it there. If a good
dis already exists, then this would be 80% easier.
To Boisy, does such a beast exist in your archives? Maybe after 7 years of
this, someone might be able to effect a fix?
>--
>Regards, Bob Devries, Dalby, Queensland, Australia
>
>Isaiah 50:4 The sovereign Lord has given me
>the capacity to be his spokesman,
>so that I know how to help the weary.
>
>website: http://www.home.gil.com.au/~bdevasl
>my blog: http://bdevries.invigorated.org/
--
Cheers, Gene
People having trouble with vz bouncing email to me should add the word
'online' between the 'verizon', and the dot which bypasses vz's
stupid bounce rules. I do use spamassassin too. :-)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2006 by Maurice Eugene Heskett, all rights reserved.
More information about the Coco
mailing list