home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / romdate.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  2KB  |  70 lines

  1. /*
  2.  * File......: ROMDATE.C
  3.  * Author....: David Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: 25/03/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Dave Pearson and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20. #include <Extend.H>
  21.  
  22. /*
  23.  *  $DOC$
  24.  *  $FUNCNAME$
  25.  *      GT_ROMDATE()
  26.  *  $CATEGORY$
  27.  *      System
  28.  *  $ONELINER$
  29.  *      Return the date stamp of the ROM BIOS.
  30.  *  $SYNTAX$
  31.  *      GT_RomDate() --> dRomDate
  32.  *  $ARGUMENTS$
  33.  *      None
  34.  *  $RETURNS$
  35.  *      Date stamp of the ROM Bios chip.
  36.  *  $DESCRIPTION$
  37.  *      GT_RomDate() can be used to retrieve the date stamp of the ROM Bios
  38.  *      chip of a machine. Most IBM compitable machines have the date of the
  39.  *      ROM help at a certain location in memory, if you are running your
  40.  *      application on a non-standard machine the date returned may be empty
  41.  *      or may be incorrect.
  42.  *
  43.  *      GT_RomDate() can be used for debugging or could be used to tie your
  44.  *      application to a certain machine (not forgetting that there can
  45.  *      be more than one machine with the same date!).
  46.  *  $EXAMPLES$
  47.  *      // Check that the application has not been moved to another
  48.  *      // machine.
  49.  *
  50.  *      if GT_RomDate() == GT_SToD("19880115")
  51.  *         // Allow access to application.
  52.  *      else
  53.  *         ? "Error: This appliction has been moved to another machine!"
  54.  *      endif
  55.  *  $END$
  56.  */
  57.  
  58. CLIPPER GT_RomDate(void)
  59. {
  60.         char sRomDate[] = "19YYMMDD";
  61.  
  62.         sRomDate[2] = *((char *) 0xf000fffb);
  63.         sRomDate[3] = *((char *) 0xf000fffc);
  64.         sRomDate[4] = *((char *) 0xf000fff5);
  65.         sRomDate[5] = *((char *) 0xf000fff6);
  66.         sRomDate[6] = *((char *) 0xf000fff8);
  67.         sRomDate[7] = *((char *) 0xf000fff9);
  68.         _retds(sRomDate);
  69. }
  70.