Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Programmers Reference 0.02b - <b>function 48h (72) allocate memory</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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 4Ah 59h

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