At 19:29 +0200 on 08/19/2014, Peter Hunkeler wrote about Re: How to assign length of generated instructions to macro:

That is my intent. I'm asking for an address in (dynamically allocated)
storage (RX-type address) and a length that the macro is allowed to use
at that address. I want to make sure the code the macro generates does
not write beyond that area. If the area is to short, I want to inform
the programmer, via MNOTE about this fact and tell how much storage is
needed. This MNOTE will fail a successful assembly.

Under no circumstance must the macro generate code that would write into
storage it has not been given and I don't want the error to be caught
and displayed only at run time.

As said, I need some time to think about my intent and possible
solutions. Its so long I have coded my last macro, I may well be on the
wrong track with how I want to implement it. Let's see....

Why struggle with testing to see that the work area is long enough to hold the data you want to move into it? It is MUCH simpler to have the macro ask for the name of the workarea (WA=WA_LABEL) and a name to use on an EQU for the length of the workarea (WAL=WAL_LABEL). Now just generate the map of the work area and end it with a

        &WAL EQU *-START_OF_AREA

Define the dynamic work area as

           DS  0D
 WA_LABEL  DS  XL(WAL_LABEL)

This insures the workarea is long enough since its length is defined to be the correct size.

Reply via email to