On 2012-07-13 07:25, Rick Murphy <rick at rickmurphy.net> wrote:
At 06:51 AM 7/12/2012, Johnny Billquist wrote:
>Right. But that is a limitation of the
command decoder, and have very
>little to do with any other part of OS/8 date handling. The date
>encoding in OS/8 itself actually worked until 2002.
What you mean is that you
can set the system date information to
correspond to dates as late as 2002 if you either do it by hand (ODT)
or with some other program. However, being able to set the date to
something in 2001 doesn't help you much, because nothing that I know of
that's shipped with the OS handles dates past 1999. (Note: I don't know
if any of the OS/78 or OS/278 kits did anything here.)
Correct. The command decoder is not the only piece of software that
can't handle dates beyond 1999, but the example you gave showed the
specific limitation of the command decoder.
But I never claimed that OS/8 was Y2K safe. I only pointed out that the
internal representation of a date in OS/8 was in fact good until 2002.
For example, setting the date to 31-DEC-77 then
setting the two
extended date bits on gives you:
.DATE
Monday December 31, 19 1
OK, that's still the Command Decoder. How about DIR?
No, it's not the command decoder (as in the decoding and parsing of the
command), but it's the date command output itself that do not handle
dates beyond Y2K.
.DIR 2000.*
31-Dec-101
2000 .TX 1 31-Dec-101
1 Files in 1 Blocks - 615 Free blocks
Looks like the date handling is pretty broken. Unless you're aware of
something that actually displays the right date for such things.
No. It is broken. In this case DIRECT. I would suspect every utility
that ever existed, more or less, in OS/8 to not handle dates beyond Y2K.
But that could be fixed, and it's a separate issue from the date command
accepting years beyond 1999 as input.
Just for information, older versions of RSX, for example, have exactly
the same bug. 2001 shows up as 101 in various places, even though RSX
itself is actually good until the year 34667.
In a way though, 101 is pretty logical. Program that displayed years as
two digit numbers were actually often just showing an offset from the
year 1900, and 2001 is, by that view, 101. But it's not pretty. Nor
actually a correct display of the year.
Oh, and the other fun aspect:
.DATE 1-JAN-77
.DIR 2000.*
01-Jan-77
2000 .TX 1 31-Dec-77
1 Files in 1 Blocks - 615 Free blocks
When you change the date, you might also be changing the creation dates
for files by one or more multiples of 8 years.
Right. That is a known limitation that is documented. Dates on files do
only cover a 8 year span, so they simply guess which 8-year span to
apply to file dates. It was a "problem" already in 1978.
The failure to include extended date bits in
directories means that
whatever date your files were created in, they're assumed to be within
eight years of the current date. Changing the date changes what the OS
thinks the creation date is for a file.
Correct.
>
>>What 31-DEC-99 gives you from TECO:
> >>.R TECO
> >>*^B==$$
> >>16375
> >>
> >>(12 * 32) + 31) * 8 = 3320
> >>(1999 - 1970) & 7 = 5
> >>3325 DEC, 6375 OCT plus 4096 gives 16375.
> >>
> >>You can't tell what this really means (it could be 1983, 1991, or 1999)
> >>but that's an OS/8 failure, not TECO.
>
>No. That is a failure in TECO. OS/8 obviously knows if it is 1975,
>1983, 1991 or 1999. The information is not preserved in TECO. TECO fail.
It's also a failure in OS/8. 12 bits gives you potentially 11 years of
date range (4096 days at 365 days per year); the 14 bits they're using
could have given almost 45 years of date range if DEC had decided to
change the date format to be days since 1-jan-1970. It would have made
sense given that the current format has so many problems (can't be
compared using simple arithmetic, for example).
This is a different issue, but sure. Different date formats could have
made the system work for longer. There is actually no reason why you
need to stuff all the information into just one 12-bit word either. But
it's all a tradeoff between speed, space, and complexity. DEC chose
initially to store the date in one 12-bit word, with different bitfields
reserved for different parts of the date. Not super compact, but easy to
deal with. It ran out of range in 1978, they did the simplest form of
extension by reserving two more bits in another word in memory, while
not doing anything at all about dates on files.
That scheme in turn ran out in 2002, but I suspect DEC was happy enough
with that, since at Y2K, a lot of other things would break anyway (as
you showed above), so an extension of the date format that carried
longer would not be very useful anyway without going through and fixing
all other code there was, which is a lot, and which they didn't do.
But the fact that TECO can't tell a date from beyond 1985 is not
something you can blame OS/8 for anyway. TECO made its own choice on how
to represent dates. Information in OS/8 gives you unique dates until
2001, but TECO does not. You can't possibly blame OS/8 for that.
>The
problem is that OS/8 keeps two bits for the extension of the
>years, while TECO compressed that into just one bit. Loss of
>information follows.
>
>However, with only 13 bits for integers in TECO, I'm not sure how you
>would go about to solve it in a reasonable way...
True, there's not much
that can be done given the data type. 13 bits
packed just doesn't get you enough range.
The TECO source doesn't say anything about this limitation, but it just
ignores the high-order date bit:
CTL.B, TAD I (7777
RTL
RTL
RAL /PUT EXTENDED DATE BIT IN LINK
L7200, 7200 /CLA
CDF 10
TAD I (7666
CDF 0
JMP I (NCOM
Ooo. So TECO-8 actually lie in their documentation... Even worse.
A year in the range 1986-1994 would just have looked like 1970-1977.
That's ugly of them.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt at softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol