Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- DOS 5.0 Ref. - <b>function 5801h set allocation strategy dos 3.0+</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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.

See Also: 48h 5800h 5802h 5803h

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson