Coding the DFHEIENT macro for AMODE(24) and AMODE(31) assembler language programs
For AMODE(24) and AMODE(31) programs, the DFHEIENT macro calls the PROLOG program, which allocates working storage to hold any user variables and for CICS® use. The PROLOG program sets up the CICS portion of this storage. When the program returns, this code sets up the registers specified by the DFHEIENT parameters. The values provided by the DFHEIENT macro that the translator inserts automatically might be inadequate for application programs that produce a translated output greater than 4095 bytes. In this situation, you can provide your own version of the DFHEIENT macro and specify the NOPROLOG translator option to prevent the translator from automatically inserting its version of the DFHEIENT macro.
For example, by default, the translator sets up only one base register (register 3), which might cause addressability problems for your program. You can provide your own DFHEIENT macro with the CODEREG operand so that you can specify more than one base register. If you code your own version of the DFHEIENT macro with the same label as the CSECT statement, it can replace the CSECT statement in your source program. If you code the DFHEIENT macro without a label, it must immediately follow the CSECT statement.
- CODEREG
- Specify a value of 0 (the default) to specify relative addressing.
- DATAREG
- Specify one or more working storage registers for the application program. The default is register 13, and it is advisable to use register 13 as your first data dynamic-storage register. If you do not, the code generated by the DFHECALL macro adds extra instructions to manipulate register 13. The DFHECALL macro ensures that register 13 addresses the save area that DFHEISTG defined in dynamic storage.
- EIBREG
- Specify the register to use to address the EXEC interface block (EIB). The default is register 11.
- STATREG
- Specify one or more static registers for the application program to use. The default is register 3.
- STATIC
- Specify the assembler label of the start of the static area. You must specify a value; there is no default for this parameter.
Using base registers in your program
- CODEREG - base registers (registers 13,14,15, and 1 not allowed)
- DATAREG - dynamic-storage registers
- EIBREG - register to address the EIB
INSTRUCT CSECT
EXEC CICS SEND MAP('DFH$AGA') MAPONLY ERASE
END
INSTRUCT DFHEIENT CODEREG=(2,3,4),
DATAREG=(13,5),
EIBREG=6
EXEC CICS SEND
MAP('DFH$AGA')
MAPONLY ERASE
ENDThe symbolic register DFHEIPLR is equated to the first DATAREG either explicitly specified or obtained by default. The DFHECALL macro ensures that register 13 addresses the save area that DFHEISTG defined in dynamic storage, so it is advisable to use register 13 as your first data dynamic-storage register. If you do not, the code generated by DFHECALL adds extra instructions to manipulate register 13.
DFHEIPLR is assumed by the expansion of a CICS command to contain the value set up by DFHEIENT. You should either dedicate this register or ensure that it is restored before each CICS command.
Using relative addressing in your program
- CODEREG=0 to specify that no registers are to be used to address program instructions.
- STATREG to specify one or more registers to address the static data area in your program.
- STATIC to specify the address of the start of the static data in your program.
IEABRCX DEFINE Define relative branch mnemonics
RELATIVE DFHEIENT CODEREG=0,STATREG=(8,9),STATIC=MYSTATIC
....
EX R2,VARMOVE Execute instruction in static area
....
MYSTATIC DS 0D Static data area
MYCONST DC C'constant' Static data value
VARMOVE MVC WORKA(0),WORKB Executed instruction
LTORG , Literal poolFor more information about the IEABRCX macro, see IEABRCX - Relative branch macro extension in z/OS MVS Programming: Assembler Services Reference IAR-XCT.
Where LTORG statements are needed
Assembler language programs that are translated with the DLI option have a DLI initialization call inserted after each CSECT statement. Assembler language programs that are larger than 4095 bytes and that do not use the CODEREG operand of the DFHEIENT macro to establish multiple base registers, must include an LTORG statement to ensure that the literals, generated by either DFHEIENT or a DLI initialization call, fall in the range of the base register.
In general, an LTORG statement is needed for every CSECT that exceeds 4095 bytes in length.
Related information
- For reference information about the DFHEIENT macro, see DFHEIENT macro.
- For more information about the DFHEIRET macro, see Coding the DFHEIRET macro for assembler language programs and DFHEIRET macro.
- For more information about the DFHEISTG storage, see Extending dynamic storage for assembler language programs.
- For reference information for the EXEC interface, including design overview, control blocks, modules, exits, and trace, see EXEC interface.