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.

DSECT instructionTo effect references to the storage area defined by a dummy section, do thefollowing:v Provide either:– An ordinary or labeled USING statement that specifies both a general registerthat the assembler can use as a base register for the dummy section, and avalue from the dummy section that the assembler may assume the registercontains, or– A dependent or labeled dependent USING statement that specifies asupporting base address (for which there is a corresponding ordinary USINGstatement) that lets the assembler determine a base register and displacementfor the dummy section, and a value from the dummy section that theassembler may assume is the same as the supporting base addressv Ensure that the base register is loaded with either:– The actual address of the storage area if an ordinary USING statement or alabeled USING statement was specified, or– The base address specified in the corresponding ordinary USING statement ifa dependent or labeled dependent USING statement was specified.The values assigned to symbols defined in a dummy section are relative to theinitial statement of the section. Thus, all machine instructions that refer to namesdefined in the dummy section refer, at execution time, to storage locations relativeto the address loaded into the register.Figure 21 shows an example of how to code the DSECT instruction. The samplecode is referred to as “Assembly-2”.Assume that two independent assemblies (Assembly-1 and Assembly-2) have beenloaded and are to be run as a single overall program. Assembly-1 is a routine that1. Places a record in an area of storage2. Places the address of the storage area in general register 33. Branches to Assembly-2 to process the recordThe storage area from Assembly-1 is identified in Assembly-2 by the dummycontrol section (DSECT) named INAREA. Parts of the storage area that you wantto work with are named INCODE, OUTPUTA, and OUTPUTB. The statementUSING INAREA,3 assigns general register 3 as the base register for the INAREADSECT. General register 3 contains the address of the storage area. Because thesymbols in the DSECT are defined relative to the beginning of the DSECT, theaddress values they represent are, at the time of program execution, the actualstorage locations of the storage area that general register 3 addresses.178 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>

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

Saved successfully!

Ooh no, something went wrong!