' INTLIST.BAS - Interrupt Vector List ' Written by Zsolt Nagy-Perge in March 2017. ' ' This QBASIC program saves the interrupt vector list ' located at 0000:0000 in a file called INT.DAT. ' If INT.DAT already exists in the current directory, then ' instead of saving the vector list, the program compares ' the vectors in the memory against the file ' and displays the differences in green. ' ' Note: QBASIC.EXE will "hijack" several interrupts, so this ' BASIC program cannot display all the original addresses. ' ' Interrupts are like small "sub functions" in the memory ' which are designed to handle errors and special events ' such as keystrokes and mouse moves. Without interrupts, ' computers would not be able to function. ' DEFINT A-Z DECLARE FUNCTION XX$ (N) ' Converts integer N to a 2-digit hex string SCREEN 0 COLOR 7, 0 CLS DIM X AS STRING * 1 OPEN "INTLIST.DAT" FOR BINARY AS #1 IF LOF(1) = 1024 THEN GOTO SkipWrite ' Save interrupt vectors to a file. FOR I = 1 TO 1024 DEF SEG = 0 X = CHR$(PEEK(I - 1)) PUT #1, I, X NEXT I SkipWrite: LOCATE 3, 4 PRINT "INTERRUPT VECTOR LIST" + CHR$(13) DIM D(0 TO 3) FOR I = 0 TO 255 ' Read 4 bytes from file and from memory and compare the two. DIFF = 0 PTR = I * 4 FOR J = 0 TO 3 GET #1, PTR + J + 1, X DEF SEG = 0 D(J) = PEEK(PTR + J) IF NOT D(J) = ASC(X) THEN DIFF = 1 NEXT J IF DIFF THEN COLOR 10 ELSE COLOR 7 IF I < 129 THEN READ I, N$ ELSE N$ = "Reserved" PRINT " INT "; XX$(I); " -> "; XX$(D(3)); XX$(D(2)); ":"; XX$(D(1)); XX$(D(0)), N$ SLEEP 1 NEXT I SYSTEM DATA 0, "Divide by Zero Error Handler" DATA 1, "Debugger Single-Step" DATA 2, "Non-Maskable Interrupt (NMI)" DATA 3, "Debugger Breakpoint" DATA 4, "Overflow Error Handler" DATA 5, "BIOS Print Screen Sys Call" DATA 6, "Invalid Opcode Error Handler" DATA 7, "Coprocessor Emulator" DATA 8, "(IRQ0) BIOS System Timer" DATA 9, "(IRQ1) BIOS Keyboard Data Ready" DATA 10, "(IRQ2) BIOS Vertical Retrace" DATA 11, "(IRQ3) BIOS COM2" DATA 12, "(IRQ4) BIOS COM1" DATA 13, "(IRQ5) BIOS Hard Disk Controller" DATA 14, "(IRQ6) BIOS Floppy Disk Controller" DATA 15, "(IRQ7) BIOS LPT1" DATA 16, "BIOS Video I/O Sys Call" DATA 17, "BIOS Get Equipment List" DATA 18, "BIOS Get Memory Size" DATA 19, "BIOS Disk Drive I/O Sys Call" DATA 20, "BIOS Serial Port I/O Sys Call" DATA 21, "Undocumented DOS Sys Call" DATA 22, "BIOS Keyboard I/O Sys Call" DATA 23, "BIOS Printer I/O Sys Call" DATA 24, "BIOS Diskless Boot Hook" DATA 25, "BIOS Bootstrap Loader" DATA 26, "Reserved for PCI" DATA 27, "BIOS Ctrl+Break Event Handler" DATA 28, "System Timer Hook" DATA 29, "System Data - Video Parameter Tables" DATA 30, "System Data - Diskette Parameters" DATA 31, "System Data - 8x8 Graphics Font" DATA 32, "DOS Terminate Program Sys Call" DATA 33, "DOS System Calls" DATA 34, "DOS Program Termination Address" DATA 35, "DOS Ctrl+Break Handler" DATA 36, "DOS Critical Error Handler" DATA 37, "DOS Absolute Disk Read Sys Call" DATA 38, "DOS Absolute Disk Write Sys Call" DATA 39, "DOS Terminate and Stay Resident Sys Call" DATA 40, "DOS System Idle Loop" DATA 41, "DOS Fast Console Output" DATA 42, "DOS Network I/O Sys Calls" DATA 43, "DOS Reserved" DATA 44, "DOS Reserved" DATA 45, "DOS Reserved" DATA 46, "DOS Shell Command / Windows NT API Sys Calls" DATA 47, "DOS Multiplex" DATA 48, "DOS Internal Far Jump" DATA 49, "DPMI Memory Manager Sys Calls" DATA 50, "DOS Reserved" DATA 51, "Mouse Driver Sys Calls" DATA 52, "Float Point Emulation - Opcode D8" DATA 53, "Float Point Emulation - Opcode D9" DATA 54, "Float Point Emulation - Opcode DA" DATA 55, "Float Point Emulation - Opcode DB" DATA 56, "Float Point Emulation - Opcode DC" DATA 57, "Float Point Emulation - Opcode DD" DATA 58, "Float Point Emulation - Opcode DE" DATA 59, "Float Point Emulation - Opcode DF" DATA 60, "Float Point Emulation - Segment Override" DATA 61, "Float Point Emulation - FWAIT" DATA 62, "Float Point Emulation" DATA 63, "Microsoft Overlay Manager" DATA 64, "BIOS Diskette Handler" DATA 65, "BIOS System Data - Hard Disk 0 Parameter Table" DATA 66, "BIOS INT 10 Video Services" DATA 67, "BIOS Video Data - Font Table" DATA 68, "BIOS Video Data - Font Table" DATA 69, "BIOS Reserved" DATA 70, "BIOS System Data - Hard Disk 1 Parameter Table" DATA 71, "BIOS Reserved" DATA 72, "BIOS Reserved" DATA 73, "BIOS Reserved" DATA 74, "BIOS System User Alarm Handler" DATA 75, "BIOS Reserved" DATA 76, "BIOS Reserved" DATA 77, "BIOS Reserved" DATA 78, "BIOS Reserved" DATA 79, "BIOS Reserved" DATA 80, "BIOS Reserved" DATA 81, "BIOS Reserved" DATA 82, "BIOS Reserved" DATA 83, "BIOS Reserved" DATA 84, "BIOS Reserved" DATA 85, "BIOS Reserved" DATA 86, "BIOS Reserved" DATA 87, "BIOS Reserved" DATA 88, "BIOS Reserved" DATA 89, "BIOS Reserved" DATA 90, "BIOS Reserved" DATA 91, "BIOS Reserved" DATA 92, "NetBIOS Interface" DATA 93, "BIOS Reserved" DATA 94, "BIOS Reserved" DATA 95, "BIOS Reserved" DATA 96, "BIOS Reserved" DATA 97, "BIOS Reserved" DATA 98, "BIOS Reserved" DATA 99, "BIOS Reserved" DATA 100, "BIOS Reserved" DATA 101, "BIOS Reserved" DATA 102, "BIOS Reserved" DATA 103, "BIOS Reserved" DATA 104, "BIOS Reserved" DATA 105, "BIOS Reserved" DATA 106, "BIOS Reserved" DATA 107, "BIOS Reserved" DATA 108, "System Resume Vector" DATA 109, "BIOS Video Entry Point" DATA 110, "(IRQ8) CMOS Real-Time Clock" DATA 111, "(IRQ9) Redirected to INT 0A by BIOS" DATA 112, "(IRQ10) Reserved" DATA 113, "(IRQ11) Reserved" DATA 114, "(IRQ12) Pointing Device" DATA 115, "(IRQ13) Coprocessor Exception" DATA 116, "(IRQ14) Hard Disk Controller Operation Complete" DATA 117, "(IRQ15) Secondary IDE Controller Operation Complete" DATA 118, "DJGPP DOS Extender API Sys Calls" DATA 119, "Reserved" DATA 120, "Reserved" DATA 121, "Reserved" DATA 122, "Reserved" DATA 123, "Reserved" DATA 124, "Reserved" DATA 125, "Reserved" DATA 126, "Reserved" DATA 127, "Reserved" DATA 128, "Linux Kernel Sys Calls" ' Converts integer N to a 2-byte hex string. FUNCTION XX$ (N) IF N < 1 THEN XX$ = "00": EXIT FUNCTION IF N > 254 THEN XX$ = "FF": EXIT FUNCTION IF N > 15 THEN XX$ = HEX$(N): EXIT FUNCTION XX$ = "0" + HEX$(N) END FUNCTION