Subject: | |
From: | |
Reply To: | Emerson, Tom |
Date: | Mon, 18 Oct 2004 11:32:21 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
> -----Original Message-----
> Behalf Of Peter Smithson
>
> The documentation for item 6 (file creation date) is that it uses the
> CALENDAR intrinsic format which says -
>
> Bits Value/Meaning
> 7:9 Day of year
> 0:7 Year since 1900
>
> I get a bit confused with this notation. Is that saying that
> the low 9
> bits are the year and the high 7 is the year?
This is an "endian-ness" issue :)
looking at the value as a string-of-bits, they are numbered from 15 down to zero, i.e.:
-------------------------------------------------
Bit pos: | | | | | | | | | | | | | | | | |
-------------------------------------------------
bit 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
number 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
> So today is year 104, day 292. So the value I'd expect is
>
> 292 + 104 * (2^9) which is 53540.
that seems to be correct:
988/COREDEV/TEMPTE%help calendar
4. CALENDARTODATE, date function
5. DATETOCALENDAR, date function
Which of the above would you like help on (or CR to exit)? 5
TODAY [DATE] Returns today's date.
CALENDARTODATE (I) [DATE] Returns the date represented by the
CALENDAR-intrinsic-format integer I.
DATETOCALENDAR (D) [INT] Returns the CALENDAR-intrinsic-format
representation of the date D.
988/COREDEV/TEMPTE%calc datetocalendar(today)
-11996, $FFFFD124, %37777750444, #65535/#53540, "...$"
> When I run a test program on MPE I get 1996 which is day 460 year 03.
since the "high-bit" is set, you get negative numbers (-11996); look to the right side of that output and you see that (sign extended), this is a positive 53540, exactly what you expected
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|