Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!phri!greenber From: greenber@phri.UUCP (Ross Greenberg) Newsgroups: net.micro.att Subject: Accessing the ATT clock while running IBM DOS3.1 Message-ID: <2284@phri.UUCP> Date: Sat, 15-Mar-86 14:39:38 EST Article-I.D.: phri.2284 Posted: Sat Mar 15 14:39:38 1986 Date-Received: Mon, 17-Mar-86 03:37:47 EST Distribution: net Organization: Public Health Research Inst. (NY, NY) Lines: 38 A while ago I had to reformat an ATT 6300 with DOS3.1 in order to get the cluster size down to a reasonable size. That worked like a charm --- except that the clock was no longer set upon boot-up. The following should allow you to create your own "clockset" program. A version of this is coming out on one of the upcoming PC/BLUE vols. 1) Call interrupt 0x1a with AH = 0xFE. This returns the time in the registers as you expect, and the date (in the format described below) in BX 2) Do a DOS call to set the time: INT 0x21 with AH = 0x2d 3) The date is the number of days since January 1, 1984. Forget about leap-years --- seems ATT doesn't believe in them. A simle kludge to convert: year = num_days/365 num_days -= (year * 365) month = 1; while (num_days > month_tab[month]) num_days -= month_tab[month++]; year += 1984; 4) Then set up the registers as for a DOS Set date: regset.h.dl = num_days; regset.h.dh = month; regset.x.cx = year; and call DOS Int 0x21 with AH = 0x2b. Voila! You have your date and time back. -- ------ ross m. greenberg ihnp4!allegra!phri!sysdes!greenber [phri rarely makes a guest-account user a spokesperson. Especially not me.]