Program That Returns the Address of an Interrupt Vector (43568)



The information in this article applies to:

  • Microsoft QuickBASIC 3.0
  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q43568

SUMMARY

The QuickBasic program below will return the address of the interrupt vector whose number you input. This program operates correctly with Microsoft QuickBasic Versions 3.00, 4.00, 4.00b, and 4.50, the Microsoft Basic compiler Versions 6.00 and 6.00b, and the Microsoft Basic PDS Version 7.00.

MORE INFORMATION

'Program GETVECTR.BAS looks in low memory to get the address of
'any interrupt vector that you input.

'Program GETVECTR.BAS looks in low memory to get the address of
'any interrupt vector that you input.

DEFINT A-Z
DEF SEG = 0
CLS
VIEW PRINT 25 TO 25
COLOR 15, 1
PRINT
LOCATE 25, 30
PRINT "Ctrl-Break to EXIT";
VIEW PRINT 1 TO 1
PRINT
LOCATE 1, 34
PRINT "GETVECTOR";

   VIEW PRINT 9 TO 15
   COLOR 0, 7
   PRINT : PRINT : PRINT : PRINT : PRINT : PRINT : PRINT

DO
  PRINT "  Enter the Number of the Interrupt. Use &H to specify a "
  PRINT "  Hex Number (such as &H5 for Interrupt 5 Hex)"
   PRINT
   INPUT "  Interrupt ", intnum
   offset = 4 * intnum
   byte1$ = HEX$(PEEK(offset))
   byte2$ = HEX$(PEEK(offset + 1))
   byte3$ = HEX$(PEEK(offset + 2))
   byte4$ = HEX$(PEEK(offset + 3))
   vector$ = byte4$ + " " + byte3$ + " : " + byte2$ + " " + byte1$
   LOCATE 13, 1
   PRINT SPACE$(40)
   LOCATE 13, 1
   PRINT "Handler for Interrupt      "; HEX$(intnum) + " Hex"
   PRINT "is located at address -->  "; vector$
   PRINT
LOOP
DEF SEG
CLS
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB43568