Interrups | Categories | Contents |
AX = 5D06h
Return:
CF set on error AX = error code (see #01680) CF clear if successful DS:SI -> nonreentrant data area (includes all three DOS stacks) (critical error flag is first byte) (see #01687) 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. SHARE and other DOS utilities consult the byte at offset 04h in the DOS data segment (see INT 2F/AX=1203h) to determine the SDA format
in use:
00h = DOS 3.x, 01h = DOS 4.0-6.0, other = error.. DR DOS 3.41+ supports this function, but the SDA format beyond the first 18h bytes is completely different from MS-DOS
BUG: Calling this function with certain values in DX crashes Novell DOS 7.0 prior to Update 14
See Also:
AX=5D0Bh - INT 2A/AH=80h - INT 2A/AH=81h - INT
Format of DOS 3.10-3.30 Swappable Data Area:
Offset Size Description (Table 01687)
-34 BYTE (DOS 3.10+) printer echo flag (00h off, FFh active)
-31 BYTE (DOS 3.30) current switch character
-30 BYTE current memory allocation strategy (see AH=58h)
-28 BYTE (DOS 3.30) incremented on each INT 21/AX=5E01h call
-27 16 BYTEs (DOS 3.30) machine name set by INT 21/AX=5E01h
-11 5 WORDs zero-terminated list of offsets which need to be patched to
enable critical-section calls (see INT 2A/AH=80h)
-1 BYTE unused padding
---start of actual SDA---
00h BYTE critical error flag ("ErrorMode")
01h BYTE InDOS flag (count of active INT 21 calls)
02h BYTE drive on which current critical error occurred, or FFh
(DR DOS sets to drive number during INT 24, 00h otherwise)
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 (Disk Transfer Address)
note:
May point into SDA during the DOS EXEC function
(see AH=4Bh), so programs which swap the SDA must be
prepared to move the DTA to a private buffer if they
might be invoked during an EXEC
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 last entry checked during directory search
28h BYTE flag: 29h BYTE flags: 2Bh BYTE flag: 2Ch BYTE flag: 35h BYTE flag: 36h BYTE flag: 37h BYTE flag: bit 0: bit 4: 23Dh BYTE flag: 241h BYTE flag: 242h BYTE flag: 245h BYTE flag: temp: 25Ch WORD temp: 286h WORD temp: 296h DWORD temp: 29Ah WORD temp: 73Ah BYTE flag: Note:
The only fields which remain valid BETWEEN calls to INT 21h are those
in the initial "swap-always" portion of the SDA
See Also:
#01690
Format of CLOCK$ transfer record:
Offset Size Description (Table 01688)
00h WORD number of days since 1-Jan-1980
02h BYTE minutes
03h BYTE hours
04h BYTE hundredths of second
05h BYTE seconds
Category:
DOS Kernel
-
Int 21h
-
D
INT 24 returned Fail
Allowable INT 24 actions (passed to INT 24 in AH)
2Ah BYTE directory flag (00h directory, 01h file)
FFh if Ctrl-Break termination, 00h otherwise
Allow embedded blanks in FCB
2Dh BYTE padding (unused)
2Eh BYTE day of month
2Fh BYTE month
30h WORD year - 1980
32h WORD number of days since 01jan1980
34h BYTE day of week (0 = Sunday)
Console swapped during read from device
Safe to call INT 28 if nonzero
If nonzero, INT 24 Abort turned into INT 24 Fail
(set only during process termination)
38h 26 BYTEs device driver request header (see #02597 at INT 2F/AX=0802h)
52h DWORD pointer to device driver entry point (used in calling driver)
56h 22 BYTEs device driver request header for I/O calls
6Ch 14 BYTEs device driver request header for disk status check
7Ah DWORD pointer to device I/O buffer???
7Eh WORD ???
80h WORD ???
82h BYTE type of PSP copy (00h=simple for INT 21/AH=26h, FFh=make child)
83h BYTE padding (unused)
84h 3 BYTEs 24-bit user number (see AH=30h)
87h BYTE OEM number (see #01394 at AH=30h)
88h WORD offset to error code conversion table for INT 25/INT 26
8Ah 6 BYTEs CLOCK$ transfer record (see #01688)
90h BYTE device I/O buffer for single-byte I/O functions
91h BYTE padding??? (unused)
92h 128 BYTEs buffer for filename
112h 128 BYTEs buffer for filename
192h 21 BYTEs findfirst/findnext search data block (see #01626 at AH=4Eh)
1A7h 32 BYTEs directory entry for found file (see #01352 at AH=11h)
1C7h 81 BYTEs copy of current directory structure for drive being accessed
218h 11 BYTEs FCB-format filename for device name comparison
223h BYTE terminating NUL for above filename
224h 11 BYTEs wildcard destination specification for rename (FCB format)
22Fh BYTE terminating NUL for above spec
230h BYTE ???
231h WORD destination file/directory starting sector
233h 5 BYTEs ???
238h BYTE extended FCB file attribute
239h BYTE type of FCB (00h regular, FFh extended)
23Ah BYTE directory search attributes
23Bh BYTE file open/access mode
23Ch BYTE file found/delete flag
File found
File deleted
Device name found on rename, or file not found
23Eh BYTE splice flag (file name and directory name together)
23Fh BYTE flag indicating how DOS function was invoked
(00h = direct INT 20/INT 21, FFh = server call AX=5D00h)
240h BYTE sector position within cluster
Translate sector/cluster (00h no, 01h yes)
00h if read, 01h if write
243h BYTE current working drive number
244h BYTE cluster factor
Cluster split mode
246h BYTE line edit (AH=0Ah) insert mode flag (nonzero = on)
247h BYTE canonicalized filename referred to existing file/dir if FFh
248h BYTE volume ID flag
249h BYTE type of process termination (00h-03h) (see AH=4Dh)
24Ah BYTE file create flag (00h = no, search only)
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
Used during process termination
250h DWORD pointer to stack frame containing user registers on INT 21
254h WORD stores SP across INT 24
256h DWORD pointer to DOS Drive Parameter Block for ???
25Ah WORD saving partial cluster number
Sector of work current cluster
25Eh WORD high part of cluster number (only low byte referenced)
260h WORD ??? temp
262h BYTE Media ID byte returned by AH=1Bh,1Ch
263h BYTE padding (unused)
264h DWORD pointer to device header when filename is character device
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 number of SFT to which file being opened will refer
276h WORD temporary storage for file handle
278h DWORD pointer to a JFT entry in process handle table
(see #01378 at AH=26h)
27Ch WORD offset in DOS DS of first filename argument
27Eh WORD offset in DOS DS of second filename argument
280h WORD offset of last component in pathname or FFFFh
282h WORD offset of transfer address to add
284h WORD last relative cluster within file being accessed
Absolute cluster number being accessed
288h WORD directory sector number
28Ah WORD ??? current cluster number
28Ch WORD current relative sector number within file
28Eh WORD current sector number
290h WORD current byte offset within sector
292h DWORD current offset in file
File byte count
File byte count
29Ch WORD free file cluster entry
29Eh WORD last file cluster entry
2A0h WORD next file cluster number
2A2h DWORD number of bytes appended to file
2A6h DWORD pointer to current work disk buffer
2AAh DWORD pointer to working 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 #01626 at AH=4Eh)
2CDh 32 BYTEs directory entry for file being renamed (see #01352 at AH=11h)
2EDh 331 BYTEs critical error stack
403h 35 BYTEs scratch SFT
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.2,3.3x only---
738h BYTE device driver lookahead flag (usually printer)
(see AH=64h"DOS 3.2+")
739h BYTE volume change flag
Virtual open
73Bh BYTE ???
Interrups | Categories | Contents |