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.

AddressingFor example, you can identify the address of a data area as an external symbol andload the A-type address constant specifying this symbol into a base register. Then,you use this base register when establishing the addressability of a dummy sectionthat describes this external data. You can now refer symbolically to the data thatthe external area contains.You must also identify, in the source module that contains the data area, theaddress of the data as an entry symbol.Branching to an external addressUse the V-type address constant to identify the external symbol that represents theaddress in an external source module that you want to branch to.For example, you can load into a register the V-type address constant thatidentifies the external symbol. Using this register, you can then branch to theexternal address represented by the symbol.If the symbol is the name entry of a START, CSECT, or RSECT instruction in theother source module, and thus names an executable control section, it isautomatically identified as an entry symbol. If the symbol represents an address inthe middle of a control section, you must identify it as an entry symbol for theexternal source module.You can also use a combination of an EXTRN instruction to identify, and an A-typeaddress constant to contain, the external branch address. However, the V-typeaddress constant is more convenient because:v You do not have to use an EXTRN instruction.v The external symbol you specify, can be used in the name entry of any otherstatement in the same source program.v It will work correctly even if the program is linked as an overlay module, solong as the reference is not to a symbol in an exclusive segment. See z/OS MVSProgram Management: User’s Guide and <strong>Ref</strong>erence, SA22-7643 for furtherinformation.The following example shows how you use an A-type address constant to containthe address of an external symbol that you identify in an EXTRN instruction. Youcannot use the external symbol name EXMOD1 in the name entry of any otherstatement in the source program...L 15,EX_SYM Load address of external symbolBASR 14,15 Branch to it..EX_SYM DC A(EXMOD1) Address of external symbolEXTRN EXMOD1 Identify EXMOD1 as external symbol..The following example shows how you use the symbol EXMOD1 as both the name ofan external symbol and a name entry on another statement...L 15,EX_SYM Load address of external symbolBASR 14,15 Branch to it..EXMOD1 DS 0H Using EXMOD1 as a name entry68 <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!