HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Part 1. Assembler Language—Structure and Concepts Symbol Length Attribute Reference . . . . . . . . . . . . . . . . . . . . . . . 38 Other Attribute References . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Literals, Constants, and Self-Defining Terms . . . . . . . . . . . . . . . . . 41 General Rules for Using Literals . . . . . . . . . . . . . . . . . . . . . . . . 42 Literal Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Rules for Coding Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Evaluation of Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Absolute and Relocatable Expressions . . . . . . . . . . . . . . . . . . . . 47 | Chapter 3. Program Structures and Addressing . . . . . . . . . . . . . . . . 50 | Object Program Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Source Program Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Source Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Beginning of a Source Module . . . . . . . . . . . . . . . . . . . . . . . . . 52 End of a Source Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 | Sections, Elements, and Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 | Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 First Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Unnamed Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Reference Control Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Dummy Control Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Common Control Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 External Dummy Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 | Classes (MVS and CMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 | Class Binding and Loading Attributes . . . . . . . . . . . . . . . . . . . . . 60 | Default Class Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 | Parts (MVS and CMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Location Counter Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Location Counter and Length Limits . . . . . . . . . . . . . . . . . . . . . . 62 Use of Multiple Location Counters . . . . . . . . . . . . . . . . . . . . . . . 63 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Addressing within Source Modules: Establishing Addressability . . . . . . . . 64 How to Establish Addressability . . . . . . . . . . . . . . . . . . . . . . . . . 64 Base Register Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Qualified Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Dependent Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Relative Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Literal Pools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Establishing Residence and Addressing Mode . . . . . . . . . . . . . . . . . . 68 Symbolic Linkages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Establishing symbolic linkage . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Referring to external data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Branching to an external address . . . . . . . . . . . . . . . . . . . . . . . . 69 Establishing an external symbol alias . . . . . . . . . . . . . . . . . . . . . 71 External Symbol Dictionary Entries . . . . . . . . . . . . . . . . . . . . . . . . 72 | Summary of Source and Object Program Structures . . . . . . . . . . . . . . 73 2 HLASM V1R5 Language Reference
Introduction Chapter 1. Introduction A computer can understand and interpret only machine language. Machine language is in binary form and, thus, very difficult to write. The assembler language is a symbolic programming language that you can use to code instructions instead of coding in machine language. Because the assembler language lets you use meaningful symbols made up of alphabetic and numeric characters, instead of just the binary digits 0 and 1 used in machine language, you can make your coding easier to read, understand, and change. The assembler must translate the symbolic assembler language into machine language before the computer can run your program. The specific procedures followed to do this may vary according to the system you are using. However, the method is basically the same for all systems: ┌───────────────────┐ │ Your assembler │ │ language source ├─────┐ │ statements │ │ └───────────────────┘ │ ▼ ┌───────────┴───────────┐ │ HIGH LEVEL ASSEMBLER │ └─────────┬───┬─────────┘ │ │ │ │ ┌──────────┐ │ │ ┌──────────────────┐ │ Messages │ │ │ │ Machine language │ │ and ├◄───────────┘ └──────────►┤ version of your │ │ listings │ │ program │ │ . │ └─────────┬────────┘ │ . │ │ └────┬─────┘ │ ▲ │ │ │ │ ┌─────────────────┐ │ │ │ LINKER ├◄─────────────┘ │ └──────┬───┬──────┘ │ │ │ │ │ │ ┌───────────────────┐ └──────────────────┘ └──────────►┤ Executable module │ └───────────────────┘ Figure 2. Assembling and Link-Editing Your Assembler Language Program Your program, written in the assembler language, becomes the source module that is input to the assembler. The assembler processes your source module and produces an object module in machine language (called object code). The object module can be used as input to be processed by the linker or the binder. The linker or binder produces a load module (MVS and CMS), or a phase (VSE), that can be loaded later into the main storage of the computer. When your program is loaded, it can then be run. Your source module and the object code produced are printed, along with other information, on a program listing. © Copyright IBM Corp. 1982, 2004 3
- Page 1: High Level Assembler for MVS & VM &
- Page 4 and 5: Note! Before using this information
- Page 6 and 7: Contents Source Module . . . . . .
- Page 8 and 9: Contents Ordinary USING Instruction
- Page 10 and 11: Contents Sublists in Operands . . .
- Page 12 and 13: About this Manual This manual descr
- Page 14 and 15: IBM High Level Assembler for MVS &
- Page 16 and 17: | The Internet. You can access IBM
- Page 18 and 19: ▌C▐ The item referred to by ▌
- Page 20 and 21: Miscellany The ASCII translation t
- Page 24 and 25: Language Compatibility Language Com
- Page 26 and 27: Assembler Program Assembler Program
- Page 28 and 29: Relationship of Assembler to Operat
- Page 30 and 31: Coding Made Easier Linkage between
- Page 32 and 33: Character Set Compatibility with Ea
- Page 34 and 35: Assembler Language Coding Conventio
- Page 36 and 37: Assembler Language Coding Conventio
- Page 38 and 39: Assembler Language Coding Conventio
- Page 40 and 41: Assembler Language Coding Conventio
- Page 42 and 43: Assembler Language Structure Condit
- Page 44 and 45: Assembler Language Structure Machin
- Page 46 and 47: Assembler Language Structure Condit
- Page 48 and 49: Terms, Literals, and Expressions Te
- Page 50 and 51: Terms, Literals, and Expressions -
- Page 52 and 53: Terms, Literals, and Expressions As
- Page 54 and 55: Terms, Literals, and Expressions Se
- Page 56 and 57: Terms, Literals, and Expressions Fo
- Page 58 and 59: Terms, Literals, and Expressions I
- Page 60 and 61: Terms, Literals, and Expressions Th
- Page 62 and 63: Terms, Literals, and Expressions 1.
- Page 64 and 65: Terms, Literals, and Expressions
- Page 66 and 67: Terms, Literals, and Expressions
- Page 68 and 69: Terms, Literals, and Expressions Th
- Page 70 and 71: | Chapter 3. Program Structures and
Introduction<br />
Chapter 1. Introduction<br />
A computer can understand and interpret only machine language. Machine<br />
language is in binary form and, thus, very difficult to write. The assembler<br />
language is a symbolic programming language that you can use to code<br />
instructions instead of coding in machine language.<br />
Because the assembler language lets you use meaningful symbols made up of<br />
alphabetic and numeric characters, instead of just the binary digits 0 and 1 used in<br />
machine language, you can make your coding easier to read, understand, and<br />
change. The assembler must translate the symbolic assembler language into<br />
machine language before the computer can run your program. The specific<br />
procedures followed to do this may vary according to the system you are using.<br />
However, the method is basically the same for all systems:<br />
┌───────────────────┐<br />
│ Your assembler │<br />
│ language source ├─────┐<br />
│ statements │ │<br />
└───────────────────┘ │<br />
▼<br />
┌───────────┴───────────┐<br />
│ HIGH LEVEL ASSEMBLER │<br />
└─────────┬───┬─────────┘<br />
│ │<br />
│ │<br />
┌──────────┐ │ │ ┌──────────────────┐<br />
│ Messages │ │ │ │ Machine language │<br />
│ and ├◄───────────┘ └──────────►┤ version of your │<br />
│ listings │ │ program │<br />
│ . │ └─────────┬────────┘<br />
│ . │ │<br />
└────┬─────┘<br />
│<br />
▲<br />
│<br />
│<br />
│<br />
│ ┌─────────────────┐ │<br />
│ │ LINKER ├◄─────────────┘<br />
│<br />
└──────┬───┬──────┘<br />
│ │ │<br />
│ │ │ ┌───────────────────┐<br />
└──────────────────┘ └──────────►┤ Executable module │<br />
└───────────────────┘<br />
Figure 2. Assembling and Link-Editing Your Assembler <strong>Language</strong> Program<br />
Your program, written in the assembler language, becomes the source module that<br />
is input to the assembler. The assembler processes your source module and<br />
produces an object module in machine language (called object code). The object<br />
module can be used as input to be processed by the linker or the binder. The<br />
linker or binder produces a load module (MVS and CMS), or a phase (VSE), that<br />
can be loaded later into the main storage of the computer. When your program is<br />
loaded, it can then be run. Your source module and the object code produced are<br />
printed, along with other information, on a program listing.<br />
© Copyright IBM Corp. 1982, 2004 3