home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_02 / 2n02009a < prev    next >
Text File  |  1991-01-22  |  970b  |  34 lines

  1. ; a typical real-mode universal software interrupt
  2.  
  3. ;   intno    bp+6                           the interrupt to be executed
  4. ;   regs     bp+8         (offset)          pointer to structure containing
  5. ;            bp+0ah       (segment)         register values
  6.  
  7. ;   alias_cs       initialized to 0
  8.  
  9. pubproc   typical_int86 <intno, regs>
  10. ;
  11. ;   save the registers that need to be saved here
  12. ;
  13.       
  14. ;   modify the doint procedure
  15.  
  16. mov   ax, [bp].intno           ; get interrupt #
  17. mov   bx, offset doint         ; get the address of the int instruction
  18. mov   cs: [bx+1], al           ; write the new interrupt number into
  19.                                ; the code right after the int instruction
  20. ;
  21. ;   load the registers from the regs structure
  22. ;
  23. call   near ptr doint         ; call the modified interrupt routine
  24. ;
  25. ;   save the registers back into the regs structure
  26. ;
  27. ret
  28. endproc typical_int86
  29.  
  30. doint proc near
  31. int   10h
  32. ret
  33. doint endp
  34.