home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / inc / mvdm.inc < prev    next >
Text File  |  1999-04-30  |  5KB  |  266 lines

  1. ;***    MVDM.INC
  2. ;
  3. ;
  4. ;    MVDM constants and types
  5. ;    Copyright (c) 1988,1989 Microsoft Corporation
  6. ;
  7. ;    Include file hierarchy:
  8. ;
  9. ;      mvdm.inc
  10. ;        basemac.inc
  11. ;        basedef.inc
  12. ;        vdmprop.inc
  13. ;        vdmm.inc
  14. ;        v8086.inc
  15. ;        vdos.inc
  16. ;        vpic.inc
  17. ;        vdmbios.inc
  18. ;        vkbd.inc
  19. ;        vlpt.inc
  20. ;        vdma.inc
  21. ;
  22. ;    By default, ALL portions of ALL include files are included (ie,
  23. ;    INCL_ALL is assumed).
  24. ;
  25. ;    To control what is included, use INCL_NONE and then select from
  26. ;    the following:
  27. ;
  28. ;        INCL_DEF
  29. ;        INCL_MI        BUGBUG 22-Feb-89 JeffPar:  NOT included by default
  30. ;        INCL_TYPES
  31. ;        INCL_MVDMTYPES
  32. ;        INCL_SSTODS
  33. ;        INCL_ROMBIOS
  34. ;        INCL_PAGE
  35. ;        INCL_VDH
  36. ;        INCL_VDHVPIC
  37. ;        INCL_VDHALL
  38. ;        INCL_VDDHELPERS
  39. ;        INCL_VDHVKBD
  40. ;        INCL_VDHVLPT
  41. ;        INCL_VDHVDMA
  42. ;
  43. ;
  44. ;    MODIFICATION HISTORY
  45. ;    10/11/88    JTP         Created.
  46. ;    12/02/88    SB         Deleted VDMINFO include.
  47. ;    12/04/88    JTP         Moved MVDM-specific definitions to here.
  48. ;    02/15/96    MNH     148300     Merge VVIDEO DBCS-J (IBM J) source w/SBCS source
  49. ;
  50.  
  51.  
  52. ifndef INCL_NONE
  53. INCL_DEF    EQU 1
  54. INCL_TYPES    EQU 1
  55. INCL_MVDMTYPES    EQU 1
  56. INCL_SSTODS    EQU 1
  57. INCL_ROMBIOS    EQU 1
  58. INCL_PAGE    EQU 1
  59. INCL_VDHALL    EQU 1
  60. INCL_VDDHELPERS        EQU 1
  61. INCL_VDHVKBD    EQU 1
  62. INCL_VDHVLPT    EQU 1
  63. INCL_VDHVDMA    EQU 1
  64. endif
  65.  
  66. ifdef  INCL_VDHALL           ;if all VDH services, set defines
  67. INCL_VDH    EQU 1
  68. INCL_VDHVPIC    EQU 1
  69. INCL_VDHVKBD    EQU 1
  70. INCL_VDHVLPT    EQU 1
  71. INCL_VDHVDMA    EQU 1
  72. endif
  73.  
  74. ifdef  INCL_VDH               ;VDH services require MVDM types
  75. INCL_MVDMTYPES    EQU 1
  76. endif
  77.  
  78. ifdef  INCL_VDHVPIC           ;VDH services require MVDM types
  79. INCL_MVDMTYPES    EQU 1
  80. endif
  81.  
  82. ifdef  INCL_VDHVKBD           ;VDH services require MVDM types
  83. INCL_MVDMTYPES    EQU 1
  84. endif
  85.  
  86. ifdef  INCL_VDHVLPT           ;VDH services require MVDM types
  87. INCL_MVDMTYPES    EQU 1
  88. endif
  89.  
  90. ifdef  INCL_VDHVDMA           ;VDH services require MVDM types
  91. INCL_MVDMTYPES    EQU 1
  92. endif
  93.  
  94. ifdef  INCL_MVDMTYPES           ;MVDM types depend on basic types
  95. INCL_TYPES    EQU 1
  96. endif
  97.  
  98. ifdef  INCL_TYPES           ;types depend on basemaca.inc macros
  99. INCL_DEF    EQU 1
  100. endif
  101.  
  102.  
  103. ;*** Required generic include files
  104. ;
  105.  
  106. include basemaca.inc          ;macros for MASM
  107.  
  108.     include    basedef.inc        ;basic OS/2 data types
  109.  
  110.  
  111. ;*** MVDM-specific equates (required for function prototypes)
  112. ;
  113.  
  114. DefEntry VDHENTRY PASCAL NEAR     ;to declare exported VDH services
  115. DefEntry HOOKENTRY PASCAL NEAR     ;to declare "hook" entry points
  116. DefEntry PDDENTRY PASCAL FAR32     ;to declare PDD and VDD entry points
  117. DefEntry VDDENTRY PASCAL FAR32 _loadds
  118.  
  119. VDDInit        EQU    <main>        ;kludge to force compiler to ref. __acrtused
  120.  
  121.  
  122. ;*** MVDM-specific macros
  123. ;
  124.  
  125.  
  126.  
  127. ifdef  INCL_VDDHELPERS
  128.  
  129. PRIVENTRY vdhSaveFlags        <VOID>       ;prototypes for helper externals
  130. PRIVENTRY vdhRestoreFlags        <ULONG>
  131. PRIVENTRY vdhInt3        <VOID>
  132. PRIVENTRY vdhXCHG        <PULONG, ULONG>
  133. PRIVENTRY vdhBTC        <PULONG, ULONG>
  134. PRIVENTRY vdhBTR        <PULONG, ULONG>
  135. PRIVENTRY vdhBTS        <PULONG, ULONG>
  136. PRIVENTRY vdhBSF        <ULONG>
  137. PRIVENTRY vdhBSR        <ULONG>
  138. PRIVENTRY vdhOutSB        <PORT, PBYTE, ULONG, BOOL>
  139. PRIVENTRY vdhFindToken        <PSZ>
  140. PRIVENTRY vdhCompareStr        <PSZ, PSZ, BOOL>
  141. PRIVENTRY vdhMoveMem        <PVOID, PVOID, _INT, _INT, UINT, BOOL>
  142.  
  143.  
  144. DISABLE macro            ;alias for CLI (similar to C)
  145.     cli
  146.     endm
  147.  
  148. ENABLE    macro            ;alias for STI (similar to C)
  149.     sti
  150.     endm
  151.  
  152. PUSHFLAGS macro            ;alias for PUSHF
  153.     pushf
  154.     endm
  155.  
  156. POPFLAGS macro            ;alias for POPF
  157.     popf
  158.     endm
  159.  
  160. INT3    macro            ;alias for _INT 3
  161.     int 3
  162.     endm
  163.  
  164. INB    macro    ral,rdx        ;alias for IN AL,DX (also supports IN AH,DX)
  165.     ifidni    <ral>,<ah>
  166.       xchg      al,ah
  167.       in      al,rdx
  168.       xchg      al,ah
  169.     else
  170.       in      ral,rdx
  171.     endif
  172.     endm
  173.  
  174. INW    macro    rax,rdx        ;alias for IN AX,DX (provides support for IO8BIT)
  175.     IFNDEF IO8BIT
  176.     in    rax,rdx
  177.     ELSE
  178.     in    al,rdx
  179.     xchg    al,ah
  180.     inc    rdx
  181.     jmp    $+2
  182.     in    al,rdx
  183.     xchg    al,ah
  184.     dec    rdx
  185.     ENDIF
  186.     endm
  187.  
  188. OUTB    macro    rdx,ral        ;alias for OUT DX,AL (also supports OUT DX,AH)
  189.     ifidni    <ral>,<ah>
  190.       xchg      al,ah
  191.       out      rdx,al
  192.       xchg      al,ah
  193.     else
  194.       out      rdx,ral
  195.     endif
  196.     endm
  197.  
  198. OUTW    macro    rdx,rax        ;alias for OUT DX,AX (provides support for IO8BIT)
  199.     IFNDEF IO8BIT
  200.     out    rdx,rax
  201.     ELSE
  202.     out    rdx,al
  203.     xchg    al,ah
  204.     inc    rdx
  205.     jmp    $+2
  206.     out    rdx,al
  207.     xchg    al,ah
  208.     dec    rdx
  209.     ENDIF
  210.     endm
  211.  
  212. endif  ;INCL_VDDHELPERS
  213.  
  214.  
  215. ;*** MVDM-specific types
  216. ;
  217.  
  218. ifdef  INCL_MVDMTYPES
  219.  
  220. DefType PVDM,PVOID            ;linear pointer into VDM      ;pvdm
  221.  
  222. DefType PBVDM,PBYTE            ;same as PVDM, but often needs less casting
  223.  
  224. DefType VBREG,_BYTE            ;virtual byte register          ;vb
  225.  
  226. endif  ;INCL_MVDMTYPES
  227.  
  228.  
  229. ;*** MVDM-specific include files
  230. ;
  231.  
  232. ifdef  INCL_VDH
  233.     include    vdmprop.inc        ;DOS property services
  234.     include    vdmm.inc        ;VDM Manager services
  235.     include    v8086.inc        ;8086 emulation services
  236.     include    vdos.inc        ;DOS emulation services
  237. endif
  238.  
  239. ifdef  INCL_VDHVPIC
  240.     include    vpic.inc        ;VPIC services
  241. endif
  242.  
  243. ifdef  INCL_VDHVKBD
  244.     include    vkbd.inc        ;VKBD services
  245. endif
  246.  
  247. ifdef  INCL_VDHVLPT
  248.     include    vlpt.inc        ;VLPT services
  249. endif
  250.  
  251. ifdef  INCL_VDHVDMA
  252.     include    vdma.inc        ;VDMA services
  253. endif
  254.  
  255. ifdef  INCL_ROMBIOS           ;ROM BIOS Data Area definitions
  256.     include    vdmbios.inc
  257. endif
  258.  
  259. ifdef  INCL_MI               ;machine instructions
  260. DefType _t,db            ;BUGBUG 22-Feb-89 JeffPar:
  261. DefType _t,dw             MI.INC needs to be fixed!!!
  262. DefType _t,dd
  263.  
  264.     include    mi.inc
  265. endif
  266.