home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / VARIOUS / GETVECT.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-20  |  1.8 KB  |  58 lines

  1. ;****************************************************************************
  2. ; Filename: GETVECT.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1995.03.13
  6. ;  Updated: -
  7. ;****************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;****************************************************************************
  11. ; Function: VOID @getvect(ULONG i,PIRQVECT v);
  12. ;  Comment: Gets a interrupt vector
  13. ;    Input: Eax, i - interrupt number (0-255)
  14. ;           Edx, v - pointer to 6 bytes holding the interrupt vector
  15. ;                    with a 32bit offset followed by the 16bit selector.
  16. ;   Output: nothing
  17. ;****************************************************************************
  18. ; Function: void * @_getfarptr(void * near_address, char mode);
  19. ;  Comment: Gets a far pointer of a procedure or data varible.
  20. ;    Input: Eax, pointer to procedure or data varible.
  21. ;           Dl,  Type of far pointer returned. If zero then the selector
  22. ;          will be set to the code segment. If non-zero then it's
  23. ;          to the programs data segment.
  24. ;   Output: a temperary pointer to a 6 byte array containing the 32bit
  25. ;           far pointer.
  26. ;****************************************************************************
  27.  
  28.     Include STDDEF.INC
  29.  
  30.     Codeseg
  31.  
  32. Proc    getvect ,2
  33.         Push    Edx
  34.         Mov    Bl,Al
  35.         Mov    Ax,204h
  36.         Int    31h
  37.         Pop    Eax
  38.         Mov    [Eax],Edx
  39.         Mov    [Eax+4],Cx
  40.         Ret
  41. Endp
  42.  
  43. Proc    @_getfarptr
  44.                 Mov     Cx,CS
  45.                 TestZ   Dl
  46.                 Jz @@code
  47.                Mov    Cx,DS
  48. @@code:         Mov     [TempFarPointer+4],Ecx
  49.                 Mov     [TempFarPointer],Eax
  50.                 Mov     Eax,Offset TempFarPointer
  51.                 Ret
  52. Align 4
  53. TempFarPointer  DD ?,?
  54.  
  55. Endp    
  56.  
  57.     End
  58.