If a program that is already running needs more memory, such as for additional I/O buffers, the Memory Manager checks to see whether enough memory remains.
If so, it allocates it to the program while updating the memory block allocation table for that program.
If not, then an error message is returned to the user and the program is stopped.
Although initial memory allocation is handled automatically by programs written in BASIC, Pascal, or any other language supported by MS-DOS, the shrinking and expanding of memory allocation during execution can be done only from programs written in either assembly language or C.