#include #include #include #include int main(void) { unsigned long far* ptrIVT = (unsigned long far*)0x00000000; unsigned int uiSegment; unsigned int uiOffset; int iCount; FILE* oFile = fopen("IVT.txt", "wt"); if (oFile == NULL) { clrscr(); printf("Error : Unable to create IVT.txt file."); printf("Press any key to exit."); getch(); exit(1); } fprintf(oFile, "Interrupt Number ---> Vector (Segment:Offset)\n"); fprintf(oFile, " ( Hex ) ( Hex ) \n\n"); for (iCount = 0; iCount < 256; iCount++) { uiSegment = FP_SEG(*ptrIVT); uiOffset = FP_OFF(*ptrIVT); fprintf(oFile, " INT 0x%02X ---> %4X : %X \n", iCount, uiSegment, uiOffset); ptrIVT++; } fclose(oFile); return 0; }