home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 21 / CD_ASCQ_21_040595.iso / dos / prg / c / freedos3 / source / xms / xms.inc < prev    next >
Text File  |  1994-12-28  |  4KB  |  185 lines

  1. ;==============================================================================
  2. ;==
  3. ;==     Project                 : 286 XMS driver
  4. ;==     Module name             : HM286.HM
  5. ;==     Author(s)               : Mark E. Huss
  6. ;==     Purpose                 : HM.ASM strucs, macros & equates
  7. ;==
  8. ;==     Created                 : 11/5/90
  9. ;==
  10. ;==                              Revision history
  11. ;==                              ================
  12. ;==
  13. ;==============================================================================
  14.     page 65,132
  15.  
  16. AVERSION     equ    "2.10"
  17. XMS_VERSION    equ    200h
  18. OUR_VERSION    equ    XMS_VERSION + 10h
  19.  
  20. DEBUG        equ    0    ; 1 for extra debug info at runtime
  21. MOLDY_286    equ    0    ; 1 to avoid 286 B-step bug
  22.  
  23. MIN_XMEM    equ    384        ; minimum usable memory
  24. MAX_HANDLES    equ    8
  25. XMEM_BASE    equ    440h        ; 110000h base (110000 / 1K)
  26.  
  27. DD_INIT        equ    00h
  28. DD_DONE        equ    0100h
  29. DD_ERROR    equ    8000h
  30. DD_CMD_ERR    equ    DD_ERROR + 3    ; unknown command
  31.  
  32. PIC_MASK    equ    21h        ; PIC mask register
  33.  
  34. SYSTEM_CONTROL_PORT_A    equ    92h
  35. A20_ENABLE_BIT        equ    2
  36. CARRY_FLAG        equ    1
  37.  
  38. VDISK_OFS        equ    12h
  39.  
  40. KC_A20_BIT    equ    02h
  41. KC_RESET_BIT    equ    01h
  42. KC_WR_OUTPORT    equ    0D1h
  43. KBD_DATA    equ    60h
  44. KBD_STATUS    equ    64h
  45. KBD_COMMAND    equ    64h
  46. KS_INPORT_FULL    equ    02h
  47.  
  48. ; hm_flags
  49.  
  50. INIT_DONE    equ    01h
  51. INT15_HOOKED    equ    02h
  52. HMA_IN_USE    equ    04h
  53. IN_MOVE        equ    08h
  54.  
  55. ; xms_handle flgs
  56.  
  57. XH_IN_USE    equ    01h        ; handle in use
  58. XH_LAST        equ    02h        ; last handle in chain
  59. ;------------------------------------------------------------------------------
  60.  
  61. Rest    MACRO
  62.     jmp    $+2
  63.     ENDM
  64.  
  65. @Print    MACRO    s1
  66.     IFNB    <s1>
  67.       mov    dx,offset s1
  68.     ENDIF
  69.     mov    ah,9
  70.     int    21h
  71.     ENDM
  72.  
  73. @popf    MACRO
  74. if MOLDY_286
  75.     push    cs
  76.     call    popf_iret    ; popf for 286 B-step bug
  77. else
  78.     popf            ; normal popf
  79. endif
  80.     ENDM
  81.  
  82. ;------------------------------------------------------------------------------
  83.  
  84. words    struc            ; for accessing 1/2 dwords
  85. lsw    dw    ?
  86. msw    dw    ?
  87. words    ends
  88.  
  89. bytes    struc            ; for accessing 1/2 words
  90. lsb    db    ?
  91. msb    db    ?
  92. bytes    ends
  93.  
  94. reqhdr    struc
  95.     db    ?        ; length
  96.     db    ?        ; unit #
  97.  cmd    db    ?        ; command
  98.  stat    dw    ?        ; status
  99.     db    8 dup(?)    ; reserved
  100. reqhdr    ends
  101.  
  102. inithdr    struc
  103.     db    (type reqhdr) dup(?)
  104.  units    db    0
  105.  endofs    dw    0
  106.  endseg    dw    0
  107.  bpbofs    dw    0
  108.  bpbseg    dw    0
  109. inithdr    ends
  110.  
  111. regframe    struc
  112.  r_es    dw    ?
  113.  r_ds    dw    ?
  114.  r_di    dw    ?
  115.  r_si    dw    ?
  116.  r_bp    dw    ?
  117.  r_sp    dw    ?
  118.  r_bx    dw    ?
  119.  r_dx    dw    ?
  120.  r_cx    dw    ?
  121.  r_ax    dw    ?
  122. regframe    ends
  123.  
  124. xms_handle    struc
  125.  xbase    dw    ?
  126.  xsize    dw    ?
  127.  xlocks    db    ?
  128.  xflags    db    ?
  129. xms_handle    ends
  130.  
  131. xmem_move    struc
  132.  length_lo    dw    ?
  133.  length_hi    dw    ?
  134.  source_handle    dw    ?
  135.  source_lo    dw    ?
  136.  source_hi    dw    ?
  137.  dest_handle    dw    ?
  138.  dest_lo    dw    ?
  139.  dest_hi    dw    ?
  140. xmem_move    ends
  141.  
  142. xmem_sub_move    struc
  143.  xhandle    dw    ?
  144.  xaddr_lo    dw    ?
  145.  xaddr_hi    dw    ?
  146. xmem_sub_move    ends
  147.  
  148. desc        struc
  149.  limit        dw    0FFFFh
  150.  basel        dw    0
  151.  baseh        db    0
  152.  acc        db    93h    ; present, cpl0, r/w
  153.  resv        dw    0
  154. desc        ends
  155.  
  156. ;------------------------------------------------------------------------------
  157. ; XMS 2.0 spec defined errors
  158. ;------------------------------------------------------------------------------
  159.  
  160. ERR_BAD_FN        equ    80h
  161. ERR_VDISK        equ    81h
  162. ERR_A20_GATE        equ    82h
  163. ERR_GENERAL        equ    8Eh
  164. ERR_UNREC_DRV        equ    8Fh
  165. ERR_HMA_NOT_THERE    equ    90h
  166. ERR_HMA_IN_USE        equ    91h
  167. ERR_HMA_NOT_ALLOCATED    equ    93h
  168. ERR_A20_STILL_ENABLED    equ    94h
  169. ERR_OUT_OF_XMEM        equ    0A0h
  170. ERR_OUT_OF_XHNDL    equ    0A1h
  171. ERR_BAD_XHNDL        equ    0A2h
  172. ERR_BAD_SRC_XHNDL    equ    0A3h
  173. ERR_BAD_SRC_OFS        equ    0A4h
  174. ERR_BAD_DEST_XHNDL    equ    0A5h
  175. ERR_BAD_DEST_OFS    equ    0A6h
  176. ERR_BAD_LEN        equ    0A7h
  177. ERR_MOV_OVERLAP        equ    0A8h
  178. ERR_PARITY        equ    0A9h
  179. ERR_BLOCK_NOT_LOCKED    equ    0AAh
  180. ERR_BLOCK_LOCKED    equ    0ABh
  181. ERR_OUT_OF_LOCKS    equ    0ACh
  182. ERR_LOCK_FAILURE    equ    0ADh
  183.  
  184. ;------------------------------------------------------------------------------
  185.