Function 5800h Get Allocation Strategy

mov ax, 5800h ;Get Allocation Strategy

int 21h

mov Strategy, ax ;allocation strategy

Get Allocation Strategy (Function 5800h) returns the method MS-DOS uses to allocate memory.

Parameters

This function has no parameters.

Return Value

The carry flag is clear and the AX register contains the allocation-strategy value.

Comment

The allocation-strategy value can be one of the following:

Value Meaning

FIRST_FIT_LOW (0000h) Search conventional memory for the available block having the lowest address. This is the default strategy.
BEST_FIT_LOW (0001h) Search conventional memory for the available block that most closely matches the requested size.
LAST_FIT_LOW (0002h) Search conventional memory for the available block at the highest address.
FIRST_FIT_HIGH (0080h) Search the upper-memory area for the available block at the lowest address. If no block is found, the search continues in conventional memory.
BEST_FIT_HIGH (0081h) Search the upper-memory area for the available block that most closely matches the requested size. If no block is found, the search continues in conventional memory.
LAST_FIT_HIGH (0082h) Search the upper-memory area for the available block at the highest address. If no block is found, the search continues in conventional memory.
FIRST_FIT_HIGHONLY (0040h) Search the upper-memory area for the available block at the lowest address.
BEST_FIT_HIGHONLY (0041h) Search the upper-memory area for the available block that most closely matches the requested size.
LAST_FIT_HIGHONLY (0042h) Search the upper-memory area for the available block at the highest address.

For more information about upper-memory blocks and memory allocation, see Chapter 5, “Program Management.”

See Also

Function 48h Allocate Memory
Function 5801h Set Allocation Strategy
Function 5802h Get Upper-Memory Link
Function 5803h Set Upper-Memory Link