Some applications will discard memory objects or will not access objects for long periods of time. These services can be used to improve the performance of demand paging.
Although these functions are only relevant for DPMI implementations that support virtual memory, other implementations will ignore these functions (it will always return carry clear). Therefore your code can always call these functions regardless of the environment it is running under.
Since both of these functions are simply advisory functions, the operating system may choose to ignore them. In any case, your code should function properly even if the functions fail.
Functions 0700h and 0701h are reserved and should not be called.
This function is used to inform the operating system that a range of pages should be placed at the head of the page out candidate list. This will force these pages to be swapped to disk ahead of other pages even if the memory has been accessed recently. However, all memory contents will be preserved.
This is useful, for example, if a program knows that a given piece of data will not be accessed for a long period of time. That data is ideal for swapping to disk since the physical memory it now occupies can be used for other purposes.
To Call
AX = 0702h
BX:CX = Starting linear address of pages to mark
SI:DI = Number of bytes to mark as paging candidates
Returns
If function was successful:
Carry flag is clear.
If function was not successful:
Carry flag is set.
Programmer's Notes
This function discards the entire contents of a given linear memory range. It is used after a memory object that occupied a given piece of memory has been discarded.
The contents of the region will be undefined the next time the memory is accessed. All values previously stored in this memory will be lost.
To Call
AX = 0703h
BX:CX = Starting linear address of pages to discard
SI:DI = Number of bytes to discard
Returns
If function was successful:
Carry flag is clear.
If function was not successful:
Carry flag is set.
Programmer's Notes