HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Alignment of constants

HLASM Language Reference
SC26-4940-06

The assembler aligns constants on different boundaries according to the following:
  • On boundaries implicit to the type of constant (see "Implicit Boundary Alignment" in Table 2) when no length is specified.
  • On byte boundaries (see "Boundary Alignment" in Table 2) when an explicit length is specified.
Bytes that are skipped to align a constant at the correct boundary are not considered part of the constant. They are filled with binary zeros.
Notes:
  1. The automatic alignment of constants and areas does not occur if the NOALIGN assembler option has been specified.
  2. Alignment can be forced to any boundary by a preceding DS or DC instruction with a zero duplication factor. This occurs whether or not the ALIGN option is set.
Table 1. Length attribute value of symbol naming constants

Type of
constant

Implicit
Length

Examples

Value of Length
Attribute¹

B as needed DC B'10010000' 1



CU

as needed 

as needed

DC  C'ABC'
DC  CL8'WOW'
DC  CU'ABC'
DC  CUL4'XX'

3
8
6
4

G as needed

DC  G'<DaDb>'
DC  GL8'<DaDb>'

4
8

X as needed

DC  X'COFFEE'
DC  XL2'FFEE'

3
2

H
F
FD

2
4
8

DC  H'32'
DC  FL3'32'
DC  FD'32'

2
3
8

P

Z

as needed 

as needed

DC  P'123'
DC  PL4'123'
DC  Z'123'
DC  ZL10'123'

2
4
3
10

E
D
L
LQ

4
8
16
16

DC  E'565.40'
DC  DL6'565.40'
DC  LL12'565.40'
DC  LQ'565.40'

4
6
12
16

Y
A
AD

2
4
8

DC  Y(HERE)
DC  AL1(THERE)
DC  AD(WHERE)

2
1
8

S
V
VD
J
JD
Q
QD
RD

2
4
8
4
4
8
4
8

DC  S(THERE)
DC  VL3(OTHER)
DC  VD(BIGOTHER)
DC  J(CLASS)
DC  JD(LARGECLASS)
DC  QL1(LITTLE)
DC  QD(BIGLITTLE)
DC  R(APSECT)
DC  RD(BPSECT)

2
3
8
4
8
1
8
4
8

Note:
  1. Depends on whether an explicit length is specified in the constant.
Table 2. Alignment of constants
Type of constant

Implicit
Boundary
Alignment

Examples Boundary Alignment¹
B byte DC B'1011' byte

C
CU

byte
byte

DC  C'Character string'
DC  CU'Character string'

byte
byte

G byte DC G'<.D.B.C.S .S.T.R.I.N.G> byte
X byte DC X'20202021202020' byte

H

F

FD

halfword

fullword

doubleword

DC  H'25'
DC  HL3'25'
DC  F'225'
DC  FL7'225'
DC  FD'225'

halfword
byte
fullword
byte
doubleword

P
Z

byte
byte

DC  P'2934'
DC  Z'1235'
DC  ZL2'1235'

byte
byte
byte





L
LQ

fullword 

doubleword 

doubleword
quadword

DC  E'1.25'
DC  EL5'1.25'
DC  8D'95'
DC  8DL7'95'
DC  L'2.57E65'
DC  LQ'0.1'

fullword
byte
doubleword
byte
doubleword
quadword

Y
A
AD
S

V

VD
J
JD
Q
QD
R
RD

halfword
fullword
doubleword
halfword

fullword

doubleword
fullword
doubleword
fullword
doubleword
fullword
doubleword

DC  Y(HERE)
DC  AL1(THERE)
DC  AD(WHERE)
DC  S(LABEL)
DC  SL2(LABEL)
DC  V(EXTERNAL)
DC  VL3(EXTERNAL)
DC  VD(BIGOTHER)
DC  J(CLASS)
DC  JD(LARGECLASS)
DC  QL1(DUMMY)
DC  QD(BIGDUMMY)
DC  R(APSECT)
DC  RD(BPSECT)

halfword
byte
doubleword
halfword
byte
fullword
byte
doubleword
fullword
doubleword
byte
doubleword
fullword
doubleword

Note:
  1. Depends on whether an explicit length is specified in the constant.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014