Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - _bios_timeofday http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   _bios_timeofday

   Usage
   #include <bios.h>
   int _bios_timeofday(unsigned mode, long *btime);

   Description
   _bios_timeofday  provides  an interface to the IBM BIOS  time  of  day
   functions,  interrupt 0x1a (26). The argument mode determines  whether
   the time is to be read (mode = 0) or set (mode = 1). If the time is to
   be  read,  the cuurent BIOS time (in clock ticks  since  midnight)  is
   placed  in  the long integer pointed to by btime, otherwise  the  BIOS
   time  of  day  counter is set to the value of  that  long.  There  are
   approximately 18.2  clock ticks per second.

   Example
   #include <stdio.h>
   #include <bios.h>

   main()
   {
   unsigned hours, minutes;
   long btime;

        _bios_timeofday(0,&btime);
        btime = (btime*10)/182;
        minutes = btime/60;
        hours = minutes/60;
        minutes %= 60;
        printf("The time is %2d:%2d hours\n",hours,minutes);
   }

   Return Value
   If  mode  is 0 the function returns 1 if the system clock  has  passed
   midnight  since the last time it was read otherwise it returns  0.  if
   mode is 1, no meaningful value is returned


See Also: BIOS_package

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson