OS_Word 14

Reason: 0

Returns the INTERNATIONAL version of the string, it will return the correct LOCAL time.

Reason: 1

Should not be used anymore but returns values for the local time, not GMT.

Reason: 2

Should not be used, but accepts values for local time.

Reason: 3

Reads UTC (GMT) time in 5 byte format.

OS_Word 15

Reason: 8,15,24

Sets the time from an INTERNATIONAL string, the string should represent local time.

(All month, day names and the like are in the local language).

OS_ConvertStandardDateAndTime Entry:
R0 = Pointer to 5 byte UTC time value
R1 = Pointer to buffer for resulting string
R2 = Size of buffer Exit:
R0 = Pointer to buffer (R1 on entry)
R1 = Pointer to terminating 0 in buffer.
R2 = Number of bytes free in buffer.

OS_ConvertDateAndTime

Entry:

R0 = Pointer to 5 byte UTC time block
R1 = Pointer to buffer for resulting string R2 = Size of buffer
R3 = Pointer to format string (null terminated)

Exit:

R0 = Pointer to buffer (R1 on entry)
R1 = Pointer to terminating 0 in buffer. R2 = Number of bytes free in buffer.
R3 = Preserved

            
The fields for the above are now:
                       
CS - Centi-seconds
SE - Seconds
MI - Minutes
12 - Hours in 12 hour format
24 - Hours in 24 hour format
AM - AM or PM indicator in local language (may NOT be 2 characters) PM - AM or PM indicator in local language (may NOT be 2 characters)

WE - Weekday in full in local language. W3 - Short form of weekday name (May not be 3 characters) WN - Weekday as a number

DY - Day of the month (may not be 2 characters, and may not even be

                         numeric)

ST - Ordinal pre/suffix in local language (may be null)

MO - Month name in full
M3 - Short form of month name (May not be 3 characters) MN - Month number.

CE - Century
YR - Year within century

WK - Week of the year (As calculated in the territory, may not be Mon to

       Sun)

DN - Day of the year.

0 Insert an ASCII 0 byte

% Insert a '%'

Territory_ReadCalendarInformation In:
R0 = Territory to use (-1 = Configured)
R1 = Pointer to 5 byte UTC time value.
R2 = Pointer to an 11 word buffer

Out:

R0,R1 Preserved.

[R1] = Number of first working day in the week. [R1+4] = Number of last working day in the week. [R1+8] = Number of months in the current year.

                 (current = one in which given time falls)
[R1+12] = Number of days in the current month.

[R1+16] = Max length of AM/PM string. [R1+20] = Max length of WE string.
[R1+24] = Max length of W3 string.
[R1+28] = Max length of DY string.
[R1+32] = Max length of ST string (May be 0). [R1+36] = Max length of MO string.
[R1+40] = Max length of M3 string.

Territory_ConvertTimeToOrdinals In:
R0 = Territory to use (-1 = Configured)
R1 = Pointer to 5 byte UTC time value.
R2 = Pointer to buffer

Out

R0,R1 preserved.

   [R1]    = CS.                     ; all values are for LOCAL time
[R1+4] = Second
[R1+8] = Minute
[R1+12] = Hour (out of 24)
[R1+16] = Day number in month.
[R1+20] = Month number in year.
[R1+24] = Year number.

Territory_ConvertOrdinalsToTime In:
R0 = Territory to use (-1 = Configured)
R1 = Pointer to 5 byte buffer. ; all values are for LOCAL time
R2 = Pointer to buffer
[R1] = CS.
[R1+4] = Second
[R1+8] = Minute
[R1+12] = Hour (out of 24)
[R1+16] = Day number in month.
[R1+20] = Month number in year.
[R1+24] = Year number.

Out

[R0] 5 byte UTC time.

Territory_SetTime

In:

R0 = Pointer to 5 byte UTC time value

Out:

CMOS clock set to given time.