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.

Coding Made Easier<br />

– A control program<br />

– Storage allocation<br />

– Input and output facilities<br />

– Linker<br />

Coding Made Easier<br />

It can be very difficult to write an assembler language program using only machine<br />

instructions. The assembler provides additional functions that make this task<br />

easier. They are summarized below.<br />

Symbolic Representation of Program Elements<br />

Symbols greatly reduce programming effort and errors. You can define symbols to<br />

represent storage addresses, displacements, constants, registers, and almost any<br />

element that makes up the assembler language. These elements include<br />

operands, operand subfields, terms, and expressions. Symbols are easier to<br />

remember and code than numbers; moreover, they are listed in a symbol cross<br />

reference table, which is printed in the program listings. Thus, you can easily find a<br />

symbol when searching for an error in your code. See page 29 for details about<br />

symbols, and how you can use them in your program.<br />

Variety in Data Representation<br />

You can use decimal, binary, hexadecimal, or character representation of machine<br />

language binary values in writing source statements. You select the representation<br />

best suited to the purpose. The assembler converts your representations into the<br />

binary values required by the machine language.<br />

Controlling Address Assignment<br />

| If you code the correct assembler instruction, the assembler computes the relative<br />

| offset, or displacement from a base address, of any symbolic addresses you<br />

specify in a machine instruction. It inserts this displacement, along with the base<br />

register assigned by the assembler instruction, into the object code of the machine<br />

instruction.<br />

At execution time, the object code of address references must be in<br />

| relative-immediate or base-displacement form. The computer obtains the required<br />

address by adding the displacement to the base address contained in the base<br />

| register, or from the relative-immediate offset of the instruction.<br />

Relocatability<br />

The assembler produces an object module that is independent of the location it is<br />

initially assigned in virtual storage. That is, it can be loaded into any suitable virtual<br />

storage area without affecting program execution. This is made easier because<br />

most addresses are assembled in their base-displacement form.<br />

Sectioning a Program<br />

You can divide a source module into one or more control sections. After assembly,<br />

you can include or delete individual control sections from the resulting object<br />

module before you load it for execution. Control sections can be loaded separately<br />

into storage areas that are not contiguous. A discussion of sectioning is contained<br />

in “Source Program Structures” on page 51.<br />

Chapter 1. Introduction 9

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

Saved successfully!

Ooh no, something went wrong!