Function 49h Free Allocated Memory
Frees a block of memory previously allocated by function 48h.
Entry AH = 49h
ES = Segment address of memory to free
Return Nothing
or
AX = Error code, if CF is set
| 07h Memory control blocks destroyed
| 09h Invalid memory block address
──────────────────────────────────────────────────────────────────
This function returns to DOS the memory that was allocated by
means of Allocate Memory (function 48h). ES specifies the segment
address of the block that is being returned; this is the same
value that function 48h returned in AX.
DOS returns an error value of 9 (invalid memory block address) if
a program tries to free memory that was not allocated by function
48h.
──────────────────────────────────────────────────────────────────
Note
DOS 2.1+ does not coalesce adjacent free blocks when a block is
freed, only when a block is allocated or resized.