home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / INTEXEC.ZIP / INTEXEC.ASM next >
Encoding:
Assembly Source File  |  1997-02-19  |  1.8 KB  |  56 lines

  1. ;****************************************************************************
  2. ;Version Number         :       1.01a
  3. ;Assembler & Version    :       MASM 6.11, LINK 5.60.399
  4. ;Brief Description      :       This file contains the assembly routine
  5. ;                       :       EXECUTE which takes the INT No. as one of the
  6. ;                       :       input parameters and executes that particular
  7. ;                       :       interrupt.It is capable of executing any
  8. ;                       :       interrupt passed to it with other input
  9. ;                       :       register values.
  10. ;****************************************************************************
  11.  
  12. .model small,C
  13.  
  14. .data
  15.         str db 0CDh,?,0CBh
  16. .code
  17.  
  18. PUBLIC execute
  19.  
  20. ;****************************************************************************
  21. ;Register Usage         :       All Registers are destroyed
  22. ;Brief Description      :       The routine takes the Interrupt no. to be
  23. ;                       :       executed along with the register values and
  24. ;                       :       executes that interrupt.
  25. ;****************************************************************************
  26.  
  27. execute PROC NEAR INTNO: BYTE, AXVAL: WORD, BXVAL: WORD, CXVAL: WORD,
  28. DXVAL: WORD, FLAGVAL: WORD
  29.  
  30.         mov ax,@data
  31.         mov ds,ax
  32.  
  33. ;The catch is here!!
  34.         mov ah,INTNO
  35.         mov ds:[str+1],ah
  36.  
  37.         mov    ax,AXVAL         ;Initialize AX
  38.         mov    bx,BXVAL         ;Initialize BX 
  39.         mov    cx,CXVAL         ;Initialize CX
  40.         mov    dx,DXVAL         ;Initialize DX
  41.  
  42.         push    ax
  43.         mov     ax,FLAGVAL      ;Initialize Flags
  44.         push    ax
  45.         popf
  46.         pop     ax
  47.  
  48. ;And finally call it!!
  49.         
  50.         call far ptr ds:[str]
  51.  
  52.         ret
  53. execute ENDP
  54.  
  55. END
  56.