On 12/20/2010 7:30 AM, Bodoh John Robert wrote:
Martin,

As I understand LARL, the current PSW is used as the
base to address the symbol.  If the symbol is in a
DSECT, the LARL instruction should generate an assembler
error.

John

[I am not Martin, but it is my comment you are responding to]

Ah! I see. Then perhaps what you are _really_ after has
nothing really to do with baseless vs. based. What you are
really after is knowing if a data item is located in a DSECT
or in the CSECT being run. Is that right?

If an item is in a DSECT, it is, of necessity, based off
some register. Then, for example, you would need, say,
LA instead of LARL. But you must realize that so-called
baseless programming usually needs a base register for
data items.

I come back to my previous question: what instructions are
you thinking of where you would need to choose between
based and baseless?

From the perspective of most software developers, it is
more critical to be sensitive to the underlying hardware:
which instructions are available on the machine I am
running? For those cases you either run code with lots of
checking for the host machine or you only use instructions
supported by all models for your customer base.


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Steve Comstock
Sent: Monday, December 20, 2010 9:25 AM
To: [email protected]
Subject: Re: Baseless vs Based

On 12/20/2010 7:05 AM, Bodoh John Robert wrote:
Ed, Martin, John, Tony, et al,

What I am doing is creating macros that are used by any other
application.  I was hoping to avoid having the user of these
macros have to specify the technique needed to address symbols.

That sounds clutzy and it nowhere else in the assembler do I
have to tell the assembler that kind of detail.

At the time the macro is being used, the macro does not know
whether baseless coding is being used or not and whether or not
a symbol is within the current CSECT or not.  If the symbol is
within the current CSECT and code invoking the macro is using
baseless coding, the macro MUST use baseless instructions.


AsI understand it, the symbol is within the current CSECT,
baseless instructions can be used whether or not the invoking
code is using baseless or not.  Otherwise, based instructions
MUST be used.

I'm at a loss here. First, you reference symbols for one
of two reasons: 1) a target for a branch or execute instruction,
and 2) a location for an operand.

In case 1), you can always use the so-called baseless instructions;
in case 2), it depends on the operation you need to perform.

For example, loading an address of a location can always be done
by LARL - unless the item is at an odd address! If you need to
work with packed decimal data, you must use the xP instructions,
all of which require base / displacement.

What instructions are you thinking of where you would choose
between baseless and based?


I am surprised this not considered a hole in the assembler
and is not more pervasive than just for me and my simple case.
Do not other macros have the same problem?

John

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Martin Trübner
Sent: Saturday, December 18, 2010 3:55 AM
To: [email protected]
Subject: Re: Baseless vs Based

Ed,

While I understand your point (missed you anyway in this thread ;-) ) I
do not see the word DSECT mentioned in the OP-s stmt.

John, was your question as simple as I assume or was it as
sophisticated as Tony and Ed answered (with solutions from John E. and
Paul)?

--
Martin

Pi_cap_CPU - all you ever need around MWLC/SCRT/CMT in z/VSE
more at http://www.picapcpu.de



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
    + Training your people is an excellent investment

* Try our new tool for calculating your Return On Investment
      for training dollars at
    http://www.trainersfriend.com/ROI/roi.html



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

* Try our new tool for calculating your Return On Investment
    for training dollars at
  http://www.trainersfriend.com/ROI/roi.html

Reply via email to