Based on a technique I use to reserve space large enough for (say) X, Y or
Z:

BUFFER   DS    0X
         DS    (L'X)X
         ORG   BUFFER
         DS    (L'Y)X
         ORG   BUFFER
         DS    (L'Z)X
         ORG   ,
BUFLEN   EQU   *-BUFFER

So MAX(Y,Y,Z) is BUFLEN
Where X, Y and Z are equate, just omit the L'

Robert Ngan
CSC Financial Services Group

IBM Mainframe Assembler List <[email protected]> wrote on
2015/06/17 08:14:54:

> From: David Cole <[email protected]>
> To: [email protected]
> Date: 2015/06/17 08:16
> Subject: Re: Assembler exercise - MAX of two or more equates
> Sent by: IBM Mainframe Assembler List <[email protected]>
>
> I think John has started something here... So here's an interesting
> problem I had to solve some years ago...
>
> 1) Given two non-relocatable equates, define a third equate that is
> equal to the MAX of those two. (As far as I know, the Assembler still
> does not offer MAX and MIN built-in functions.)
>
> 2) Extend that solution to three or more equates. (One z/XDC macro
> has internal logic that resolves the MAX of around fifty equates. It
> goes on and on for pages!)
>
> The answer I have in mind works for equates that are not resolvable
> at macro pass time. In fact, the solution does not use macro pass
> logic at all, no SETx symbols, no nothing.
>
> Hint: Central to the ability to do this is a rather "unusual"
> characteristic of the rules of arithmetic that the Assembler follows.
> (Did I just give it away?)
>
>
>
> Now I'm sure some of you, like me, have worked this out decades ago,
> so if you already know how to do this, feel free to brag, but please
> hold off posting an actual answer for a few days to give others a
> crack at this exercise.
>
> Thanks,
> Dave Cole
> ColeSoft Marketing
> 414 Third Street, NE
> Charlottesville, VA 22902
> EADDRESS:     [email protected]
>
> Home page:    www.colesoft.com
> User's Group: www.xdc.com (on LinkedIn)
> Facebook:     www.facebook.com/colesoftware
> Videos:       www.youtube.com/user/colesoftware
>
>
>
>
>
>
> At 6/16/2015 07:59 PM, John Ehrman wrote:
> >For those needing something to think about....
> >
> >In the description of the TRTE and TRTRE instructions in the POP,
> >there's a table giving the expected length of the function-code
> >table for various combinations of the three bits named A, F, and L
> >in the M3 mask field. Your exercise:
> >
> >Suppose the three symbols A, F, and L in the M3 mask have been
> >defined as absolute symbols with values 0 or 1. Suppose also that
> >you must reserve space for a function-code table with size depending
> >on the values of A, F, and L, as illustrated in the POP table. Write
> >an EQU statement defining a symbol TL that will contain the length
> >of the reserved area for the table, for all combinations of values
> >of A, F, and L.
> >
> >As Tony Harminc says, "Have fun..." (it can be done).
> >
> >Regards... John
> >---------------------
> >555 Bailey Ave, San Jose CA 95141 USA
> >+1-408-463-3543 (fax -3873) TIE 543-
> >[email protected]; VMID = EHRMAN at STLVM27

Reply via email to