/* 
 *	getticks -- get the current BIOS clock ticks value 
 */ 
#include <dos.h> 
 
#define TOD		0x1A 
#define READ_COUNT	0 
#define TICKS_PER_DAY	0x01800B0L 
 
long 
getticks() 
{ 
	long count; 
	union REGS inregs, outregs; 
 
	/* get BIOS time of day as no. of ticks since midnight */ 
	inregs.h.ah = READ_COUNT; 
	int86(TOD, &inregs, &outregs); 
	/* correct for possible rollover at 24 hours */ 
	count = (outregs.h.al != 0) ? TICKS_PER_DAY : 0; 
	/* add current day ticks */ 
	count += (outregs.x.dx + (outregs.x.cx << 16)); 
 
	return (count); 
} 
