User`s guide

BDOS FUNCTION 108: GET/SET PROGRAM RETURN
CODE
Entry Parameters:
Registers C: 6CH
DE: 0FFFFH (Get) or
Program Return Code (Set)
Returned Value:
Register HL: Program Return Code or (no value)
CP/M 3 allows programs to set a return code before terminating. This provides a
mechanism for programs to pass an error code or value to a following job step in
batch environments. For example, Program Return Codes are used by the CCP in
CP/M 3's conditional command line batch facility. Conditional command lines are
command lines that begin with a colon, :. The execution of a conditional command
depends on the successful execution of the preceding command. The CCP tests the
return code of a terminating program to determine whether it successfully completed
or terminated in error. Program return codes can also be used by programs to pass
an error code or value to a chained program (see Function 47, Chain To Program).
A program can set or interrogate the Program Return Code by calling Function
108. If re 'ster pair DE = OFFFFH, then the current Program Return Code is returned
in register pair HL. Otherwise, Function 108 sets the Program Return Code to the
'value contained in register pair DE. Program Return Codes are defined in Table 3-5.
3-89
BDOS Function Calls CP/M 3 Programmers Guide