home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 5.ddi / CLIBSRC2.ZIP / BIOSEQU.CAS < prev    next >
Encoding:
Text File  |  1992-06-10  |  2.3 KB  |  92 lines

  1. /*---------------------------------------------------------------------------
  2.  * filename - biosequ.cas
  3.  *
  4.  * function(s)
  5.  *        biosequip  - checks equipment
  6.  *        biosmemory - returns memory size
  7.  *        biostime   - returns time of day
  8.  *--------------------------------------------------------------------------*/
  9.  
  10. /*
  11.  *      C/C++ Run Time Library - Version 5.0
  12.  *
  13.  *      Copyright (c) 1987, 1992 by Borland International
  14.  *      All Rights Reserved.
  15.  *
  16.  */
  17.  
  18.  
  19. #pragma inline
  20. #include <asmrules.h>
  21. #include <bios.h>
  22. #include <dos.h>
  23.  
  24. /*--------------------------------------------------------------------------*
  25.  
  26. Name            biosequip - checks equipment
  27.  
  28. Usage           int biosequip(void);
  29.  
  30. Prototype in    bios.h
  31.  
  32. Description     interface to BIOS interrupt 0x11, equipment list service
  33.  
  34. Return value    value returned through AX by interrupt 0x11
  35.  
  36. *---------------------------------------------------------------------------*/
  37. int biosequip(void)
  38. {
  39.         geninterrupt(0x11);
  40.  
  41.         return _AX;
  42. }
  43.  
  44.  
  45. /*--------------------------------------------------------------------------*
  46.  
  47. Name            biosmemory - returns memory size
  48.  
  49. Usage           int biosmemory(void);
  50.  
  51. Prototype in    bios.h
  52.  
  53. Description     interface to BIOS interrupt 0x12, memory-size service
  54.  
  55. Return value    value returned through AX by interrupt 0x12, the size
  56.                 of memory in 1K blocks.
  57.  
  58. *---------------------------------------------------------------------------*/
  59. int biosmemory(void)
  60. {
  61. asm     int     12h
  62.  
  63.         return _AX;
  64. }
  65.  
  66.  
  67. /*--------------------------------------------------------------------------*
  68.  
  69. Name            biostime - returns time of day
  70.  
  71. Usage           long biostime(int cmd, long newtime);
  72.  
  73. Prototype in    bios.h
  74.  
  75. Description     interface to BIOS interrupt 0x1A, time-of-day services
  76.  
  77. Return value    When biostime reads the BIOS timer, (cmd = 0), it returns
  78.                 the timer's current value.
  79.  
  80. *---------------------------------------------------------------------------*/
  81. long biostime(int cmd, long newtime)
  82. {
  83. asm     mov     ah, cmd
  84. asm     mov     cx, W1(newtime)
  85. asm     mov     dx, W0(newtime)
  86. asm     int     1ah
  87. asm     xchg    ax, dx
  88. asm     mov     dx, cx
  89.  
  90. return( MK_LONG );
  91. }
  92.