Re: How to assign length of generated instructions to macro variable?

2014-08-21 Thread Steve Hobson
Paul Gilmartin wrote: http://pic.dhe.ibm.com/infocenter/zos/v2r1/topic/ com.ibm.zos.v2r1.asma400/alcon.htm Alignment of constants HLASM Language Reference SC26-4940-06 • On boundaries implicit to the type of constant (see Implicit Boundary Alignment in Table 2) when no length is

Re: How to assign length of generated instructions to macro variable?

2014-08-20 Thread Robert A. Rosenberg
At 22:51 -0600 on 08/19/2014, Paul Gilmartin wrote about Re: How to assign length of generated instructions to macro: ï On boundaries implicit to the type of constant (see Implicit Boundary Alignment in Table 2) when no length is specified. ï Alignment can be forced to any boundary by a

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Peter Relson
Rather than DC S(256-work-area-len) to see if work_area_len = 256 we sometimes use: DC0AL4(256-work_area_len+X'7FFF') Overflow if high As that covers a 31-bit value range. It also doesn't cost 2 bytes (though I expect that Binyamin really uses DC 0S(...) _/ I'm sure there are many

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Binyamin Dissen
On Tue, 19 Aug 2014 08:11:13 -0400 Peter Relson rel...@us.ibm.com wrote: :Rather than DC S(256-work-area-len) to see if work_area_len = 256 we :sometimes use: : :DC0AL4(256-work_area_len+X'7FFF') Overflow if high : :As that covers a 31-bit value range. It also doesn't cost 2 bytes

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Tony Thigpen
As an alternative, I has used dummy named USING statements to validate things like this. If I remember correctly, the original poster was copying expanded code into a work area. If the code to be copied has a 'last byte' DS 0h, then something like the following will generate an assembler

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Paul Gilmartin
On 2014-08-19, at 06:11, Peter Relson wrote: Rather than DC S(256-work-area-len) to see if work_area_len = 256 we sometimes use: DC0AL4(256-work_area_len+X'7FFF') Overflow if high As that covers a 31-bit value range. It also doesn't cost 2 bytes (though I've been told that

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Binyamin Dissen
On Tue, 19 Aug 2014 07:06:58 -0600 Paul Gilmartin 0014e0e4a59b-dmarc-requ...@listserv.uga.edu wrote: :And since the validity of S(...) depends on the USINGs in effect, :its use is problematic, at least in a library macro. If the result is an absolute (non-relocateable) value, only real weird

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Steve Hobson
I've been told that DS 0AL4(...) forces fullword alignment, which may sometimes be undesirable. Nope. Length qualifier turns off alignment (in all cases, AFAIK) Best regards, Steve Hobson Je me presse de rire de tout, de peur d'être obligé d'en pleurer Unless stated otherwise above: IBM

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Gord Tomlin
On 2014-08-18 16:18, Peter Hunkeler wrote: I'll have to think how some of them may help me to find a solution that will issue an MNOTE, not an assemlby error because of some statements like the above DS instruction. Personal taste is personal taste, but if I had a situation where I attempted

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Peter Hunkeler
Personal taste is personal taste, but if I had a situation where I attempted to add more to a work area than it could hold, I would want to be hit on the head by the assembler as hard as possible. That is my intent. I'm asking for an address in (dynamically allocated) storage (RX-type address)

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Paul Gilmartin
On 2014-08-19 11:29, Peter Hunkeler wrote: 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. Peter Relson discussed macro time versus run time: On 2014-08-19

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Andreas F. Geissbuehler
From: Peter Hunkeler 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

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread John Gilmore
Binding times are an old topic about which much has been written. Classically, coding time, translation time and execution time are distinguished, but this trichotomy does not capture many important, if nuanced, differences. It is clear enough, as Peter Relson has reminded us, that

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Robert A. Rosenberg
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

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Fred . van . der . Windt
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

Re: How to assign length of generated instructions to macro variable?

2014-08-19 Thread Paul Gilmartin
On 2014-08-19, at 09:00, Steve Hobson wrote: I've been told that DS 0AL4(...) forces fullword alignment, which may sometimes be undesirable. Nope. Length qualifier turns off alignment (in all cases, AFAIK) I stand corrected. I had heard, and I read:

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread Robert Ngan
We use code of the form: WorkArea DSECT WORD DSF FOO DSX BAR DSY 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

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread rkuebbin
While Robert Ngan's examples are not pretty, they work. Sometimes pretty is beyond our time frame of action. The back and forth on this (and other) elists is often pretty. It is often informative. The perfect is often the enemy of the adequate. And obliquely, my one tagline is appropriate.

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread Binyamin Dissen
On Mon, 18 Aug 2014 15:43:45 -0400 rkueb...@tsys.com wrote: :While Robert Ngan's examples are not pretty, they work. Sometimes pretty :is beyond our time frame of action. Only if you live in a ivory tower with no considerations of reality and business needs. If ones test cases fit into a tiny

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread Peter Hunkeler
We use code of the form: WorkArea DSECT WORD DSF FOO DSX BAR DSY 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. Thanks for all the answers

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread retired mainframer
Which of the currently available macro-language facilities support computations and comparisons on non-self-defining terms? -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER- l...@listserv.uga.edu] On Behalf Of John Gilmore Sent: Monday, August 18, 2014 11:31 AM

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread retired mainframer
When you find a macro construct that handles non-self-defining terms properly, let us know. -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER- l...@listserv.uga.edu] On Behalf Of Peter Hunkeler Sent: Monday, August 18, 2014 1:18 PM To:

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread Robert Ngan
WARNING: ***MASSIVE KLUDGE*** If I really need to pass the value of a non-self defining term to a macro, I'll code: WorkArea DSECT WORD DSF FOO DSX BAR DSY WorkLen EQU *-WorkArea : L SETA WorkLen MyMacro LENGTH=L This assumes you can define

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread John Gilmore
retired mainframer wrote begin extract When you find a macro construct that handles non-self-defining terms properly, let us know. /end extract It is not at all clear to me what this means. The macro language handles many kinds of entities that are not self-defining terms. If, however, it means

Re: How to assign length of generated instructions to macro variable?

2014-08-18 Thread John Gilmore
Voltaire did say that the best is the enemy of the good. I do not recall his saying that the inadequate is a defensible substitute for the adequate. The ancient saw that time pressures preclude good or 'pretty' work is not finally an intellectual argument at all. It is a rationalization.

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread Paul Gilmartin
On 2014-08-16, at 22:16, Binyamin Dissen wrote: I typically use 0S(expression) which will cause an assembly error if the value is negative. ... Not necessarily. It depends on what USINGs are in effect. -- gil

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread Binyamin Dissen
On Sun, 17 Aug 2014 09:31:14 -0600 Paul Gilmartin 0014e0e4a59b-dmarc-requ...@listserv.uga.edu wrote: :On 2014-08-16, at 22:16, Binyamin Dissen wrote: : I typically use : 0S(expression) : which will cause an assembly error if the value is negative. ... :Not necessarily. It

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread John Gilmore
What is a negative absolute value? John Gilmore, Ashland, MA 01721 - USA

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread Paul Gilmartin
On 2014-08-17, at 15:16, John Gilmore wrote: What is a negative absolute value? Jargon conflict. Assembler symbols may be either relocatable or absolute. An absolute (in that sense) symbol may have either a positive or a negative algebraic value. But it's unclear how Binymin's assertion

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread J R
Binyamin suggested an S-con 0S(expression) which would contain a base and displacement BDDD. By absolute value the base would be zero. === Date: Sun, 17 Aug 2014 16:24:00 -0600 From: 0014e0e4a59b-dmarc-requ...@listserv.uga.edu Subject: Re: How to assign length of generated

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread J R
How about something like START DS0D GUBBINS1 DSblah GUBBINS2 DSblah GUBBINS3 DSblah ENDDS0D LENGTH DCS(END-START) Would not the base register cancel itself out, leaving an absolute number? And, if it was inadvertently specified as S(START-END), would it not

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread John Gilmore
The value of LENGTH defrined by J R can be assigned to an arithmetic set symbol, give it the imaginative name/identifier alength. Then, calling the arithmetic [set-symbol] value of the input-length parameter ilength. |el seta 8--error-mnote severity level |match setb (alength eq

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread Paul Gilmartin
On 2014-08-17, at 17:53, J R wrote: How about something like START DS0D GUBBINS1 DSblah GUBBINS2 DSblah GUBBINS3 DSblah ENDDS0D LENGTH DCS(END-START) Would not the base register cancel itself out, leaving an absolute number? And, if it was

Re: How to assign length of generated instructions to macro variable?

2014-08-17 Thread J R
Date: Sun, 17 Aug 2014 20:48:33 -0400 From: jwgli...@gmail.com Subject: Re: How to assign length of generated instructions to macro variable? To: ASSEMBLER-LIST@LISTSERV.UGA.EDU The value of LENGTH defrined by J R can be assigned to an arithmetic set symbol, give it the imaginative

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Lizette Koehler
If you could post your current code, that could be helpful. Lizette -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER- l...@listserv.uga.edu] On Behalf Of Peter Hunkeler Sent: Saturday, August 16, 2014 5:33 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: How

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread John McKown
On Sat, Aug 16, 2014 at 7:33 AM, Peter Hunkeler p...@gmx.ch wrote: 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

AW: Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Peter Hunkeler
If you could post your current code, that could be helpful. Here is a snipped that might help to illustrate what I need: J WTXKSYSNDX.A WTXKSYSNDX WTO 'IDBWTOTEXT(K)', ROUTCDE=ROUTCDE,DESC=DESC,MF=L WTXKSYSNDX.L EQU *-WTXKSYSNDX WTXKSYSNDX.A DS 0H MVC

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Robert A. Rosenberg
At 14:33 +0200 on 08/16/2014, Peter Hunkeler wrote about How to assign length of generated instructions to macro var: 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

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread retired mainframer
If I understand correctly, you have a work area of known length and a macro that will build code. You want an assembly trick what will confirm the length of the generated code fits or lets you know if it doesn't. Two approaches come to mind 1 - At the point where the macro generates the first

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Peter Hunkeler
In order to check at assembly time, the parameter given via the WORKL= parameter _must_ be a self defining term. Currently I'm asking for a 3-4 digit value (there's a lower limit the macro needs). AIF (LGENMAC,LE,WORKL).GOODPARM I didn't know or remember that works. However, the macro

AW: Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Peter Hunkeler
Two approaches come to mind ... I was after a solution that writes MNOTEs explaining what is needed, so your 2). However, I was also thinking about 1) since I was stuck. Thought I ask here before giving up... The problem with 2) is that the macro generates inner macro calls of which the

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Steve Comstock
On 8/16/2014 12:35 PM, Peter Hunkeler wrote: In order to check at assembly time, the parameter given via the WORKL= parameter _must_ be a self defining term. Currently I'm asking for a 3-4 digit value (there's a lower limit the macro needs). AIF (LGENMAC,LE,WORKL).GOODPARM I didn't know

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread retired mainframer
Yes, there is a limit which why I should have coded DS 0XL(...) -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER- l...@listserv.uga.edu] On Behalf Of Paul Gilmartin Sent: Saturday, August 16, 2014 12:09 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU

Re: How to assign length of generated instructions to macro variable?

2014-08-16 Thread Binyamin Dissen
On Sat, 16 Aug 2014 16:26:52 +0200 Peter Hunkeler p...@gmx.ch wrote: : If you could post your current code, that could be helpful. :Here is a snipped that might help to illustrate what I need: : J WTXKSYSNDX.A :WTXKSYSNDX WTO 'IDBWTOTEXT(K)', :