WilliamDownie
New User
Joined: 01 Jul 2020 Posts: 21 Location: UK
|
|
|
|
In a recent post ("TSO and the STAX Assembler Macro") steve-myers provided some code that included the following :
Code: |
CLI ATTNFLAG,X'FF' ATTENTION INTERRUPT?
BNE *+L'*+2 NO
SR 0,0
|
I would have coded the BNE as either:
or
I was intrigued by the use of the L'*, never having seen this before. Does this technique of using the Assembler to generate the length of an instruction have any other uses ? |
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
BC x,*+z
This has always had problems. The problem is calculating z. You see the idea in many IBM macros. SAVE, for example, the MF=I formats of macros with in line parameters like READ and WRITE, or even the STAX macro as used my little program. You don't often code MF=I, but you will see it as a default in IBM macros that provide MF=...
I'm sure I stole L'* from somewhere, but it does slightly simplify calculating z: you don't have to know the number of bytes in the BC instruction which eliminates one variable in z, you just need to know the number of bytes in the SR instruction. Something like
Code: |
BNE SKIPSR
SR 0,0
SKIPSR ... |
is safer, but it involves the extra label, which is also confusing.
20 years ago these in line parameter lists caused IBM some trouble. The first generation z/Architecture machines like the z/900 had a performance melt down if a macro stored data in the parameter list. It was so bad some customers wanted IBM to take the machines back! ISV vendors had to update some of their products |
|