If the application program is able to release any memory from its AMI file, it should do so. The
space freed will always be taken from the end of the file, so that any internal data structures
necessary should be moved down to place the free memory at the end of the file. The
application program should then return to the O/S by doing an IRET instruction and return in
AX the number of paragraphs of memory actually made available to the O/S to recover from
the end of the AMI file. If no memory was made available, AX must contain 0.
Any changes to DS, ES, SS, or SP within this hook routine will be remembered by the O/S
and those changed registers will be restored before returning to the application when the O/S
function call completes. If, for example, the application program's stack were at the end of the
AMI, the hook routine could copy the data on the stack down by the requested amount, adjust
SP to point to the new stack location, and then perform the IRET. HH O/S would then
remember the new location of the application program's stack, and that stack would be in
effect when the interrupted function call completes.
HH O/S will have pushed some critical information onto the application program's stack before
performing the INT 44h instruction. For this reason, the hook routine must preserve the
contents of the stack, although it is allowed to move its location.
HH O/S is not reentrant. For this reason, the INT 44h hook routine may not make any HH O/S
function calls. The INT 44h hook routine is allowed to perform any of the HH O/S interrupts
that are explicitly listed as being reentrant.