11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

QualifiedDependentaddressingQualified addressing lets you use the same symbol to refer to data in differentstorage locations. Qualified symbols are simply ordinary symbols prefixed by asymbol qualifier and a period. A symbol qualifier is used to specify which baseregister the assembler should use when converting an implicit address into itsexplicit base-displacement form. Before you use a symbol qualifier, you must havepreviously defined it in the name entry of a labeled USING instruction. Forinformation about labeled USING instructions, see “USING instruction” on page216. When defined, you can use a symbol qualifier to qualify any symbol thatnames a storage location within the range of the labeled USING. Qualified symbolsmay be used anywhere a relocatable term may be used.The following examples show the use of qualified symbols. SOURCE and TARGET areboth symbol qualifiers previously defined in two labeled USING instructions. Xand Y are both symbols that name storage locations within the range of bothlabeled USING instructions.MVCMVCXCLATARGET.X,SOURCE.XTARGET.Y+5(3),SOURCE.Y+5TARGET.X+10(L’X-10),TARGET.X+102,SOURCE.YAddressingaddressingDependent addressing lets you minimize the number of base registers required torefer to data by making greater use of established addressability. For example, youmay want to describe the format of a table of data defined in your source modulewith a dummy control section (see “Dummy control sections” on page 55). To referto the data in the table using the symbols defined in the dummy section, you needto establish the addressability of the dummy section. To do this you must:v Code a USING instruction to assign one or more base registers to a base addressv Code machine instructions to load each base register with the base addressHowever, dependent addressing offers an alternative means of establishingaddressability of the dummy section.When you have established addressability of the control section in which the tableis defined, you can establish addressability of the dummy section by simply codinga USING statement which specifies the name of the dummy section and theaddress of the table. When you subsequently refer to the symbols in the dummysection, the assembler makes use of the already established addressability of thecontrol section when converting the symbolic addresses into theirbase-displacement form.For example, suppose addressability has been established for a control sectioncontaining a data structure that is mapped by a dummy control section:DATAMAP DSECT , DSECT describing data structureFIELD1 DS FFIELD2 DS CL32FIELD3 DS CL24- - -CODE CSECT , Program codeBASR 12,0 Set base registerUSING *,12 Provide addressability- - -USING DATAMAP,REALDATA Map DSECT onto REALDATAL 2,FIELD1 Register 12 is base registerLA 3,FIELD3 Address of DATA3- - -Chapter 3. Program structures and addressing 65

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

Saved successfully!

Ooh no, something went wrong!