Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Programmers Reference 0.02b - <b>int 24h (36) critical-error handler address</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 24h (36)             Critical-Error Handler Address

    Contains the address to which control is passed in response to a
    "critical" (usually hardware) error. When a program is executed, DOS
    copies this address into offset 12h through 15h of the Program Segment
    Prefix.

    When the critical error handling routine is invoked, the following
    diagnostic information is available:

     1.  Bit 7 of AH is clear if the error is related to a disk operation.
         If bit 7 of AH is set, it usually means the error is not a disk
         error (although an error in a disk's FAT can still result in bit
         7 of AH being set).

     2.  If Bit 7 of AH is clear, AL returns the disk drive ID number
         (0=A, 1=B, etc.), and bits 0 through 2 of AH provide further
         information, as follows:

               Bit 2 1 0
                   . . 0     Read error
                   . . 1     Write error
                   0 0 .     Error involving DOS system files
                   0 1 .     Error involving the FAT

     3.  BP:SI point to a device header control block.

     4.  The low-order byte of DI provides the following information

          DI       Meaning
              00h      Attempt to write on write-protected diskette
              01h      Unknown unit
              02h      Drive not ready
              03h      Unknown command
              04h      Data error (CRC)
              05h      Bad request structure length
              06h      Seek error
              07h      Media format not recognized
              08h      Sector not found
              09h      Printer out of paper
              0Ah      Write error
              0Bh      Read error
              0Ch      General, nonspecific error

     5.  The stack contains the complete register set of the program that
         issued the DOS function call that ended in the critical error. To
         retrieve this information, first perform the following
         instructions:

              PUSH     BP
              MOV      BP,SP

         The stack will then be structured as follows:

          BP offset     Stack contents
             00h        BP value that you PUSHed
             02h        IP:CS nded in the critical error. To
         retrieve this information, first perform the following
         instructions:

              PUSH     BP
              MOV      BP,SP

         The stack will then be structured as follows:

          BP offset     Stack contents
             00h        BP value that you PUSHed
             02h        IP:CS of DOS service invoking critical error handler
             06h        Flags of DOS service invoking critical error handler
             08h        AX of program invoking DOS service
             0Ah        BX of program invoking DOS service
             0Ch        CX of program invoking DOS service
             0Eh        DX of program invoking DOS service
             10h        SI of program invoking DOS service
             12h        DI of program invoking DOS service
             14h        BP of program invoking DOS service
             16h        DS of program invoking DOS service
             18h        ES of program invoking DOS service
             1Ah        IP:CS of program invoking DOS service
             1Eh        Flags of program invoking DOS service

    In reporting the condition to your program's user, do not use DOS
    function calls above 0Ch. Doing so will destroy DOS's internal stack
    and result in unpredictable behavior.

    On exit from your error-handling routine, DOS will look for an return
    code in AL and behave as follows:

              AL        DOS action
              0         Ignore the error
              1         Retry the operation

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson