Resize DOS Memory Block
This function is used to grow or shrink a memory block
that was allocated through the Allocate DOS Memory
Block function.
To Call
AX = 0102h
BX = New block size in paragraphs
DX = Selector of block to modify
Returns
If function was successful:
Carry flag is clear.
If function was not successful:
Carry flag is set.
AX = DOS error code:
07h memory control blocks damaged
08h insufficient memory available to allocate as
requested
09h incorrect memory segment specified
BX = Maximum block size possible in paragraphs
Programmer's Notes
o Growing a memory block is often likely to fail
since other DOS block allocations will prevent
increasing the size of the block. Also, if the
size of a block grows past a 64K boundary then the
allocation will fail if the next descriptor in the
LDT is not free. Therefore, this function is
usually only used to shrink a block.
o Shrinking a block may cause some descriptors that
were previously allocated to the block to be
freed. For example shrinking a block from 140K to
120K would cause the third allocated descriptor to
be freed since it is no longer valid. The initial
selector will remain unchanged, however, the
limits of the remaining two descriptors will
change: the first to 120K and the second to 56k.