Function 5801h Set Allocation Strategy DOS 3.0+
Sets the method DOS uses to allocate memory.
Entry AX = 5801h
BX = allocation-strategy value
Return Nothing
or
AX = Error code, if CF is set
| 01h Invalid function (bad strategy value)
──────────────────────────────────────────────────────────────────
If a program changes the allocation strategy to permit allocations
from the upper-memory area, it must save the original allocation
strategy and restore it before terminating.
──────────────────────────────────────────────────────────────────
If the current allocation strategy specifies the upper-memory area
but the upper-memory area is not linked, DOS searches conventional
memory instead.
The allocation-strategy value can be one of the following:
first_fit_low = 0000h Search conventional memory for the
available block having the lowest
address.
This is the default strategey.
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 having 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.