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 4ah set memory block size</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 4Ah            Set Memory Block Size

    Changes the size of a memory block previously allocated by function
    48h, or changes the amount of memory originally allocated to a
    program by DOS.

        Entry   AH = 4Ah
                BX = New block size, in paragraphs
                ES = Segment address of the memory block to resize

        Return  Nothing
                or
                AX = Error code, if CF is set
                     | 07h Memory control blocks destroyed
                     | 08h Insufficient memory (BX = largest block)
                     | 09h Invalid memory block address

    ------------------------------------------------------------------

    To resize a memory block allocated by Allocate Memory, ES must
    specify the segment address returned in AX by function 48h.

    To resize the amount of memory originally allocated to a program
    (when loaded by DOS), ES must specify the segment address of the
    program segment prefix (PSP).

    If this function is used to decrease the size of a memory block,
    the memory above the new limit is no longer owned by the program
    and should not be used. If this function is used to increase the
    size of a memory block, the contents of the new memory are not
    defined.


    If this function returns an error value of 8 (insufficient memory)
    the BX register contains the number of paragraphs in the largest
    available memory block.

    ------------------------------------------------------------------

    Note
    Under DOS 2.1+, if there is insufficient memory to expand the
    block as much as requested, the block will be made as large as
    possible. DOS 2.1+ coalesces any free blocks immediately following
    the block to be resized.

See Also: 48h 49h 59h 4b00h

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