home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 2.ddi / CLIB2.ZIP / BIOSEQU.CAS < prev    next >
Encoding:
Text File  |  1990-06-07  |  2.6 KB  |  94 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. /*|                                                              |*/
  12. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  13. /*|                                                              |*/
  14. /*|                                                              |*/
  15. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  16. /*|     All Rights Reserved.                                     |*/
  17. /*|                                                              |*/
  18. /*[]------------------------------------------------------------[]*/
  19.  
  20.  
  21. #pragma inline
  22. #include <asmrules.h>
  23. #include <bios.h>
  24. #include <dos.h>
  25.  
  26. /*--------------------------------------------------------------------------*
  27.  
  28. Name        biosequip - checks equipment
  29.  
  30. Usage        int biosequip(void);
  31.  
  32. Prototype in    bios.h
  33.  
  34. Description    interface to BIOS interrupt 0x11, equipment list service
  35.  
  36. Return value    value returned through AX by interrupt 0x11
  37.  
  38. *---------------------------------------------------------------------------*/
  39. int biosequip(void)
  40. {
  41.           geninterrupt(0x11);
  42.  
  43.     return _AX;
  44. }
  45.  
  46.  
  47. /*--------------------------------------------------------------------------*
  48.  
  49. Name        biosmemory - returns memory size
  50.  
  51. Usage        int biosmemory(void);
  52.  
  53. Prototype in    bios.h
  54.  
  55. Description    interface to BIOS interrupt 0x12, memory-size service
  56.  
  57. Return value    value returned through AX by interrupt 0x12, the size
  58.         of memory in 1K blocks.
  59.  
  60. *---------------------------------------------------------------------------*/
  61. int biosmemory(void)
  62. {
  63. asm    int    12h
  64.  
  65.     return _AX;
  66. }
  67.  
  68.  
  69. /*--------------------------------------------------------------------------*
  70.  
  71. Name        biostime - returns time of day
  72.  
  73. Usage        long biostime(int cmd, long newtime);
  74.  
  75. Prototype in    bios.h
  76.  
  77. Description    interface to BIOS interrupt 0x1A, time-of-day services
  78.  
  79. Return value    When biostime reads the BIOS timer, (cmd = 0), it returns
  80.         the timer's current value.
  81.  
  82. *---------------------------------------------------------------------------*/
  83. long biostime(int cmd, long newtime)
  84. {
  85. asm    mov    ah, cmd
  86. asm    mov    cx, W1(newtime)
  87. asm    mov    dx, W0(newtime)
  88. asm    int    1ah
  89. asm     xchg    ax, dx
  90. asm    mov    dx, cx
  91.  
  92. return( MK_LONG );
  93. }
  94.