home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / bios / b_time.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-29  |  444 b   |  22 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2.  
  3. #include <bios.h>
  4. #include <dpmi.h>
  5.  
  6. unsigned
  7. _bios_timeofday(unsigned _cmd, unsigned long *_timeval)
  8. {
  9.   __dpmi_regs r;
  10.  
  11.   r.h.ah = _cmd;
  12.   if ( _cmd == _TIME_SETCLOCK )
  13.   {
  14.     r.x.cx = *_timeval >> 16;
  15.     r.x.dx = *_timeval & 0xffff;
  16.   }
  17.   __dpmi_int(0x1a, &r);
  18.   if ( _cmd == _TIME_GETCLOCK )
  19.     *_timeval = (r.x.cx << 16) | r.x.dx;
  20.   return r.h.al;
  21. }
  22.