You can't have a negative displacement on an RS or RX instruction. It's a 12 bit unsigned field, padded with zeros on the left.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 עַם יִשְׂרָאֵל חַי נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר ________________________________________ From: IBM Mainframe Assembler List <[email protected]> on behalf of Tony Harminc <[email protected]> Sent: Tuesday, February 10, 2026 8:47 PM To: [email protected] <[email protected]> Subject: Re: Move data to a location prior to a given (based) address External Message: Use Caution A few comments. 1) Rule number 1: Don't lie to the assembler. I think that even though you may get it to work, having the possibility of a register pointing to different places in a DSECT is going to cause you grief sooner or later. And certainly will cause grief to the next person who works on the code. Usually you don't change the value of a register that you've used in a USING statement. The typical use case for doing so is when you step through a chain or array of identical data structures mapped by a DSECT. I don't think that's what you are proposing here. 2) I suspect that you are confused on how USING works. In particular, while it's not strictly wrong to have a USING in your DSECT, you should be aware that a USING takes effect at its position in the source module, and ends either at the end or when you issue a matching DROP or another USING that replaces the earlier one. Positioning it as you have suggests that you think that position is somehow related to addressing fields in that DSECT. It's not. 3) There are three kinds of instruction that can effectively use negative displacements. The most straightforward are the "modern" ones that have a 20-bit signed displacement, and are mostly part of the long-displacement facility, and mostly have mnemonics ending in Y. If, in your example, you had R10 pointing to say TXTSSTRG, you could use this kind of instruction to address fields both before and after that field. There are Y versions of many of the classic RX instructions. But note that there are no 20-bit versions of the SS ones like CLC and MVC. These are already 6 byte instructions and there's nowhere to put a larger displacement field, let alone two. Second are the relative instructions that also use a signed displacement to address a field relative to the current instruction address. There is no register involved with resolving the address, so these won't help you in dealing with a DSECT or any fields that don't have an offset from your instructions that isn't known at assembly (or in some cases binder) time. Third are the old original RX instructions such as L and LA. While their addressing arithmetic is unsigned, the effect of specifying a negative number as the displacement produces the same result as signed arithmetic would, and so it is possible to effectively subtract a constant from the sum of base+index+displacement if the index (or base) is negative. Again, I doubt that this technique is going to be useful or easy to write (and read). A negative offset isn't going to work on an MVC instruction, because there is only a base register (or two), and that is needed to point to the data. If an AI suggested this, well... don't pay too much attention. Overall I'm still not sure what you're trying to accomplish here. Can you give a brief example of the two (or more?) kinds of calls to your routine? Tony H.
