If I have to support really old boxen then I encapsulate alternate code sequences in a macro. That approach does require some configuration control if a shop has a mix of old and new. I don't expect to see anybody running production on a box too old to have long displacements.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Assembler List [[email protected]] on behalf of Dave Clark [[email protected]] Sent: Friday, March 4, 2022 12:01 PM To: [email protected] Subject: Long Displacement Facility (was: Fun with RXSBG) "IBM Mainframe Assembler List" <[email protected]> wrote on 03/03/2022 05:22:52 PM: > Not counting any branch following the determination, I had > previously managed to trim this down to three instructions. For > example, to determine if a prospective insertion crosses a 4 K-byte boundary: > 1. LAY S,-1(L,P) where "S" is a scratch register. > 2. XR S,P determine the difference > 3. NILF S,X'FFFFF000' Turn off insignificant bits. The second operand of the first instruction in this sequence caught my eye -- having not seen negative displacements -- before but immediately appreciating its applications. So, I first thought I would ask what are the benefits of doing it that way as opposed to the following more traditional approach (other than the obvious of simply "one less instruction")? LA S,0(L,P) AHI S,-1 Secondly... I missed the Y the first time and tried testing the following. That, of course, generated a syntax error (invalid displacement). LA S,-1(L,P) So, I looked at the original email again and did some research into the LAY instruction. That is when I read about the Long Displacement Facility (LDF) having to be installed for this instruction to work (otherwise: operation exception). So, other than just trying it, how would I determine if the box we are on (2818) has the LDF? Further, if developing software for distribution, is it best to avoid using the "newer," fancier instructions and just stick with the more traditional approaches? Sincerely, Dave Clark -- int.ext: 91078 direct: (937) 531-6378 home: (937) 751-3300 Winsupply Group Services 3110 Kettering Boulevard Dayton, Ohio 45439 USA (937) 294-5331 ********************************************************************************************* This email message and any attachments is for use only by the named addressee(s) and may contain confidential, privileged and/or proprietary information. If you have received this message in error, please immediately notify the sender and delete and destroy the message and all copies. All unauthorized direct or indirect use or disclosure of this message is strictly prohibited. No right to confidentiality or privilege is waived or lost by any error in transmission. *********************************************************************************************
