IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using L' to get length of instruction


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
WilliamDownie

New User


Joined: 01 Jul 2020
Posts: 21
Location: UK

PostPosted: Thu Jul 09, 2020 9:20 pm
Reply with quote

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:
Code:
         BNE   *+4+2

or
Code:
         BNE   *+6

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 ?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Jul 10, 2020 7:32 pm
Reply with quote

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
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts NI AND IMMEDIATE instruction PL/I & Assembler 2
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top