I typically encapsulate such things in macros with a sensitivity to the 
architectural level. The downside is that it makes the macro more cluttered.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf 
of Jeremy Schwartz [0000115e2ee20c83-dmarc-requ...@listserv.uga.edu]
Sent: Thursday, November 25, 2021 2:11 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Base-less macros

Nice job and thanks for correction on branch to table. One thing to point out 
especially with mainframe assembly is just to be sure when generating 
instructions that the proper instruction facilities are installed other wise 
S0C1.

Best regards,
Jeremy
________________________________
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> on behalf 
of Seymour J Metz <sme...@gmu.edu>
Sent: Thursday, November 25, 2021 8:31 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
Subject: Re: Base-less macros

CAUTION: This message was sent from outside the company. Do not click links or 
open attachments unless you recognize the sender and know the content is safe.


It could be shorter, and  B BRTAB(R15) is not baseless. How about

         CIJL  R15,0,RC_MINUS
         CIJH  R15,MAXRC,RC_GT_MAX
         LARL  R14,BRTAN
         B     0(R14,R15)

How does the performance compare using BCTR R14,0 rather than the LARL? It's 
shorter, but is a suppressed branch.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf 
of Jeremy Schwartz [0000115e2ee20c83-dmarc-requ...@listserv.uga.edu]
Sent: Wednesday, November 24, 2021 8:44 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Base-less macros

Here's another form of branch table combining compare and branches.  Just 
thought it was interesting and one reason why I love assembler.  So many 
possibilities.

         XR         R0,R0                                       INCREMENT = 0
         LR          R1,R0
         BCTR     R1,0                                        SET COMPARE = -1
         JXLE      R15,R0,LBL_RC_MINUS       Label taken if <= -1
         LA         R1,MAX_RC                           SET COMPARE = MAX_RC
         JXH       R15,R0,LBL_RC_GT_MAX    Label taken if > MAX_RC
         B           BRTAB(R15)
BRTAB      DS 0H
         J        LABEL_RC0
         J        LABEL_RC4
         J        LABEL_RC8
         J        LABEL_RC12
-------------------------------------------
NOTICE:
This email and all attachments are confidential, may be proprietary, and may be 
privileged or otherwise protected from disclosure. They are intended solely for 
the individual or entity to whom the email is addressed. However, mistakes 
sometimes happen in addressing emails. If you believe that you are not an 
intended recipient, please stop reading immediately. Do not copy, forward, or 
rely on the contents in any way. Notify the sender and/or Imperva, Inc. by 
telephone at +1 (650) 832-6006 and then delete or destroy any copy of this 
email and its attachments. The sender reserves and asserts all rights to 
confidentiality, as well as any privileges that may apply. Any disclosure, 
copying, distribution or action taken or omitted to be taken by an unintended 
recipient in reliance on this message is prohibited and may be unlawful.
Please consider the environment before printing this email.

Reply via email to