On Thu, 20 Oct 2011 17:57:24 -0500, Chris Craddock wrote:
>Jim Phoenix wrote:
>> Is there a way to test what AMODE is in effect for the current CSECT?
>> Such a test would be valuable to allow a macro to expand differently
based on the result, particularly if AMODE 64.
>
>with all of the usual caveats about it being a bad idea... there's (wisely)
no system variable for it, but if you want to know what (if anything) was
coded, you could try to OPSYN the AMODE statement to something else like
AMODEX and create an AMODE macro to capture whatever was coded and reflect
that in some GBLA or GBLC variable and then reissue the AMODEX statement
from within the macro.

To make this work, the AMODE, START, CSECT, RSECT, LOCTR, CATTR, DSECT and
COM instructions would all have to be OPSYN-replaced with macros so that the
current control section would always be tracked.  But even that is not
sufficient if the AMODE instruction is not used immediately after the first
instruction that establishes the control section. Otherwise the conditional
assembly pass has no way to know the addressing mode value between the first
definition of the section and the AMODE instruction.

And what is the addressing mode of instructions that follow an ENTRY
statement that has an AMODE defined? Is it the AMODE of the CSECT or the
previous ENTRY?  What about after BASSM, SAM24, SAM31 or SAM64? There just
isn't any way for the assembler to know the programmer's intent, so
ultimately SYSSTATE or some other convention is required.

David

Reply via email to