cwExec Run another CauseWay program directly.

Inputs: AX = 0ff24h

DS:EDX = selector:offset of file name.

ES:ESI = selector:offset of command line.

First byte is length, then data.

CX = environment selector, 0 to use copy of existing environment.

Outputs: Carry set on error and AX = error code else,

AL = ErrorLevel

Errors: Error code 1 = DOS file access error.

Error code 2 = Not a 3P (CauseWay format) file.

Error code 3 = Not enough memory.

Notes: Only the first byte of the command line, the length byte, has any significance to CauseWay, so the following data is not restricted to printable ASCII values. The command line is still stored in the PSP at offset 80h, however, so length remains limited to 127 bytes.

cwLoad Load another CauseWay program as an overlay, performing relocations, but not executing.

Inputs: AX = 0ff2ah

DX:EDX = selector:offset of file name.

Outputs: Carry set on error and AX = error code else,

CX:EDX = Entry CS:EIP

BX:EAX = Entry SS:ESP

SI = PSP selector

Errors: Error code 1 = DOS file access error.

Error code 2 = Not a 3P (CauseWay format) file.

Error code 3 = Not enough memory.

Notes: The PSP returned in SI can be passed to RelMem to release the loaded program's memory and selectors. Only the memory and selectors allocated during loading will be released, it is the program's responsibility to release any additional memory allocated while the program is running. Alternatively, if you pass the PSP value to INT 21h, AH = 50h before making additional memory requests and then reset to the original PSP, the memory allocated will be released when the PSP is released.

Next Page

Previous Page

Go to Table of Contents

Go back to Devore Software & Consulting home page