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++ 3.0r4 - <b>_bios_timeofday</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_bios_timeofday

   Note-This function is not available when using OS/2.

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 current 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>
   #include <stdlib.h>

   int 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 EXIT_SUCCESS;
   }

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



See Also: _bios_equiplist _bios_disk _bios_memsize _bios_printer _bios_serialcom

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