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

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

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

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

Saved successfully!

Ooh no, something went wrong!