Function 2Dh Set Time

mov ch, Hour ;hour (0 through 23)

mov cl, Minutes ;minutes (0 through 59)

mov dh, Seconds ;seconds (0 through 59)

mov dl, Hundredths ;hundredths of a second (0 through 99)

mov ah, 2Dh ;Set Time

int 21h

cmp al, 0 ;zero means success

jne error_handler

Set Time (Function 2Dh) sets the MS-DOS system time (the time maintained by the clock device).

Parameters

Hour

Specifies the hour to set in 24-hour format (13 = 1 P.M., 14 = 2 P.M., and so on).

Minutes

Specifies the minutes to set (0 through 59).

Seconds

Specifies the seconds to set (0 through 59).

Hundredths

Specifies the hundredths of a second to set (0 through 99).

Return Value

If the function is successful, the AL register contains 00h. Otherwise, the AL register contains 0FFh.

Comment

If the hardware does not resolve hundredths of seconds, the value of Hundredths is ignored.

See Also

Function 2Ah Get Date
Function 2Bh Set Date
Function 2Ch Get Time