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

  1. /*---------------------------------------------------------------------------
  2.  * filename - bios_equ.cas
  3.  *
  4.  * function(s)
  5.  *        _bios_equiplist  - checks equipment (MSC compatible)
  6.  *        _bios_memsize    - returns memory size (MSC compatible)
  7.  *        _bios_timeofday  - returns time of day (MSC compatible)
  8.  *--------------------------------------------------------------------------*/
  9.  
  10. /*
  11.  *      C/C++ Run Time Library - Version 5.0
  12.  *
  13.  *      Copyright (c) 1991, 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            _bios_equiplist - checks equipment
  27.  
  28. Usage           unsigned _bios_equiplist(void);
  29.  
  30. Prototype in    bios.h
  31.  
  32. Description     interface to BIOS interrupt 0x11, equipment list service.
  33.                 MSC compatible; identical to old biosequip() function,
  34.                 except for the type of the return value.
  35.  
  36. Return value    value returned through AX by interrupt 0x11
  37.  
  38. *---------------------------------------------------------------------------*/
  39. unsigned int _bios_equiplist(void)
  40. {
  41.         geninterrupt(0x11);
  42.  
  43.         return _AX;
  44. }
  45.  
  46.  
  47. /*--------------------------------------------------------------------------*
  48.  
  49. Name            _bios_memsize - returns memory size
  50.  
  51. Usage           unsigned _bios_memsize(void);
  52.  
  53. Prototype in    bios.h
  54.  
  55. Description     Interface to BIOS interrupt 0x12, memory-size service.
  56.                 MSC compatible; identical to older biosmemory() function,
  57.                 except for the type of the return value.
  58.  
  59. Return value    value returned through AX by interrupt 0x12, the size
  60.                 of memory in 1K blocks.
  61.  
  62. *---------------------------------------------------------------------------*/
  63. unsigned _bios_memsize(void)
  64. {
  65. asm     int     12h
  66.  
  67.         return _AX;
  68. }
  69.  
  70.  
  71. /*--------------------------------------------------------------------------*
  72.  
  73. Name            _bios_timeofday - returns time of day
  74.  
  75. Usage           unsigned _bios_timeofday(unsigned int cmd, long *timeval);
  76.  
  77. Prototype in    bios.h
  78.  
  79. Description     Interface to BIOS interrupt 0x1A, time-of-day services.
  80.                 Gets or sets the time of day, according to cmd:
  81.  
  82.                 _TIME_GETCLOCK  Store the current time of day in *timeval.
  83.  
  84.                 _TIME_SETCLOCK  Set the current time of day to *timeval.
  85.  
  86.                 This function is MSC-compatible, and is not the same
  87.                 as the older biostime() function.
  88.  
  89. Return value    The value in AX after the BIOS interrupt.
  90.  
  91.  
  92.  
  93. *---------------------------------------------------------------------------*/
  94. unsigned _bios_timeofday(unsigned cmd, long *timeval)
  95. {
  96. asm     mov     ah, cmd
  97. asm     LES_    bx, timeval
  98. asm     mov     cx, W1(ES_ [bx])
  99. asm     mov     dx, W0(ES_ [bx])
  100. asm     int     1ah
  101. asm     cmp     BY0(cmd), _TIME_GETCLOCK
  102. asm     jne     BiosTimeEnd
  103. asm     mov     W0(ES_ [bx]), dx
  104. asm     mov     W1(ES_ [bx]), cx
  105. BiosTimeEnd:
  106.         return  _AX;
  107. }
  108.