Dan,

While I disagree with the original poster, you are not talking about the same thing he is.

He is specifically talking only about 'EQU *'. You have expanded that to any 'EQU' usage.

Tony Thigpen

Dan Greiner wrote on 08/01/2018 02:23 PM:
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).


Reply via email to