Function 4Dh Get Child-Program Return Value

mov ah, 4Dh ;Get Child-Program Return Value

int 21h

mov ReturnValue, al ;return value from last child program

mov Method, ah ;termination method for child program

Get Child-Program Return Value (Function 4Dh) retrieves the return value specified by the last child program. The child program must have specified a return value by using either End Program (Function 4Ch) or Keep Program (Function 31h).

Parameters

This function has no parameters.

Return Value

The AX register contains the child-program return value; the AL register contains the return value specified by the child program; and the AH register contains a number that specifies the child-program termination method, which may be one of the following:

Value Meaning

00h Normal termination
01h Terminated by CTRL+C
02h Critical device error
03h Terminated by the Keep Program function

Comments

The return value for the program is available only once. Subsequent calls to this function in relation to the same child program give meaningless results.

If there is no child-program return value to retrieve, this function does not return an error, and the information in the AX register is meaningless.

See Also

Function 31h Keep Program
Function 4Ch End Program