Category : Files from Magazines
Archive   : PJ61.ZIP
Filename : LISTING1.C

 
Output of file : LISTING1.C contained in archive : PJ61.ZIP
/*
* gettime.c -- Uses BIOS interrupt 0x1A to get the timer count
* in clock ticks.
* Copyright Frank D. Greco, 1987
* Page 50, Volume 6.1 Programmer's Journal
*/

#include

#define TOD_INT 0x1a

unsigned long gettime()
{
union REGS in, out;
unsigned long current_tix; /* 32-bit tick value to be returned */

in.h.ah = 0; /* AH = 0 GET clock ticks */
int86(TOD_INT, &in, &out); /* Call BIOS timer tick interrupt */

current_tix = ( (long) out.x.cx << 16 ) + out.x.dx;

/* If midnite passes, add a day's worth of clock tix to the return value */

return ( out.x.ax & 0xff ) ? current_tix += 0x01800b0L: current_tix;
}


  3 Responses to “Category : Files from Magazines
Archive   : PJ61.ZIP
Filename : LISTING1.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/