22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Assembler <strong>Language</strong> Coding Conventions<br />

| An operation entry is mandatory, and it must appear on the same line as any<br />

| name entry.<br />

For machine and assembler instructions, it must be a valid symbol at assembly<br />

time (after substitution for variable symbols, if specified), consisting of 63 or<br />

fewer alphanumeric characters, the first which must be alphabetic. Most<br />

standard symbolic operation codes are five characters or fewer. For a<br />

description of machine instructions, see the applicable Principles of Operation<br />

manual. For a summary of assembler instructions, see Appendix A,<br />

“Assembler Instructions.”<br />

The standard set of codes can be changed by OPSYN instructions (see<br />

“OPSYN Instruction” on page 198).<br />

For macro instructions, the operation entry can be any valid symbol.<br />

An operation entry cannot be continued on the next statement.<br />

Operand Entries: Operand entries contain zero or more operands that identify<br />

and describe data to be acted upon by the instruction, by indicating such<br />

information as storage locations, masks, storage area lengths, or types of data.<br />

The following rules apply to operands:<br />

One or more operands are usually required, depending on the instruction.<br />

Operands must be separated by commas. No spaces are allowed between the<br />

operands and the commas that separate them.<br />

A space normally indicates the end of the operand entry, unless the operand is<br />

in single quotes. This applies to machine, assembler, and macro instructions.<br />

| A space does not end the operand in some types of SET statement. Spaces<br />

| that do not end operands are discussed further at:<br />

| – “Arithmetic (SETA) Expressions” on page 352<br />

| – “Logical (SETB) Expressions” on page 365<br />

| – “Character (SETC) Expressions” on page 371<br />

| There are two examples of operands containing spaces in Figure 10 on<br />

| page 26; the last box in Row 3, and the middle box in Row 4.<br />

| The alternative statement format uses slightly different rules. For more<br />

| information, see “Alternative Formats for a Macro Instruction” on page 298.<br />

The following instruction is correctly coded:<br />

LA R1,4+5 No space<br />

The following instruction may appear to be the same, but is not:<br />

LA R1,4 + 5 Spaces included<br />

In this example, the embedded space means that the operand finishes after “4.”<br />

There is no assembler error, but the result is a LA R1,4, which may not be what<br />

you intended.<br />

A space inside unquoted parentheses is an error, and leads to a diagnostic. The<br />

following instruction is correctly coded:<br />

DC CL(L'STRLEN)' ' Space within quotes<br />

The following instruction, with an extra space, is not correct:<br />

20 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!