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

New User

Joined: 01 Jul 2020
Posts: 18
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 :

         BNE   *+L'*+2             NO
         SR    0,0

I would have coded the BNE as either:
         BNE   *+4+2

         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

Active Member

Joined: 30 Nov 2013
Posts: 895
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
         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 create table with more than 32k recor... DB2 1
No new posts COBOL Table data to a flat file with ... COBOL Programming 9
No new posts Getting OUTREC - SHORT REC error for ... DFSORT/ICETOOL 12
This topic is locked: you cannot edit posts or make replies. Assembler - Packed Decimals - PACK in... PL/I & Assembler 3
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 2
Search our Forums:

Back to Top