11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

ORG instructionAACSECTX DS DY DS FBBCSECTORG Yis invalid, because the section containing the ORG statement (BB) is not the sameas the section in AA in which the ORG operand expression Y is defined.With the ORG statement, you can give two instructions the same location countervalues. In such a case, the second instruction does not always eliminate the effectsof the first instruction. Consider the following example:ADDR DC A(ADDR)ORG *−4B DC C’BETA’In this example, the value of B (’BETA’) is destroyed by the relocation of ADDRduring linkage editing.The following example shows some examples of ORG using the boundary andoffset operands:origin csectds 235x Define 235 bytesorg origin,,3 Move location counter back to start + 3org *,8 Align on 8 byte boundaryorg *,8,-2 Align to 8 byte boundary -2 bytestranslate dc cl256’ ’ Define aligned translate tableorg translate+c’a’dc c’ABCDEFGHI’org translate+c’j’dc c’JKLMNOPQR’org translate+c’s’dc c’STUVWXYZ’org translate+c’A’dc c’ABCDEFGHI’org translate+c’J’dc c’JKLMNOPQR’org translate+c’S’dc c’STUVWXYZ’org ,endUsing Figure 22 on page 202 as an example, to build a translate table (for example,to convert EBCDIC character code into some other internal code):1. Define the table (see ▌1▐ in Figure 22) as being filled with zeros.2. Use the ORG instruction to alter the location counter so that its counter valueindicates a specific location (see ▌2▐ in Figure 22) within the table.3. Redefine the data (see ▌3▐ in Figure 22) to be assembled into that location.4. After repeating the first three steps (see ▌4▐ in Figure 22) until your translatetable is complete, use an ORG instruction with a null operand field to alter thelocation counter. The counter value then indicates the next available location(see ▌5▐ in Figure 22) in the current control section (after the end of thetranslate table).Both the assembled object code for the whole table filled with zeros, and the objectcode for the portions of the table you redefined, are printed in the programlistings. However, the data defined later is loaded over the previously definedzeros and becomes part of your object program, instead of the zeros.Chapter 5. Assembler instruction statements 201

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

Saved successfully!

Ooh no, something went wrong!