|96h||TM$WEEK||get week number|
|Input||X register - Address of 3 byte date.|
|Output||B register - Week number (0 to 52).
If the date is invalid, carry flag is set.
|Description||Returns the week number of the supplied
date. The first MONDAY of the year starts WEEK 1 which is returned as 0.
Any dates before this MONDAY are in the last week of the previous year.
Applications (eg the DIARY) convert the week number from 0-52 to 1-53.
The X register points to a 3 byte date containing YEAR:MONTH:DAY in the following ranges:
YEAR: 0 - 255 (representing 1900 - 2155)
The result is returned in the B register, the 1st week is 0.
This call is not available on CM/XP machines.
Returns the "week number - 1" for 25th Dec 1988.
LDX #DATE ;point to 3 byte date OS TM$WEEK BCS BAD_DATE ;branch if invalid date STAB WEEK ;store week number RTS DATE: DB 88 ;year 1988 DB 11 ;month december DB 24 ;25th day
|Errors||If an invalid date is passed, the carry flag will be set but there is no error code in B.|