home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / INTEXEC.ZIP / INTEXEC.DOC < prev    next >
Encoding:
Text File  |  1997-02-19  |  2.0 KB  |  95 lines

  1. A general purpose assembly routine to execute any real mode interrupt.
  2.  
  3. Warning: Be forewarned about the interrupt you are going to use.
  4.  
  5. Note: Only real mode stuff.
  6.  
  7.  
  8. Contents:
  9.  
  10. INTEXEC.ZIP contains four files:
  11.         1) INTEXEC.ASM
  12.         2) SAMPLE.CPP
  13.         3) SAMPLE.EXE
  14.         4) INTEXEC.DOC
  15.  
  16. INTEXEC.ASM
  17.  
  18.         This file contains the assembly routine which takes the values for the
  19.         interrupt number, ax,bx,cx,dx and register number as input parameters and
  20.         executes the given interrupt.
  21.  
  22. SAMPLE.CPP
  23.  
  24.         This file contains a probable situation where the above assembly
  25.         routine may be used to execute the routine in the ASSEMBLY WAY.
  26.  
  27. SAMPLE.EXE
  28.  
  29.         This file is the executable.
  30.  
  31. INTEXEC.DOC
  32.  
  33.         This file contains a brief help.
  34.  
  35.  
  36. Brief Description:
  37.  
  38. Everyone of us know about the assembly language instruction INT.
  39. For example if you need to call Interrupt 16H Service 00H (Wait for a key)
  40. your assembly code might show up something like this:
  41.  
  42. .
  43. .
  44. .
  45. whatever
  46. .
  47. .
  48. mov     ah,00h
  49. int     16H
  50. .
  51. .
  52. .
  53. whatever
  54. .
  55. .
  56.  
  57. So far good. But what about if you do not know which interrupt to execute
  58. at assembly time ie Interrupt to execute is determined only at run time?
  59.  
  60.         mov ah,00h
  61.         int intno
  62.  
  63. is what comes to mind? But unfortunately most assemblers do not take this!
  64.  
  65. So what is the way out?
  66.  
  67. INTEXEC.ASM does exactly this in 'Assembly way'. There are C ways of doing
  68. this ie using int86 and it's variants.
  69.  
  70. The basic concept of this is as follows:
  71.  
  72. INT XX instruction is decoded by INTEL processors as follows:
  73.  
  74.         CD XX
  75.  
  76. This is a very useful information.
  77.  
  78. Just set up all your register values at run time and do a jmp to the above
  79. instruction. That's all it takes. 
  80.  
  81.  
  82. To build the executable sample.exe:
  83.  
  84. 1) cl -c sample.cpp
  85. 2) masm intexec.asm
  86. 3) link sample+intexec;
  87.  
  88. I have used MASM 6.11, and  LINK 5.60.399 to create the executable.
  89.  
  90.  
  91.  
  92. Please feel free to contact me at:
  93.  
  94. saxena@wipsys.soft.net
  95.