Make your own free website on Tripod.com
Up ] Docs Home ]

Format of DOS 4.0-6.0 swappable data area

Back ] Next ]

Offset Size Description

-34

BYTE

printer echo flag
00h = off
FFh = active

-31

BYTE

current switch character (ignored by DOS 5+)

-30

BYTE

current memory allocation strategy (see AH=58h)

-28

BYTE

incremented on each INT 21/AX=5E01h call

-27

16 BYTEs

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) (all offsets are 0D0Ch, but this list is still present for DOS 3.x compatibility)

-1

BYTE

unused padding

Note:

The above data is not actually part of the SDA, and is much more likely to change between DOS versions/OEMs than data in the SDA itself.

---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 3.41/5.0 set this to 00h when no critical error)

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

18h

BYTE

flag: code page switching

19h

BYTE

flag: copy of previous byte in case of INT 24 Abort

---remainder need only be swapped if in DOS---

1Ah

WORD

value of AX on call to INT 21
Note: does not contain correct value on functions 00h-0Ch, 50h, 51h, 59h, or 62h

1Ch

WORD

PSP segment for sharing/network (0000h = local)

1Eh

WORD

network machine number for sharing/network (0000h = local)

20h

WORD

first usable memory block found when allocating memory

22h

WORD

best usable memory block found when allocating memory

24h

WORD

last usable memory block found when allocating memory

26h

WORD

memory size in paragraphs (used only during initialization)

28h

WORD

last entry checked during directory search

2Ah

BYTE

flag: nonzero if INT 24 Fail

2Bh

BYTE

flags: allowable INT 24 responses (passed to INT 24 in AH)

2Ch

BYTE

flag: do not set directory if nonzero

2Dh

BYTE

flag: program aborted by ^C

2Eh

BYTE

flag: allow embedded blanks in FCB
may also allow use of "*" wildcard in FCBs

2Fh

BYTE

padding (unused)

30h

BYTE

day of month

31h

BYTE

month

32h

WORD

year - 1980

34h

WORD

number of days since 01jan1980

36h

BYTE

day of week
0 - Sunday
1 - Monday
2 - Tuesday
3 - Wednesday
4 - Thursday
5 - Friday
6 - Saturday

37h

BYTE

flag: console swapped during read from device

38h

BYTE

flag: safe to call INT 28 if nonzero

39h

BYTE

flag: abort currently in progress, turn INT 24 Abort into Fail

3Ah

30 BYTEs

device driver request header (see #02597 at INT 2F/AX=0802h) for device calls

58h

DWORD

pointer to device driver entry point (used in calling driver)

5Ch

22 BYTEs

device driver request header for I/O calls

72h

14 BYTEs

device driver request header for disk status check (also includes following eight bytes for some calls)

80h

DWORD

pointer to device I/O buffer

84h

WORD

part of request header at 72h

86h

WORD

part of request header at 72h (0)

88h

BYTE

type of PSP copy
00h = simple for INT 21/AH=26h
FFh = make child

89h

DWORD

start offset of file region to lock/unlock

8Dh

DWORD

length of file region to lock/unlock

91h

BYTE

padding (unused)

92h

3 BYTEs

24-bit user number (see AH=30h)

95h

BYTE

OEM number (see #01394 at AH=30h)

96h

6 BYTEs

CLOCK$ transfer record (see #01688 at AX=5D06h)

9Ch

BYTE

device I/O buffer for single-byte I/O functions

9Dh

BYTE

padding

9Eh

128 BYTEs

buffer for filename

11Eh

128 BYTEs

buffer for filename (rename destination name)

19Eh

21 BYTEs

findfirst/findnext search data block (see #01626 at AH=4Eh)

1B3h

32 BYTEs

directory entry for found file (see #01394 at AH=11h)

1D3h

88 BYTEs

copy of current directory structure for drive being accessed

22Bh

11 BYTEs

FCB-format filename for device name comparison

236h

BYTE

terminating NUL for above filename

237h

11 BYTEs

wildcard destination specification for rename (FCB format)

242h

BYTE

terminating NUL for above filespec

243h

BYTE

padding???

244h

WORD

destination starting sector (cluster???)

246h

5 BYTEs

extra space to allow a directory entry to be stored starting at offset 22Bh

24Bh

BYTE

extended FCB file attributes

24Ch

BYTE type of FCB
00h = regular
FFh = extended

24Dh

BYTE directory search attributes

24Eh

BYTE file open/access mode

24Fh

BYTE flag: nonzero if file was deleted

250h

BYTE flag: device name found on rename, or file not found

251h

BYTE flag: splice file name and directory name together

252h

BYTE flag indicating how DOS function was invoked
00h = direct INT 20/INT 21
FFh = server call AX=5D00h

253h

BYTE sector position within cluster

254h

BYTE flag: translating sector/cluster

255h

BYTE flag:
00h = read
01h = write

256h

BYTE current working drive number

257h

BYTE cluster factor

258h

BYTE "sda_CLUSSPLIT" flag: cluster split between two FAT sectors

259h

BYTE line edit (AH=0Ah) insert mode flag (nonzero = on)

25Ah

BYTE canonicalized filename referred to existing file/dir if FFh

25Bh

BYTE volume ID flag

25Ch

BYTE type of process termination (00h-03h) (see AH=4Dh)

25Dh

BYTE unused (padding for alignment)

25Eh

BYTE

file create flag (00h = no, search only)

25Fh

BYTE

value for deleted file's first byte:
00h = delete all
E5h = else

260h

DWORD

pointer to Drive Parameter Block for critical error invocation

264h

DWORD

pointer to stack frame containing user registers on INT 21

268h

WORD

stores SP across INT 24

26Ah

DWORD

pointer to DOS Drive Parameter Block for ???

26Eh

WORD

segment of disk buffer

270h

DWORD

saving partial cluster number

274h

WORD

"sda_PREREAD"
00h = preread
01h = optional

276h

WORD

temporary used in allocating disk space

278h

BYTE

Media ID byte returned by AH=1Bh,1Ch

279h

BYTE

unused

27Ah

DWORD

pointer to device header if filename is character device

27Eh

DWORD

pointer to current SFT

282h

DWORD

pointer to current directory structure for drive being accessed

286h

DWORD

pointer to caller's FCB

28Ah

WORD

SFT index to which file being opened will refer

28Ch

WORD

temporary storage for file handle

28Eh

DWORD

pointer to JFT entry (for file being opened) in process handle table (see #01378 at AH=26h)

292h

WORD

"sda_WFP_START" offset in DOS DS of first filename argument

294h

WORD

"sda_REN_WFP" offset in DOS DS of second filename argument

296h

WORD

offset of last component in pathname or FFFFh

298h

WORD

offset of transfer address to add

29Ah

WORD

last relative cluster within file being accessed

29Ch

WORD

temp: absolute cluster number being accessed

29Eh

DWORD

directory sector number

2A2h

WORD

directory cluster number

2A4h

DWORD

current relative sector number within file

2A8h

DWORD

current sector number (number of previously written sectors)

2ACh

WORD

current byte offset within sector

2AEh

DWORD

current offset in file

2B2h

WORD

number of bytes in first sector

2B4h

WORD

bytes in partial last sector

2B6h

WORD

number of whole sectors

2B8h

WORD

free file cluster entry

2BAh

WORD

last file cluster entry

2BCh

WORD

next file cluster number

2BEh

DWORD

number of bytes appended to file

2C2h

DWORD

pointer to current work disk buffer

2C6h

DWORD

pointer to working SFT

2CAh

WORD

used by INT 21 dispatcher to store caller's BX

2CCh

WORD

used by INT 21 dispatcher to store caller's DS

2CEh

WORD

temporary storage while saving/restoring caller's registers

2D0h

DWORD

pointer to prev call frame (offset 264h) if INT 21 reentered
also switched to for duration of INT 24

2D4h

WORD

open mode/action for INT 21/AX=6C00h

2D6h

BYTE

extended open conditional flag
set to 00h by INT 21h dispatcher, 02h when a read is performed, and 01h or 03h by INT 21/AX=6C00h

2D7h

WORD

extended open I/O mode

2D9h

DWORD

stored ES:DI for AX=6C00h

2DDh

WORD

extended file open action code (see #01770 at AX=6C00h)

2DFh

WORD

extended file open attributes (see #01769 at AX=6C00h)

2E1h

WORD

extended file open file mode (see AX=6C00h)

2E3h

DWORD

pointer to filename to open (see AX=6C00h)

2E7h

WORD

high word of 32-bit sector number, or temp data buffer size from disk buffer

2E9h

WORD

"sda_OffsetMagicPatch"

2EBh

BYTE

disk full on >32M partition when set to 01h

2ECh

WORD

stores DS during call to [List-of-Lists + 37h]

2EEh

WORD

temporary storage (various uses)

2F0h

BYTE

storage for drive error

2F1h

WORD

DOS 3.4 (European MS-DOS 4.00) bit flags

2F3h

DWORD

pointer to user-supplied filename

2F7h

DWORD

pointer to user-supplied rename destination filename

2FBh

WORD

stores SS during call to [List-of-Lists + 37h] and INT 25,26

2FDh

WORD

stores SP during call to [List-of-Lists + 37h] and INT 25,26

2FFh

BYTE

flag, nonzero if stack switched in calling [List-of-Lists+37h]

300h

21 BYTEs

FindFirst search data for source file(s) of a rename operation (see #01626 at AH=4Eh)

315h

32 BYTEs

directory entry for file being renamed (see #01352 at AH=11h)

335h

331 BYTEs

critical error stack

480h

384 BYTEs

disk stack (functions greater than 0Ch, INT 25,INT 26)

600h

384 BYTEs

character I/O stack (functions 01h through 0Ch)

780h

BYTE

device driver lookahead flag (usually printer) (see AH=64h"DOS 3.2+")

781h

BYTE

volume change flag

782h

BYTE

flag: virtual file open

783h

BYTE

fastseek drive

784h

WORD

fastseek first cluster number

786h

WORD

fastseek logical cluster number

788h

WORD

fastseek returned logical cluster number

78Ah

WORD

temporary location of DOS@SYSINIT

---MSDOS 7.1+ (FAT32)---

78Ch

47 BYTEs

???

7BBh

BYTE

flag: absolute disk read/write type
00h = INT 25/INT 26
01h = INT 21/AX=7305h

7BCh

WORD

high word of directory cluster number at offset 2A2h

7BEh

WORD

high word of cluster number at offset 29Ch

7C0h

WORD

high word of next file cluster number at offset 2BCh

7C2h

WORD

high word of last relative cluster number at offset 29Ah

7C4h

WORD

high word of temp at offset 276h

7C6h

WORD

high word of offset 244h

7C8h

WORD

high word of EBX

7CAh

WORD

high word of EDX used by "PACK"

7CCh

WORD

high word of EDI used by "UNPACK"

7CEh

WORD

high word of EBX used by "SETDIRSRCH"

7D0h

WORD

high word of ECX used by "FREECLUSTER"

7D2h

WORD

high word of EDI used by "GETEOF"

7D4h

3 WORDs

???

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:

#01687,#01689