This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

Read CMOS clock

Table of Contents

This routine reads from the onboard CMOS clock.

For systems without a CMOS clock, the MOS passes the calls to sideways ROM's for support.

The first byte of the parameter block is a function code representing the action required. The rest of the block's content (including its size) depends on that function.

Return clock value as string

On entry:

XY=0

On exit:

XY+ Length Content Value range
0 24 Date CR-terminated string in form "Day,DD Mon Year.HH:MM:SS".

Return BCD clock value

On entry:

XY=1

On exit:

XY+ Length Content Value range
0 1 year 0x00 0x99
1 1 month 0x01 0x12
0 1 day 0x01 0x31
0 1 day of week 0x01 Sun 0x07 Sat
Notes:
year
0x80-0x99 represents 1980-1999. 0x00-0x79 represents 2000-2079.
day of week
0x00 = not returned

Convert BCD to string

On entry:

XY=1

XY+1…7 the BCD value as returned above

On exit:

XY+1…25 CR terminated string

XY+ Length Content Value range
0 1 year 0x00 0x99