HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

DS Instruction USING DSECTA,14 ALBL1 USING DSECTA,14 USING DSECTB,ALBL1.A . . ALBL2 USING DSECTA,ALBL1.A . BLBL1 USING DSECTA,ALBL2.A+4 . DROP ALBL2 . DSECTA DSECT A DS A DSECTB DSECT B DS A A DROP instruction is not needed: If the base address is being changed by a new ordinary USING instruction, and the same base register is assigned. However, the new base address must be loaded into the base register by an appropriate sequence of instructions. If the base address is being changed by a new labeled USING instruction or a new labeled dependent USING instruction, and the same USING label is assigned; however, the correct base address must be loaded into the base register specified in the USING instruction by an appropriate sequence of instructions. At the end of a source module DS Instruction The DS instruction: Reserves areas of storage Provides labels for these areas Uses these areas by referring to the symbols defined as labels If a control section has not previously been established, DS will initiate an unnamed (private) control section ┌─,───────┐ ►►──┬────────┬──DS─── ▼ ─operand─┴────────────────────────────────────►◄ └─symbol─┘ symbol is one of the following: An ordinary symbol A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol A sequence symbol If symbol denotes an ordinary symbol, the ordinary symbol represents the address of the first byte of the storage area reserved. If several operands are 174 HLASM V1R5 Language Reference

DS Instruction specified, the first storage area defined is addressable by the ordinary symbol. The other storage areas can be reached by relative addressing. operand is an operand of six subfields. The first five subfields describe the attributes of the symbol. The sixth subfield provides the nominal values that determine the implicit lengths; however no constants are generated. A DS operand has this format: ►►──┬────────────────────┬──type──┬────────────────┬────────────────► └─duplication_factor─┘ └─type_extension─┘ ►──┬──────────────┬──┬──────────┬──nominal_value───────────────────►◄ | └─program_type─ ┘ └─modifier─┘ The format of the DS operand is identical to that of the DC operand; exactly the same subfields are used and are written in exactly the same sequence as they are in the DC operand. For more information about the subfields of the DC instruction, see “DC Instruction” on page 126. Unlike the DC instruction, the DS instruction causes no data to be assembled. Therefore, you do not have to specify the nominal value (sixth subfield) of a DS instruction operand. The DS instruction is the best way of symbolically defining storage for work areas, input/output buffers, etc. Although the formats are identical, there are two differences in the specification of subfields. They are: The nominal value subfield is optional in a DS operand, but it is mandatory in a DC operand. If a nominal value is specified in a DS operand, it must be valid. The maximum length that can be specified for the character (C) and hexadecimal (X) type areas is 65,535 bytes rather than 256 bytes for the same DC operands. The maximum length for the graphic (G) type is 65,534 bytes. If symbol denotes an ordinary symbol, the ordinary symbol, as with the DC instruction: Has an address value of the first byte of the area reserved, after any boundary alignment is done Has a length attribute value, depending on the implicit or explicit length of the type of area reserved If the DS instruction is specified with more than one operand or more than one nominal value in the operand, the label addresses the area reserved for the field that corresponds to the first nominal value of the first operand. The length attribute value is equal to the length explicitly specified or implicit in the first operand. Bytes Skipped for Alignment: Unlike the DC instruction, bytes skipped for alignment are not set to zero. Also, nothing is assembled into the storage area reserved by a DS instruction. No assumption should be made as to the contents of the skipped bytes or the reserved area. Chapter 5. Assembler Instruction Statements 175

DS Instruction<br />

specified, the first storage area defined is addressable by the ordinary symbol.<br />

The other storage areas can be reached by relative addressing.<br />

operand<br />

is an operand of six subfields. The first five subfields describe the attributes of<br />

the symbol. The sixth subfield provides the nominal values that determine the<br />

implicit lengths; however no constants are generated.<br />

A DS operand has this format:<br />

►►──┬────────────────────┬──type──┬────────────────┬────────────────►<br />

└─duplication_factor─┘<br />

└─type_extension─┘<br />

►──┬──────────────┬──┬──────────┬──nominal_value───────────────────►◄<br />

| └─program_type─ ┘ └─modifier─┘<br />

The format of the DS operand is identical to that of the DC operand; exactly the<br />

same subfields are used and are written in exactly the same sequence as they are<br />

in the DC operand. For more information about the subfields of the DC instruction,<br />

see “DC Instruction” on page 126.<br />

Unlike the DC instruction, the DS instruction causes no data to be assembled.<br />

Therefore, you do not have to specify the nominal value (sixth subfield) of a DS<br />

instruction operand. The DS instruction is the best way of symbolically defining<br />

storage for work areas, input/output buffers, etc.<br />

Although the formats are identical, there are two differences in the specification of<br />

subfields. They are:<br />

The nominal value subfield is optional in a DS operand, but it is mandatory in a<br />

DC operand. If a nominal value is specified in a DS operand, it must be valid.<br />

The maximum length that can be specified for the character (C) and<br />

hexadecimal (X) type areas is 65,535 bytes rather than 256 bytes for the same<br />

DC operands. The maximum length for the graphic (G) type is 65,534 bytes.<br />

If symbol denotes an ordinary symbol, the ordinary symbol, as with the DC<br />

instruction:<br />

Has an address value of the first byte of the area reserved, after any boundary<br />

alignment is done<br />

Has a length attribute value, depending on the implicit or explicit length of the<br />

type of area reserved<br />

If the DS instruction is specified with more than one operand or more than one<br />

nominal value in the operand, the label addresses the area reserved for the field<br />

that corresponds to the first nominal value of the first operand. The length attribute<br />

value is equal to the length explicitly specified or implicit in the first operand.<br />

Bytes Skipped for Alignment: Unlike the DC instruction, bytes skipped for<br />

alignment are not set to zero. Also, nothing is assembled into the storage area<br />

reserved by a DS instruction. No assumption should be made as to the contents of<br />

the skipped bytes or the reserved area.<br />

Chapter 5. Assembler Instruction Statements 175

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!