Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>allocmem() allocate dos memory segment</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
allocmem()               Allocate DOS Memory Segment

 #include   <dos.h>

 int        allocmem(size,seg);
 unsigned   size;                        Size in paragraphs
 unsigned   *seg;                        Pointer to segment address

    allocmem() allocates a block of free memory via the MS-DOS system
    call 0x48.  The segment address of the allocated block is returned.
    'size' is the desired size in paragraphs. 'seg' is a pointer to the
    word to be assigned the segment address of the allocated block.  If
    there is not enough room, no assignment is made.

    Returns:    -1 is returned on success.  On error, a value
                representing the size of the largest available block is
                returned.

       Note:    All allocated blocks are paragraph aligned.

                Use freemem() to free memory allocated by allocmem().

See Also: freemem() malloc()

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