For storage you obtain yourself (DXD and DSECT areas) you can of course get any
alignment you want for the start of the area with the STARTBDY macro option on
the various storage allocation macros. Then as long as the starting boundary
alignment is the same or higher than the alignment you want for your data, it
is fairly trivial to coerce the data into aligning the way you want it to. But
if you take the default virtual storage alignment (doubleword) then there's no
simple way to guarantee any alignment greater than that.
For program text you're at the mercy of whatever is supported by the binder and
contents supervision. The HLASM's SECTALGN option implies the ability to align
program text on arbitrary powers of 2 boundaries from 8 up to 4096 {n: 3...12
so that 2^n = desired alignment} so in theory SECTALGN(16) would do the trick.
However, that option is only available for GOFF objects and in any case (so far
as I know) the only alignment options that are actually supported by the binder
and z/OS contents supervision are doubleword (8 bytes) and page (4096 bytes)
Caveat: this may have changed in the relatively recent past. Now with that
caveat in place, the only way to achieve a quadword alignment for program text
would be to use the binder's PAGE directive to align the section to a page
boundary and then coerce the desired alignment within that section. I can't see
any particular reason to want quadword alignment for program text though.
CC
> Date: Tue, 3 Aug 2010 14:11:21 -0700
> From: [email protected]
> Subject: Re: quadword alignment
> To: [email protected]
>
> Using CNOP to achieve alignments greater than doubleword requires
> an appropriate SECTALGN option. Unfortunately, we don't have any
> quad-length or quad-aligning adcons, so that JD and QD align to
> doubleword boundaries and are 8 bytes long. XD items (external
> dummy sections) also require SECTALGN(16) if the DXD item requires
> quad alignment.
> John Ehrman
> (------------------ Referenced Note Follows --------------------)
> Date: 2 August 2010, 21:44:23 +0000
> From: IBM Mainframe Assembler List ASSEMBLE at INTERNET
>
> Why do you need this alignment and for what? I ask these questions
> because this issue is complicated. CNOP supports quadword alignment,
> and it can sometimes be used to do what one wants to do. Or again, QD
> and JD both specify quadword alignment implicitly. [But take care: xD
> certainly does not always do so.]
>
> John Gilmore Ashland, MA 01721-1817 USA