Dave's z/Architecture assembler tips


Attend conference sessions


There have been many good sessions for S/390 Assembler programmers at the various SHARE conferences. Here are a few that I've been to that I recommend: Perhaps you can locate one of these sessions on a CDROM or go to a future session.


Subscribe to the IBM mainframe Assembler Mailing List or newsgroup



Misc S/390 assembler tips


gottfried.wimmer @ dsi.at sent me his Assembler tips:
  • SLR to clear Regs (should be the fastest Instr.) .... but you the Cond code is set (la rx,0 preserves it).
  • MVCL to clear dynamic storage
  • it's a good practice to code all variables in an instream macro (esp. for RENT-Programming)
  • NEVER use things like MVC ABC+4(5),=c'ABCDEF'
  • I try to use the symbolic capabilities of the (H-) Compiler, i.e. to compute the LRECL of an outputfile based on the length of a structure:
    rl   dc   al2(rle-rl,0)
    f1   dc   cl20' '
    f2   dc   10xl2'00'
    f3   dc   pl5'0'
    rle  equ  *
        .....
    Out  dcb  dsorg=ps,ddname=o,macrf=gm,lrecl=rle-rl
    
Maybe I should have put it in the S/390 assembler FAQ style entry...


Use a REXX exec to quickly find macros


Instead of doing individual searches on each of your various macro libraries, modify the following exec for an easy search facility:
FINDMAC IECSDSL1
Here is the findmac source.


Convert "BC" to Extended Mnemonics easier


A guy I know writes brilliant Assembler code, I don't come anywhere close. He does one thing that makes his code hard to follow for us mortals, he doesn't use Extended Mnemonics for branching. I've written an ISPF edit macro called IEFBR549 that shows the Extended Mnemonics for BC (branching) instructions. Here are some sample ISPF editor lines with the inserted info lines:

 014700          LTR   R15,R15                  SUCESSFUL?
 014800          BC    8,CHKAUTH                YES, CHECK FOR USER AUTHORITY
 ======          BZ    CHKAUTH        After Test Under Mask
 ======          BZ    CHKAUTH      * After Arithmetic Instructions
 ======          BE    CHKAUTH        After Compare Instructions
 014900          MVC   PUTLINE(L'$CON006),$CON006 COPY STAX ERROR MSG
 015000          SLR   R15,R15                  SELECT LINE PRINT ROUTINE
 015100          BAL   R14,$PRINT               PRINT ERROR MSG.
 015200          BC    15,FINISH                EXIT
 ======          B     FINISH       * General
I show all known types of branches based on the condition code. and attempt to flag the one I think is the right one but you should verify the instruction type. Please look at the disclaimers in the source code before using this ISPF edit macro.


An Assembler Programmer's view of Linux for S/390 and zSeries New [2006-01-01]


Share presentation: Session 8139 (PDF) By David Bond of Tachyon Software LLC.





S/390 is a registered trademark of IBM.
If you find this page useful, you may also want to check out IBM's HLASM web site

BC 15,Dave's HLASM web page.

Dave's S/390 Assembler tips web page IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.



Last Updated: 2006-01-01
This web page is © 1997-2006+ by David Alcock. All Rights Reserved.