Slightly different opinion on my side: I just expanded our local startup macro to support baseless code areas. The standard startup macro especially for main programs generates lots of instructions, that count for some 600 bytes (for example: error handling, buildung a LE environment etc.). So I cannot have a base register for data at the beginning of the program, because there resides this large startup macro.
And: the LTORG at the end of the program needs addressibility; there also go the definitions created by the structured programming macros, which are used in the code section. So I did the following: a) establish temporary base regs using R15 to support the startup macro - it was not possible to get all the startup code baseless b) drop temporary base c) force the developers to have code first, then data d) establish base regs only for the data section So the code area is baseless and may grow. The data area starts with a special macro which defines the base address, which is used in the USING in the startup code. For finding the variables in the dump, you should use the offsets in the instructions, not the offsets in the assembly list - or: you have to add the distance of the data area base. Other features: you specify an arbitrary number of base regs in the startup macro. and you have 3 options: BASREG=CODE: the base regs cover the code area, from the start of the CSECT BASREG=CODDAT: first base reg covers the code area, the second and the following cover the data area BASREG=DATA: the base regs cover the data area (true baseless code area) The definition and initialization of the registers is done by the startup macro code. Our ASSEMBLER coders are accustomed to use ASSEMBLER almost like a high level language - they normally don't want to deal with such things like addressibility issues. That's why we normally use the structured programming macros exclusively, too. Kind regards Bernd Am 11.04.2013 13:37, schrieb Martin Trübner:
Jon, Enough been said about the reason and the cause (and solutions) But who dictates techniques for vendors? While your points are okay- the "trick" to have the definitions right at the beginning of the module (with just a J in front) is something that makes sense for everyone. If you ever tried to calculate offset in a DOB-program (data only base) from the start of the LTORG (or wherever the base points to) knows what I mean. Credit for the technique goes to Ed J. Martin
