home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / progjrn / pj_6_1.arc / LISTING2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-28  |  640 b   |  22 lines

  1.   /*
  2.    * gettix.c  -- Gets the current timer tick from the BIOS in two ways:
  3.    *
  4.    *          1.) Through the BIOS            - The preferred way
  5.    *          2.) Directly via a far pointer  - The unrecommended way
  6.    *  Copyright Frank D. Greco, 1987
  7.    *  Page 50, Volume 6.1 Programmer's Journal
  8.    */
  9.   
  10.   #include <dos.h>
  11.   
  12.   main()
  13.   {
  14.       unsigned long gettime();
  15.       long far *fp;
  16.   
  17.       FP_SEG(fp) = 0x0040;
  18.       FP_OFF(fp) = 0x006C;
  19.   
  20.       printf("BIOS: %lu   Thru far ptr: %lu\n", gettime(), *fp);
  21.   }
  22.