22.02.2015 Views

HLASM Language Reference

HLASM Language Reference

HLASM Language Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ORG Instruction<br />

►►──┬────────┬──ORG─────────────────────────────────────────────────►<br />

└─symbol─┘<br />

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

| └─expression──┬────────────────────────────────┬─┘<br />

| └─,──┬─boundary──┬───────────┬─┬─┘<br />

| │ └─,──offset─┘<br />

│<br />

| └─,──offset───────────────┘<br />

symbol<br />

is one of the following:<br />

An ordinary symbol<br />

A variable symbol that has been assigned a character string with a value<br />

that is valid for an ordinary symbol<br />

A sequence symbol<br />

If symbol denotes an ordinary symbol, the ordinary symbol is defined with the<br />

value that the location counter had before the ORG statement is processed.<br />

expression<br />

is a relocatable expression, the value of which is used to set the location<br />

counter. If expression is omitted, the location counter is set to the next<br />

available location for the current control section.<br />

| boundary<br />

| is an absolute expression that must be a power of 2 with a range from 8<br />

| (doubleword) to 4096 (page). If boundary exceeds the SECTALGN value,<br />

| message ASMA500E is issued.<br />

| offset<br />

| Any absolute expression<br />

| If boundary or offset are provided, then the resultant location counter is calculated<br />

| by rounding the expression up to the next higher boundary and then adding the<br />

| offset value.<br />

In general, symbols used in expression need not have been previously defined.<br />

However, the relocatable component of expression (that is, the unpaired relocatable<br />

term) must have been previously defined in the same control section in which the<br />

ORG statement appears, or be equated to a previously defined value.<br />

A length attribute reference to the name of a ORG instruction is always invalid.<br />

Message ASMS042E is issued, and a default value of 1 is assigned.<br />

An ORG statement cannot be used to specify a location below the beginning of the<br />

control section in which it appears. For example, the following statement is not<br />

correct if it appears less than 500 bytes from the beginning of the current control<br />

section.<br />

ORG<br />

–5<br />

This is because the expression specified is negative, and sets the location counter<br />

to a value larger than the assembler can process. The location counter wraps<br />

around (the location counter is discussed in detail in “Location Counter” on<br />

page 36).<br />

Chapter 5. Assembler Instruction Statements 201

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

Saved successfully!

Ooh no, something went wrong!