Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Using L' to get length of instruction

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
WilliamDownie

New User


Joined: 01 Jul 2020
Posts: 3
Location: UK

PostPosted: Thu Jul 09, 2020 9:20 pm    Post subject: Using L' to get length of instruction
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: 860
Location: The Universe

PostPosted: Fri Jul 10, 2020 7:32 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BMS map length field greater than zero Ziko13 CICS 3 Fri Oct 09, 2020 5:40 pm
No new posts Problem getting record length of a re... amitc23 COBOL Programming 2 Thu Jul 02, 2020 10:52 pm
No new posts LA instruction in assembler janishyathi bonam PL/I & Assembler 4 Tue May 05, 2020 8:17 am
No new posts Variable length(Pipe delimter) to Fix... SreekanthMada DFSORT/ICETOOL 8 Mon Jan 06, 2020 4:44 pm
No new posts Increase the Maximum Length of LRECL ... Dhineshpondy7 JCL & VSAM 5 Wed Aug 07, 2019 6:23 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us