Interfacing with Assembler Subprograms

We recommend that you write your assembler subprograms to comply with the standard COBOL calling convention (bits 0 and 1 set to 0, the default). The assembler subprogram can consist of multiple code and data segments.

Assembler subprograms must be dynamically linked.

The registers used, assuming the standard call convention, are:

Register Usage
ESP holds the return address, followed by parameters which have been pushed in right to left order
EBP, EBX, ESI, EDI must be preserved by the called program
EAX holds the return-code for four byte data items
EDX:EAX register pair holds the return-code for an eight byte structure

For an example, see Example of Calling an Assembler Subprogram.