Format of data at start of STACKS code segment (if present):

Offset Size Description
00h WORD ???
02h WORD number of stacks (the x in STACKS=x,y)
04h WORD size of stack control block array (should be 8*x)
06h WORD size of each stack (the y in STACKS=x,y)
08h DWORD ptr to STACKS data segment
0Ch WORD offset in STACKS data segment of stack control block array
0Eh WORD offset in STACKS data segment of last element of that array
10h WORD offset in STACKS data segment of the entry in that array for
the next stack to be allocated (initially same as value in
0Eh and works its way down in steps of 8 to the value in
0Ch as hardware interrupts pre-empt each other)

Note: the STACKS code segment data may, if present, be located as
follows:
DOS 3.2: The code segment data is at a paragraph boundary fairly
early in the IBMBIO segment (seen at 0070:0190h)
DOS 3.3: The code segment is at a paragraph boundary in the DOS data
segment, which may be determined by inspecting the segment
pointers of the vectors for those of interrupts 02h,
08h-0Eh, 70h, 72-77h which have not been redirected by
device drivers or TSRs.
DOS 4.x: Identified by sub-segment control block type "S" within
the DOS data segment.