home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / GESEIVEC.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  1.7 KB  |  87 lines

  1. ;/*
  2. ;** geseivec.asm
  3. ;** contains: getivect(), setivect()
  4. ;*/
  5.  
  6. SETVECTOR    equ    025h            ;DOS: Set contents of interrupt vector
  7. GETVECTOR    equ    035h            ;DOS: Get contents of interrupt vector
  8. DOSCALL     equ    021h            ;Interface with DOS here
  9.  
  10.         include model.h
  11.         include prologue.h
  12.  
  13.         pseg    pGetSetIvec
  14.  
  15. ;/*
  16. ;**
  17. ;** void (far* GF_CDECL getivect(unsigned vectnumber))();
  18. ;**
  19. ;** ARGUMENT(s)
  20. ;**    vectnumber    -    Interrupt number to retrieve
  21. ;**
  22. ;** DESCRIPTION
  23. ;**  Get contents of Interrupt vector.
  24. ;**
  25. ;** RETURNS
  26. ;**  32 bit (far) pointer of value found at vectnumber.
  27. ;**
  28. ;** AUTHOR
  29. ;**  ""   Tue 15-Nov-1988    11:33:09
  30. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  31. ;**
  32. ;** MODIFICATIONS
  33. ;**
  34. ;*/
  35.         cproc    getivect
  36.         push    es
  37.         mov    al,parm1_        ;AL=interrupt number
  38.         mov    ah,GETVECTOR
  39.         int    DOSCALL
  40.         ifdef    AXBX32
  41.          mov    ax,es            ;AX=segment (bx already has offset)
  42.         else
  43.          mov    dx,es            ;DX=segment
  44.          mov    ax,bx            ;BX=offset
  45.         endif
  46.         pop    es
  47.         cproce
  48.  
  49.  
  50. ;/*
  51. ;**
  52. ;** void GF_CDECL setivect(unsigned vectnumber,void(far *newroutine)())
  53. ;**
  54. ;** ARGUMENT(s)
  55. ;**
  56. ;**
  57. ;**    newroutine    -    points to address (32bit) of new routine
  58. ;**                replacing the current handler.
  59. ;**    vectnumber    -    Interrupt number to set.
  60. ;**
  61. ;** DESCRIPTION
  62. ;**  Sets vector to point to new routine.
  63. ;**
  64. ;**
  65. ;** RETURNS
  66. ;**  void
  67. ;**
  68. ;** AUTHOR
  69. ;**  ""   Tue 15-Nov-1988    11:33:09
  70. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  71. ;**
  72. ;** MODIFICATIONS
  73. ;**
  74. ;*/
  75.         cproc    setivect
  76.         mov    al,parm1_        ;AL=vector to set
  77.         mov    ah,SETVECTOR
  78.         push    ds
  79.         lds    dx,parm2_        ;DS:DX point to new vector
  80.         int    DOSCALL
  81.         pop    ds
  82.         cproce
  83.  
  84.  
  85.         endps
  86.         end
  87.