We use code of the form:

WorkArea DSECT
WORD     DS    F
FOO      DS    X
BAR      DS    Y
WorkLen  EQU   *-WorkArea
         DS    (&WORKL-WorkLen)X

If WorkLen exceeds &WORKL, the final DS will have a negative length and
therefore generate an assembly time error.

Robert Ngan
CSC Financial Services Group

IBM Mainframe Assembler List <[email protected]> wrote on
2014/08/16 07:33:03:

> From: Peter Hunkeler <[email protected]>
> To: [email protected]
> Date: 2014/08/16 07:33
> Subject: How to assign length of generated instructions to macro
variable?
> Sent by: IBM Mainframe Assembler List <[email protected]>
>
> Hello list members,
>
> This is my first post to this list. I've been working on MVS for
> some decades and have been an active member of IBM-MAIN for many
> years. This time I need some help with an assembler macro. In former
> times I've programmed in assembler quit a lot. However, this
> knowledge is a bit rusty.
>
> I want to modify a macro I've written long ago to generate reentrant
> code. For that, I'm asking for two new parameters: WORKA= and
> WORKL=, the address of a workarea (in dynamically allocated storage)
> for the macroo use, and the length of that area.
>
> The code generated varies in length, depending n what parms are
> specified on the macro. Some of what he code does is to generate
> list forms of other macros inline plus the instructions to move that
> part to the workarea, where it can be further modified by my macro.
>
> I want the macro to check that the length of the code generated does
> not exeed the length of the workarea as indicatedby WORKL=.
>
> I have not come up with a way to get the length of  a code section
> the macro generated into macro variables, so that I can compare to
> WORKL= and abort if neccessary.
>
> --
> Peter Hunkeler

Reply via email to