I don't think I've ever done this, but how about: ORG (*+7)/8*8
Suppose * happens to be 8m, a multiple of 8. Then, (*+7)/8 = m, so (*+7)/8*8 = 8m, the original value. Now suppose * is 8m +1. Then *+7 = 8m+8, (*+7)/8 = m+1, (*+7)/8*8 = 8m+8, a multiple of 8. For * = 8m+2, *+7 = 8m+9, (*+7)/8 = m+1, so again (*+7)/8*8 = 8m+8 That will be the result for all the remaining possible values of * from 8m+3 through 8m+7. The "magic" falls out of the integer arithmetic division which yields 0 for 7/8, 1 for 8/8 through 15/8. Bob Netzlof On 11/27/16, Charles Mills <[email protected]> wrote: > Yeah, I have done this in the past somehow with that kind of cleverness, > but > it looks like the fancy new three-operand ORG instruction is intended for > exactly this problem. > > (*+7)/8 can't be right -- you are dividing * by 8 which can't be right -- > but yes, I get the idea. > > Charles > > -----Original Message----- > From: IBM Mainframe Assembler List [mailto:[email protected]] > On Behalf Of Alan Atkinson > Sent: Sunday, November 27, 2016 5:21 PM > To: [email protected] > Subject: Re: Using ORG like CNOP > > I'm doing this from memory - I can't face logging in. > If I mess it up let me know and I'll pull one tomorrow from a listing. > > IIRC something like org (*+7)/8 will do it. > > > Sent from my iPad > >> On Nov 27, 2016, at 8:14 PM, Charles Mills <[email protected]> wrote: >> >> I have a DSECT where I want to define a fullword such that the next >> address after the fullword will be on a doubleword boundary. I would >> like the alignment to be independent of the preceding alignment (be > change-proof). >> >> CNOP 4,8 would do exactly what I want, but CNOP seems inappropriate in >> non-executable code. >> >> I naively coded ORG *,8,-4. As luck would have it the existing >> alignment was six bytes into a doubleword and so that ended up >> effectively > being ORG *-2. >> >> How do I use ORG to accomplish what I want? Can I use something like >> what I coded but always have it ORG forwards and never backwards? I >> could probably figure this out but hoped there was someone here who >> knew the answer right off. >> >> Or should I shut up and use CNOP: "If it ain't broke, don't fix it." >> >> Charles > -- Bob Netzlof a/k/a Sweet Old Bob
