Function 48h (72)        Allocate Memory

Allocates a specified number of memory paragraphs.

On entry:      AH         48h
BX         Number of memory paragraphs to be allocated

Returns:       AX         Segment address of allocated memory
Error code, if CF is set
BX         Size of largest available block (CF set)

Error codes:   7          Memory control blocks destroyed
8          Insufficient memory

Call Function 59h for extended error code information
(DOS 3.0 and above).

                                                                          

Function 48h dynamically allocates memory, in multiples of 16 bytes
(one paragraph). The amount of memory to be allocated, in paragraphs,
is specified in BX. If the function is successful, AX:0000 points to
the allocated memory block. (AX holds the segment address; the offset
is always 0000).

Notes:         By setting BX=FFFFh before calling, this function
can be used to find the amount of available memory,
which will be returned in BX. (The call will return
an error, which can be ignored, since DOS cannot
allocate more than 640k of memory.)

See also: 49h
See also: 4Ah
See also: 59h

48h (72) Allocate Memory