home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bc3.zip / DPMI.INC < prev    next >
Text File  |  1992-02-14  |  4KB  |  175 lines

  1. ;;
  2. ;; (c) Copyright 1992, Qualitas, Inc. All Rights Reserved
  3. ;;
  4. ;; dpmi.inc - include file for DPMI.ASM
  5.  
  6. ;;
  7. ;; basic typedefs
  8. ;;
  9.  
  10.  
  11. ifdef ??version                ;; if Borland
  12. if  ??version lt 0300h            ;; if TASM 2.0
  13.     uChar        equ BYTE
  14.     uShort        equ WORD
  15.     uLong        equ DWORD
  16.     selector_t  equ WORD
  17. else                    ;; else TASM 3.0 
  18.     uChar        typedef BYTE
  19.     uShort        typedef WORD
  20.     uLong        typedef DWORD
  21.     selector_t  typedef WORD
  22. endif
  23. else                    ;; else MASM 6.0
  24.     uChar        typedef BYTE
  25.     uShort        typedef WORD
  26.     uLong        typedef DWORD
  27.     selector_t  typedef WORD
  28. endif
  29.  
  30. ;;
  31. ;; descriptor structure
  32. ;;
  33. descriptor_t        STRUC   
  34.     descLimit        DW        ?
  35.     descBaseLo        DW        ?
  36.     descBaseMid        DB        ?
  37.     descArb            DB        ?
  38.     descArb386        DB        ?
  39.     descBaseHi        DB        ?
  40. descriptor_t        ENDS
  41.  
  42. ;;
  43. ;; structure returned by DPMI Query Free Memory service
  44. ;;
  45. freeMem_t        STRUC   
  46.     largeFree        DD        ?
  47.     maxUnlocked        DD        ?
  48.     maxLocked        DD        ?
  49.     lineaize        DD        ?
  50.     nUnlockedPages        DD        ?
  51.     nFreePages        DD        ?
  52.     nPhysicalPages        DD        ?
  53.     freeLinearSpace        DD        ?
  54.     pageFreeSize        DD        ?
  55.     reserved        DD        3 DUP ( ? )
  56. freeMem_t        ENDS
  57.  
  58. ;;
  59. ;; 16-bit DPMI exception frame
  60. ;;
  61. excFrame        STRUC   
  62.     excErr   DW        ?
  63.     excIP    DW        ?
  64.     excCS    DW        ?
  65.     excFlags DW        ?
  66.     excSP    DW        ?
  67.     excSS    DW        ?
  68. excFrame        ENDS
  69.  
  70. ;;
  71. ;; Register structure for raw mode switch
  72. ;;
  73. rawModeRegs_t        STRUC   
  74.     rawDS    DW        ?
  75.     rawES    DW        ?
  76.     rawSS    DW        ?
  77.     rawCS    DW        ?
  78. rawModeRegs_t        ENDS
  79.  
  80. ;;
  81. ;; Model sensitive macro to allow port to LARGE model (someday ...)
  82. ;;
  83. ldptr    MACRO reg, ptrloc, segreg
  84.  
  85. IF @DataSize            ;; if not small model
  86.   ifb <segreg>
  87.       lds    reg, ptrloc
  88.   else
  89.     l&segreg reg, ptrloc    ;;    load far ptr
  90.   endif
  91.  
  92. ELSE                ;; else small model
  93.     mov    reg, ptrloc    
  94.   ifnb <segreg>
  95.       push    ds
  96.     pop    segreg
  97.   endif
  98.  
  99. ENDIF
  100.     ENDM
  101.  
  102.  
  103. ;; Load and store long macros
  104. ;;
  105.  
  106. ldlong    MACRO hi, lo, mem
  107.     mov    lo, word ptr mem
  108.     mov    hi, word ptr mem.2
  109.     ENDM
  110.  
  111. stlong    MACRO mem, hi, lo
  112.     mov    word ptr mem, lo
  113.     mov    word ptr mem.2, hi
  114.     ENDM
  115.  
  116. public C DPMIReleaseTimeSlice
  117. public C DPMIGetCPUMode
  118. public C DPMIObtainSwitchEntryPoint
  119. public C DPMIEnterProtectedMode
  120. public C DPMIAllocateDescriptors
  121. public C DPMIFreeDescriptor
  122. public C DPMIParaToSelector
  123. public C DPMIGetSelectorDelta
  124. public C DPMIGetSegmentBase
  125. public C DPMISetSegmentBase
  126. public C DPMIGetSegmentLimit
  127. public C DPMISetSegmentLimit
  128. public C DPMIGetSegmentAttributes
  129. public C DPMISetSegmentAttributes
  130. public C DPMICreateAlias
  131. public C DPMIGetDescriptor
  132. public C DPMISetDescriptor
  133. public C DPMIAllocateSpecificDescriptor
  134. public C DPMIAllocateDOSMemory
  135. public C DPMIFreeDOSMemory
  136. public C DPMIResizeDOSMemory 
  137. public C DPMIGetRealInterruptVector
  138. public C DPMISetRealInterruptVector
  139. public C DPMIGetExceptionVector
  140. public C DPMISetExceptionVector
  141. public C DPMIGetProtInterruptVector
  142. public C DPMISetProtInterruptVector
  143. public C DPMIIssueRealInterrupt
  144. public C DPMICallRealProcedure
  145. public C DPMICallRealInterruptProcedure
  146. public C DPMIAllocateRealCallBack
  147. public C DPMIFreeRealCallBack
  148. public C DPMIGetStateSaveRestoreProcs
  149. public C DPMISaveOrRestoreState
  150. public C DPMIGetRawSwitchProc
  151. public C DPMIDoRawSwitch
  152. public C DPMIGetVersion
  153. public C DPMIGetFreeMemory
  154. public C DPMIAllocateMemory
  155. public C DPMIFreeMemory
  156. public C DPMIResizeMemory
  157. public C DPMILockRegion
  158. public C DPMIUnlockRegion
  159. public C DPMIMarkRealRegionPageable
  160. public C DPMIRelockRealRegion
  161. public C DPMIGetPageSize
  162. public C DPMINominatePages
  163. public C DPMIDiscardPageContents
  164. public C DPMIMapPhysicalRegion
  165. public C DPMITestDisableInts
  166. public C DPMITestEnableInts
  167. public C DPMITestInts
  168. public C DPMIGetVendorEntryPoint
  169. public C DPMISetWatchpoint
  170. public C DPMIClearWatchpoint
  171. public C DPMIGetWatchpointState
  172. public C DPMIResetWatchpoint
  173. public C getCS
  174. public C getDS
  175.