home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / DOS32V3B / LIB / V24.ASM < prev    next >
Assembly Source File  |  1995-03-10  |  3KB  |  118 lines

  1. ;--------------------------------------------------------------------------
  2. ;--------------------------------------------------------------------------
  3. ;--------------------------------------------------------------------------
  4. ;--------------------------------------------------------------------------
  5. ;
  6. ;  DOS32 V2.4  routines for using V2.4 code with DOS32 v3.0.
  7. ;
  8. ;
  9. ;--------------------------------------------------------------------------
  10. ;--------------------------------------------------------------------------
  11. ;--------------------------------------------------------------------------
  12. .386
  13. .model flat, pascal
  14. .stack 8000h
  15. .code
  16.  
  17. IFDEF masm                                         ; Allow MASM assembly
  18. global  EQU  externdef
  19. ENDIF
  20.  
  21. INCLUDE     V24.INC                          ; Define all publics and externs
  22.  
  23. GetIRQVector    PROC Uses EAX EBX
  24.                 and     bl,0fh
  25.                 cmp     bl,8
  26.                 jb  J2
  27.                 add     bl,60h
  28. J2:             add     bl,8h
  29.                 mov     ax,204h
  30.                 int     31h
  31.                 ret
  32. GetIRQVector    ENDP
  33.  
  34. SetIRQVector    PROC Uses EAX EBX
  35.                 and     bl,0fh
  36.                 cmp     bl,8
  37.                 jb  J1
  38.                 add     bl,60h
  39. J1:             add     bl,8h
  40.                 mov     ax,205h
  41.                 int     31h
  42.                 ret
  43. SetIRQVector    ENDP
  44.  
  45. GetIntVector    PROC Uses EAX
  46.                 mov     ax,204h
  47.                 int     31h
  48.                 ret
  49. GetIntVector    ENDP
  50.  
  51. SetIntVector    PROC Uses EAX
  52.                 mov     ax,205h
  53.                 int     31h
  54.                 ret
  55. SetIntVector    ENDP
  56.  
  57. AllocDMAregion PROC Uses EAX
  58.                 mov     ax,0EE41h
  59.                 int     31h
  60.                 ret
  61. AllocDMAregion ENDP
  62.  
  63. Allocate_Memory PROC
  64.                 mov     ax,0EE42h
  65.                 int     31h
  66.                 ret
  67. Allocate_Memory ENDP
  68.  
  69. align 4
  70. CODE32_sel              DW  ?           ; Selector
  71. DATA32_sel              DW  ?           ; Selector
  72. Zero_sel                DW  ?              ; Selector
  73. PIC1_Base               DB  8           ; IRQ 0..7
  74. PIC2_Base               DB  70h         ; IRQ 0..7
  75. Environment_segment     DW  ?           ; real mode segment
  76. Environment_addr        DD  ?          ; 32bit offset
  77. PSP_segment             DW  ?           ; real mode segment
  78. PSP_addr                DD  ?           ; 32bit offset
  79. _0b8000h                DD  0b8000h     ; 32bit offset
  80. _0a0000h                DD  0a0000h     ; 32bit offset
  81. CODE32_addr             DD  ?              ; 32bit offset
  82. Zero_Addr               DD  ?              ; 32bit offset
  83.  
  84.  
  85.  
  86.  
  87. _the_start:
  88.  
  89.         mov     ax,0EE00h
  90.         int     31h
  91.         mov     Zero_sel,bx
  92.         mov     CODE32_sel,cs
  93.         mov     DATA32_sel,ds
  94.  
  95.         mov     ax,0EE02h
  96.         int     31h
  97.  
  98.         mov     CODE32_addr,ebx
  99.         neg     ebx
  100.         mov     Zero_Addr,ebx
  101.         add     _0a0000h,ebx
  102.         add     _0b8000h,ebx
  103.  
  104.         mov     PSP_addr, esi
  105.         sub     esi,ebx
  106.         shr     esi,4
  107.         mov     PSP_segment,si
  108.  
  109.         mov    Environment_addr, edi
  110.         sub     edi,ebx
  111.         shr     edi,4
  112.         mov     Environment_segment,di
  113.  
  114.         jmp Start32
  115.  
  116.  
  117. END _the_start
  118.