INT 2F - EXTENDED MEMORY SPECIFICATION (XMSsee Extended Memory Specification) v2+ - GET DRIVER ADDRESS
AX = 4310h
Return: ES:BX -> driver entry point (see #02749,#02750,#02753,#02760,#02769,#02774)
Notes: HIMEM.SYS v2.77 chains to previous handler if AH is not 00h or 10h
HIMEM.SYS requires at least 256 bytes free stack space when calling
the driver entry point
SeeAlso: AX=4300h,AX=4310h"Cloaking",AX=4310h"Netroom",AX=4310h"XMZ"
Format of XMSsee Extended Memory Specification driver entry point:
Offset Size Description (Table 02749)
00h 5 BYTEs jump to actual handler
either short jump (EBh XXh) followed by three NOPs or
far jump (EAh XXXX:XXXX) to a program which has hooked itself
into the XMSsee Extended Memory Specification driver chain
Note: to hook into the XMSsee Extended Memory Specification driver chain, a program should follow the chain of
far jumps until it reaches the short jump of the driver at the end
of the chain; this short jump is to be replaced with a far jump to
the new handler's entry point, which should contain a short jump
followed by three NOPs. The new handler must return to the address
pointed at by the short jump which was overwritten. Using this
method, the new handler becomes the first to see every XMSsee Extended Memory Specification request.
(Table 02750)
Call the XMSsee Extended Memory Specification driver "Get XMSsee Extended Memory Specification version number" function with:
AH = 00h
Return: AX = XMSsee Extended Memory Specification version (in BCD(Binary Coded Decimal) A method of data storage where two decimal digits are stored in each byte, one in the upper four bits and the other in the lower four bits. Since only the values 0 through 9 are used in each half of a byte, BCD values can be read as decimal numbers on a hexadecimal display of memory or a file., AH=major, AL=minor)
BX = internal revision number (in BCD(Binary Coded Decimal) A method of data storage where two decimal digits are stored in each byte, one in the upper four bits and the other in the lower four bits. Since only the values 0 through 9 are used in each half of a byte, BCD values can be read as decimal numbers on a hexadecimal display of memory or a file. for HIMEM.SYS)
DX = High Memory AreaThe first 65520 bytes (64K less 16 bytes) of extended memory. This area is accessible from real mode on the 80286 and higher processors because these processors do not wrap addresses at one megabyte as the 8088 and 8086 do. See also A20, INT 2Fh Functions 4A01h. (HMAsee High Memory Area) state
0001h HMAsee High Memory Area (1M to 1M + 64K) exists
0000h HMAsee High Memory Area does not exist
SeeAlso: #02751,#02752,#02757,#02758,#02764
(Table 02751)
Call the XMSsee Extended Memory Specification driver "Request High Memory AreaThe first 65520 bytes (64K less 16 bytes) of extended memory. This area is accessible from real mode on the 80286 and higher processors because these processors do not wrap addresses at one megabyte as the 8088 and 8086 do. See also A20, INT 2Fh Functions 4A01h." function with:
AH = 01h
DX = memory in bytes (for TSR(Terminate and Stay Resident) A program which remains in memory after terminating in order to provide services to other programs or the user. The name comes from the name of the DOS function call used to remain in memory after termination. or device drivers)
FFFFh if application program
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,90h,91h,92h) (see #02775)
Note: HIMEM.SYS will fail function 01h with error code 91h if AL=40h and
DX=KB free extended memory returned by last call of function 08h
SeeAlso: #02752,#02784
(Table 02752)
Call the XMSsee Extended Memory Specification driver "Release High Memory AreaThe first 65520 bytes (64K less 16 bytes) of extended memory. This area is accessible from real mode on the 80286 and higher processors because these processors do not wrap addresses at one megabyte as the 8088 and 8086 do. See also A20, INT 2Fh Functions 4A01h." function with:
AH = 02h
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,90h,93h) (see #02775)
SeeAlso: #02751
(Table 02753)
Call the XMSsee Extended Memory Specification driver "Global enable A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode., for using the HMAsee High Memory Area" function with:
AH = 03h
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,82h) (see #02775)
SeeAlso: #02754,#02755,MSR(Model-Specific Register) Additional, indirectly-accessible, registers containing control or status information about various aspects of the processor such as caches, performance counters, and the like. These registers, accessible via the RDMSR and WRMSR instructions, were added with the Pentium and later-model 486 processors. 00001000h
(Table 02754)
Call the XMSsee Extended Memory Specification driver "Global disable A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode." function with:
AH = 04h
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,82h,94h) (see #02775)
SeeAlso: #02753,#02756,MSR(Model-Specific Register) Additional, indirectly-accessible, registers containing control or status information about various aspects of the processor such as caches, performance counters, and the like. These registers, accessible via the RDMSR and WRMSR instructions, were added with the Pentium and later-model 486 processors. 00001000h
(Table 02755)
Call the XMSsee Extended Memory Specification driver "Local enable A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode." function with:
AH = 05h
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,82h) (see #02775)
Note: this function is used for direct access to extended memory
SeeAlso: #02753,#02756
(Table 02756)
Call the XMSsee Extended Memory Specification driver "Local disable A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode." function with:
AH = 06h
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,82h,94h) (see #02775)
SeeAlso: #02754,#02755
(Table 02757)
Call the XMSsee Extended Memory Specification driver "Query A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode. state" function with:
AH = 07h
Return: AX = status
0001h enabled
0000h disabled
BL = error code (00h,80h,81h) (see #02775)
SeeAlso: #02750,#02758
(Table 02758)
Call the XMSsee Extended Memory Specification driver "Query free extended memory" function with:
AH = 08h
BL = 00h (some implementations leave BL unchanged on success)
Return: AX = size of largest extended memory block in KB
DX = total extended memory in KB
BL = error code (00h,80h,81h,A0h) (see #02775)
Note: this function does not include the HMAsee High Memory Area in the returned memory sizes
SeeAlso: #02750,#02757,#02759,#02771
(Table 02759)
Call the XMSsee Extended Memory Specification driver "Allocate extended memory block" function with:
AH = 09h
DX = Kbytes needed
Return: AX = status
0001h success
DX = handle for memory block
0000h failure
BL = error code (80h,81h,A0h) (see #02775)
SeeAlso: #02758,#02761,#02764,#02765,#02766,#02772
(Table 02760)
Call the XMSsee Extended Memory Specification driver "Free extended memory block" function with:
AH = 0Ah
DX = handle of block to free
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,A2h,ABh) (see #02775)
SeeAlso: #02759,#02772
(Table 02761)
Call the XMSsee Extended Memory Specification driver "Move extended memory block" function with:
AH = 0Bh
DS:SI -> EMM structure (see #02776)
Return: AX = status
0001h success
0000h failure
BL = error code (80h-82h,A3h-A9h) (see #02775)
Note: if either handle in the EMM structure is 0000h, the corresponding
offset is considered to be an absolute segment:offset address in
directly addressable memory
SeeAlso: #02759,#02762
(Table 02762)
Call the XMSsee Extended Memory Specification driver "Lock extended memory block" function with:
AH = 0Ch
DX = handle of block to lock
Return: AX = status
0001h success
DX:BX = 32-bit physical address of locked block
0000h failure
BL = error code (80h,81h,A2h,ACh,ADh) (see #02775)
Note: MS Windows 3.x rejects this function for handles allocated after
Windows started
SeeAlso: #02759,#02761,#02763,#02777
(Table 02763)
Call the XMSsee Extended Memory Specification driver "Unlock extended memory block" function with:
AH = 0Dh
DX = handle of block to unlock
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,A2h,AAh) (see #02775)
SeeAlso: #02762
(Table 02764)
Call the XMSsee Extended Memory Specification driver "Get handle information" function with:
AH = 0Eh
DX = handle for which to get info
Return: AX = status
0001h success
BH = block's lock count
BL = number of free handles left
DX = block size in KB
0000h failure
BL = error code (80h,81h,A2h) (see #02775)
BUG: MS Windows 3.10 acts as though unallocated handles are in use
Note: MS Windows 3.00 has problems with this call
SeeAlso: #02750,#02759,#02773
(Table 02765)
Call the XMSsee Extended Memory Specification driver "Reallocate extended memory block" function with:
AH = 0Fh
DX = handle of block
BX = new size of block in KB
Return: AX = status
0001h success
0000h failure
BL = error code (80h,81h,A0h-A2h,ABh) (see #02775)
SeeAlso: #02759,#02768
(Table 02766)
Call the XMSsee Extended Memory Specification driver "Request upper memory block" function with:
AH = 10h
DX = size of block in paragraphs
Return: AX = status
0001h success
BX = segment address of UMBsee Upper Memory Block
DX = actual size of block
0000h failure
BL = error code (80h,B0h,B1h) (see #02775)
DX = largest available block
Notes: Upper Memory consists of non-EMS memory between 640K and 1024K
the XMSsee Extended Memory Specification driver need not implement functions 10h through 12h to be
considered compliant with the standard
under DOS 5+, if CONFIG.SYS contains the line DOS=UMBsee Upper Memory Block, then no upper
memory blocks will be available for allocation because all blocks
have been grabbed by MS-DOS while booting
SeeAlso: #02759,#02767,#02785,INT 21/AH=58h"UMBsee Upper Memory Block"
(Table 02767)
Call the XMSsee Extended Memory Specification driver "Release upper memory block" function with:
AH = 11h
DX = segment address of UMBsee Upper Memory Block to release
Return: AX = status
0001h success
0000h failure
BL = error code (80h,B2h) (see #02775)
Note: the XMSsee Extended Memory Specification driver need not implement functions 10h through 12h to be
considered compliant with the standard
SeeAlso: #02760,#02766,#02768
(Table 02768)
Call the XMSsee Extended Memory Specification v3.0+ driver "Reallocate upper memory block" function with:
AH = 12h
DX = segment address of UMBsee Upper Memory Block to resize
BX = new size of block in paragraphs
Return: AX = status
0001h success
0000h failure
BL = error code (80h,B0h,B2h) (see #02775)
DX = maximum available size (RM386)
Note: the XMSsee Extended Memory Specification driver need not implement functions 10h through 12h to be
considered compliant with the standard
SeeAlso: #02765,#02766,#02767,#02783
(Table 02769)
Call the QEMM v5.11 "???" function with:
AH = 34h (QEMM 5.11 only, undocumentedInformation about a product which is not publicly available from the manufacturer, and must be determined by reverse-engineering (disassembly, trial-and-error, etc.). Undocumented information tends to change -- often dramatically -- between successive revisions of a product, since the manufacturer has no obligation to maintain compatibility in behavior which is not explicitly stated.)
???
Return: ???
SeeAlso: #02770
(Table 02770)
Call the QEMM v5.11 "???" function with:
AH = 44h (QEMM 5.11 only, undocumentedInformation about a product which is not publicly available from the manufacturer, and must be determined by reverse-engineering (disassembly, trial-and-error, etc.). Undocumented information tends to change -- often dramatically -- between successive revisions of a product, since the manufacturer has no obligation to maintain compatibility in behavior which is not explicitly stated.)
???
Return: ???
SeeAlso: #02769,#02783
(Table 02771)
Call the XMSsee Extended Memory Specification v3.0 driver "Query free extended memory" function with:
AH = 88h
Return: EAX = largest block of extended memory, in KB
BL = status (00h,80h,81h,A0h) (see #02775)
ECX = physical address of highest byte of memory
(valid even on error codes 81h and A0h)
EDX = total Kbytes of extended memory (0 if status A0h)
BUG: HIMEM v3.03-3.07 crash on an 80286 machine if any of the 8Xh functions
are called
SeeAlso: #02758,#02772
(Table 02772)
Call the XMSsee Extended Memory Specification v3.0 driver "Allocate any extended memory" function with:
AH = 89h
EDX = Kbytes needed
Return: AX = status
0001h success
DX = handle for allocated block (free with AH=0Ah) (see #02760)
0000h failure
BL = status (80h,81h,A0h,A1h,A2h) (see #02775)
SeeAlso: #02759,#02771
(Table 02773)
Call the XMSsee Extended Memory Specification v3.0 driver "Get extended EMB handle information" function with:
AH = 8Eh
DX = handle
Return: AX = status
0001h success
BH = block's lock count
CX = number of free handles left
EDX = block size in KB
0000h failure
BL = status (80h,81h,A2h) (see #02775)
BUG: MS-DOS 6.0 HIMEM.SYS leaves CX unchanged
SeeAlso: #02764,#02772,#02774
(Table 02774)
Call the XMSsee Extended Memory Specification v3.0 driver "Reallocate any extended memory block" function with:
AH = 8Fh
DX = unlocked memory block handle
EBX = new size in KB
Return: AX = status
0001h success
0000h failure
BL = status (80h,81h,A0h-A2h,ABh) (see #02775)
BUG: HIMEM v3.03-3.07 crash on an 80286 machine if any of the 8Xh functions
are called
SeeAlso: #02765,#02773
(Table 02775)
Values for XMSsee Extended Memory Specification error code returned in BL:
00h successful
80h function not implemented
81h Vdisk was detected
82h an A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode. error occurred
8Eh a general driver error
8Fh unrecoverable driver error
90h HMAsee High Memory Area does not exist or is not managed by XMSsee Extended Memory Specification provider
91h HMAsee High Memory Area is already in use
92h DX is less than the /HMAMIN= parameter
93h HMAsee High Memory Area is not allocated
94h A20(Address line 20) The 80286 and higher CPUs allow addresses in real mode to extend slightly beyond the one megabyte mark, which causes an incompatibility with some older programs which expect such addresses to wrap back to the beginning of the address space. For complete compatibility with the 8088, newer machines thus contain circuitry which permits the twenty-first address line (A20) to be disabled. The CPU then effectively has only twenty address lines in real mode, just as the 8088 does, and addresses which would extend beyond the one megabyte mark wrap to the beginning of the address space. See also High Memory Area, Real Mode. line still enabled
A0h all extended memory is allocated
A1h all available extended memory handles are allocated
A2h invalid handle
A3h source handle is invalid
A4h source offset is invalid
A5h destination handle is invalid
A6h destination offset is invalid
A7h length is invalid
A8h move has an invalid overlap
A9h parity error occurred
AAh block is not locked
ABh block is locked
ACh block lock count overflowed
ADh lock failed
B0h only a smaller UMBsee Upper Memory Block is available
B1h no UMBsee Upper Memory Block's are available
B2h UMBsee Upper Memory Block segment number is invalid
Format of EMM structure:
Offset Size Description (Table 02776)
00h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. number of bytes to move (must be even)
04h WORD source handle
06h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. offset into source block
0Ah WORD destination handle
0Ch DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. offset into destination block
Notes: if source and destination overlap, only forward moves (source base
less than destination base) are guaranteed to work properly
if either handle is zero, the corresponding offset is interpreted
as a real-mode address referring to memory directly addressable
by the processor
Format of XMSsee Extended Memory Specification handle info [array]:
Offset Size Description (Table 02777)
00h BYTE handle
01h BYTE lock count
02h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. handle size
06h DWORDDoubleword; four bytes. Commonly used to hold a 32-bit segment:offset or selector:offset address. handle physical address (only valid if lock count nonzero)
SeeAlso: #02747,#02762