Processing of PRTEXIT

If PRTEXIT is specified, the compiler loads the exit module (mod3) during initialization. The exit module is used in place of the SYSPRINT file.

The compiler invokes the module using the OPEN operation code (op code). The module can then prepare its output destination for processing and pass the status of the OPEN request back to the compiler. Subsequently, each time the compiler has a line to print, the exit module is invoked with the PUT op code. The compiler supplies the address and length of the record that is to be printed, and the exit module returns the status of the PUT request to the compiler by a return code. The first byte of the record to be printed contains an ANSI printer control character.

Before the compilation completes, the compiler invokes the exit module with the CLOSE op code so that the module can release any resources that are related to its output destination.

The compiler uses a structure, passed by reference, to communicate with the exit module.

Related references  
Parameter list for exit modules