It's been a long time but once upon a time DS 0H was used for labels in code 
for two reasons.  TSO TEST liked it better than EQU *, and when a person mixed 
data and code, EQU * could possibly refer to an odd address.

And yes EQU * is a good way to mark a location in a record/control block that 
is either variable length or liable to change in length.

richard

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Gary Weinhold
Sent: Wednesday, August 01, 2018 2:40 PM
To: [email protected]
Subject: Re: EQU * considered harmful

To avoid the problem Dan illustrates but retain the advantages Charles cites of 
not labeling specific instructions, we use

label      DS      0H      instead of               label EQU   *

But i think some of the point of the original post was lost, since the question 
was whether

label   EQU    *

was ever beneficial, where the "*" indicates current location rather than 
meaning generically any value.


On 2018-08-01 2:23 PM, Dan Greiner wrote:
> I too disagree (rather strongly).
>
> As an example, consider where EQU is used to give names to bits of a field in 
> memory.
>
> FLAGS    DS    X
> F_OPEN   EQU X'80'
> F_CLOSE  EQU   X'40'
> F_FUBAR  EQU   X'20'
> ...
>          TM    FLAGS,F_FUBAR
>           JO    TOTALLY_HOSED
>
> Furthermore, you can assign a "length" to each bit, and use that as an offset 
> in the field, e.g:
>
> FLAGS    DS    XL4
> F_OPEN   EQU   X'80',0
> F_CLOSE   EQU   X'40',0
> F_FUBAR  EQU   X'02',3
> ...
>           TM    FLAGS+L'F_FUBAR,F_FUBAR
>
> (apologies if the syntax is not precise ... I'm doing this from memory at 
> home).
>
> As to Charles' comment about using EQU as a branch target, I'm a little bit 
> less comfortable.  If — by chance or accident — there happens to be code 
> before the EQU that knocks the location off a halfword boundary, this could 
> spell trouble.  E.g:
>
>           LA     7,ITS_ON
>           TM    BYTE,BIT
>           BCR   X'01',7
>           ...
>           other instructions
> HI_MOM DC    C'Hello'
> ITS_ON  EQU   *
>
> Since the constant "Hello" is 5 bytes long, this knocks the label ITS_ON onto 
> an odd boundary. If the branch had been directly to the location (as opposed 
> to BCR), HLASM would have flagged an error. But in this case, the error may 
> go undetected until execution — at which point the hardware will slap you 
> with a PIC-0006 (PIC-0006).



Gary Weinhold 
Senior Application Architect 

DATAKINETICS | Data Performance & Optimization 

Phone   +1.613.523.5500 x216
Email:  [email protected]

Visit us online at www.DKL.com 

E-mail Notification: The information contained in this email and any 
attachments is confidential and may be subject to copyright or other 
intellectual property protection. If you are not the intended recipient, you 
are not authorized to use or disclose this information, and we request that you 
notify us by reply mail or telephone and delete the original message from your 
mail system. 



----------------------------------------- The information contained in this 
communication (including any attachments hereto) is confidential and is 
intended solely for the personal and confidential use of the individual or 
entity to whom it is addressed. The information may also constitute a legally 
privileged confidential communication. If the reader of this message is not the 
intended recipient or an agent responsible for delivering it to the intended 
recipient, you are hereby notified that you have received this communication in 
error and that any review, dissemination, copying, or unauthorized use of this 
information, or the taking of any action in reliance on the contents of this 
information is strictly prohibited. If you have received this communication in 
error, please notify us immediately by e-mail, and delete the original message. 
Thank you

Reply via email to