Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Ralf Brown's Interrupt List (Part 1,2) - int 21 - dos 3.0+ internal - get address of dos swappable data area http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 21 - DOS 3.0+ internal - GET ADDRESS OF DOS SWAPPABLE DATA AREA
        AX = 5D06h
Return: CF set on error
           AX = error code (see AH=59h)
        CF clear if successful
            DS:SI -> nonreentrant data area (includes all three DOS stacks)
                (critical error flag is first byte)
            CX = size in bytes of area which must be swapped while in DOS
            DX = size in bytes of area which must always be swapped
Notes:  the Critical Error flag is used in conjunction with the InDOS flag
          (see AH=34h) to determine when it is safe to enter DOS from a TSR
        setting CritErr flag allows use of functions 50h/51h from INT 28h under
          DOS 2.x by forcing use of correct stack
        swapping the data area allows reentering DOS unless DOS is in a
          critical section delimited by INT 2A/AH=80h and INT 2A/AH=81h,82h
        under DOS 4.0, AX=5D0Bh should be used instead of this function
SeeAlso: AX=5D0Bh, INT 2A/AH=80h,81h,82h

Format of DOS 3.10-3.30 Swappable Data Area:
Offset  Size    Description
 00h    BYTE    critical error flag
 01h    BYTE    InDOS flag (count of active INT 21 calls)
 02h    BYTE    drive on which current critical error occurred, or FFh
 03h    BYTE    locus of last error
 04h    WORD    extended error code of last error
 06h    BYTE    suggested action for last error
 07h    BYTE    class of last error
 08h    DWORD   ES:DI pointer for last error
 0Ch    DWORD   current DTA
 10h    WORD    current PSP
 12h    WORD    stores SP across an INT 23
 14h    WORD    return code from last process termination (zerod after reading
                with AH=4Dh)
 16h    BYTE    current drive
 17h    BYTE    extended break flag
---remainder need only be swapped if in DOS---
 18h    WORD    value of AX on call to INT 21
 1Ah    WORD    PSP segment for sharing/network
 1Ch    WORD    network machine number for sharing/network (0000h = us)
 1Eh    WORD    first usable memory block found when allocating memory
 20h    WORD    best usable memory block found when allocating memory
 22h    WORD    last usable memory block found when allocating memory
 24h    WORD    memory size in paragraphs (used only during initialization)
 26h    WORD    ???
 28h    BYTE    ???
 29h    BYTE    ???
 2Ah    BYTE    ???
 2Bh    BYTE    FFh if Ctrl-Break termination, 00h otherwise
 2Ch    BYTE    ??? flag of some kind
 2Dh    BYTE    ??? (doesn't seem to be referenced)
 2Eh    BYTE    day of month
 2Fh    BYTE    month
 30h    WORD    year - 1980
 32h    WORD    number of days since 1-1-1980
 34h    BYTE    day of week (0 = Sunday)
 35h    BYTE    ???
 36h    BYTE    ??? flag
 37h    BYTE    ??? flag
 38h 26 BYTEs   device driver request header
 52h    DWORD   pointer to device driver entry point (used in calling driver)
 56h 22 BYTEs   device driver request header
 6Ch 22 BYTEs   device driver request header
 82h    BYTE    type of PSP copy (00h=simple for INT 21/AH=26h, FFh=make child)
 83h    BYTE    ??? apparently not reference by kernel
 84h  3 BYTEs   24-bit user number (see AH=30h)
 87h    BYTE    OEM number (see AH=30h)
 88h  2 BYTEs   ???
 8Ah  6 BYTEs   CLOCK$ transfer record (see AH=52h)
 90h  2 BYTEs   ???
 92h 128 BYTEs  buffer for filename
112h 128 BYTEs  buffer for filename
192h 21 BYTEs   findfirst/findnext search data block (see AH=4Eh)
1A7h 32 BYTEs   directory entry for found file
1C7h 81 BYTEs   copy of current directory structure for drive being accessed
218h 11 BYTEs   ??? FCB-format filename
223h    BYTE    unused???
224h 11 BYTEs   wildcard destination specification for rename (FCB format)
22Fh  2 BYTEs   ???
231h    WORD    ???
233h  5 BYTEs   ???
238h    BYTE    directory search attributes
239h    BYTE    type of FCB (00h regular, FFh extended)
23Ah    BYTE    extended FCB file attribute
23Bh    BYTE    file open mode???
23Ch    BYTE    ??? flag bits
23Dh    BYTE    ??? flag or counter
23Eh    BYTE    ??? flag
23Fh    BYTE    flag indicating how DOS function was invoked
                (00h = direct INT 20/INT 21, FFh = server call AX=5D00h)
240h    WORD    ???
242h    BYTE    ???
243h    BYTE    ???
244h    BYTE    ???
245h    BYTE    ??? flag or counter
246h    BYTE    ??? flag
247h    BYTE    ??? flag
248h    BYTE    ??? flag
249h    BYTE    type of process termination (00h-03h) (see AH=4Dh)
24Ah    BYTE    ??? flag
24Bh    BYTE    value with which to replace first byte of deleted file's name
                (normally E5h, but 00h as described under INT 21/AH=13h)
24Ch    DWORD   pointer to Drive Parameter Block for critical error invocation
250h    DWORD   pointer to stack frame containing user registers on INT 21
254h    WORD    stores SP???
256h    DWORD   pointer to DOS Drive Parameter Block for ???
25Ah    WORD    ???
25Ch    WORD    ???
25Eh    WORD    ??? flag
260h    WORD    ???
262h    BYTE    Media ID byte returned by AH=1Bh,1Ch
263h    BYTE    ??? (doesn't seem to be referenced)
264h    DWORD   pointer to ???
268h    DWORD   pointer to current SFT
26Ch    DWORD   pointer to current directory structure for drive being accessed
270h    DWORD   pointer to caller's FCB
274h    WORD    ???
276h    WORD    temporary storage for file handle
278h    DWORD   pointer to a JFT entry in process handle table (see AH=26h)
27Ch    WORD    offset in DOS CS of first filename argument
27Eh    WORD    offset in DOS CS of second filename argument
280h    WORD    ???
282h    WORD    ???
284h    WORD    ???
286h    WORD    ???
288h    WORD    ???
28Ah    WORD    ???
28Ch    WORD    ???
28Eh  2 BYTEs   ???
290h    WORD    ???
292h    DWORD   current offset in file
296h    WORD    ???
298h    WORD    ???
29Ah    WORD    ???
29Ch    WORD    ???
29Eh    WORD    ???
2A0h    WORD    ???
2A2h    DWORD   number of bytes appended to file
2A6h    DWORD   pointer to ??? disk buffer
2AAh    DWORD   pointer to ??? SFT
2AEh    WORD    used by INT 21 dispatcher to store caller's BX
2B0h    WORD    used by INT 21 dispatcher to store caller's DS
2B2h    WORD    temporary storage while saving/restoring caller's registers
2B4h    DWORD   pointer to prev call frame (offset 250h) if INT 21 reentered
                also switched to for duration of INT 24
2B8h 21 BYTEs   FindFirst search data for source file(s) of a rename operation
                (see AH=4Eh)
2CDh 32 BYTEs   directory entry for file being renamed
2EDh 331 BYTEs  critical error stack
438h 384 BYTEs  disk stack (functions greater than 0Ch, INT 25, INT 26)
5B8h 384 BYTEs  character I/O stack (functions 01h through 0Ch)
---DOS 3.3 only---
738h    BYTE    flag affecting AH=08h (see AH=64h)
739h    BYTE    ??? looks like a drive number
73Ah    BYTE    ??? flag of some kind
73Ah    BYTE    ???

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