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.

AddressingUSING ADATA,2- - -BDATA DS D Data in CLASS_BAddr_A DC A(ADATA)||A class specifying the “deferred load” (DEFLOAD) attribute on its defining CATTRstatement cannot be referenced from other classes using A-type or V-type addressconstants. However, A-type and V-type address constants may be used within adeferred-load class to refer to locations within that class or within any default_load(LOAD) class.The loading service for deferred-load classes will provide the origin address of thedeferred-load segment containing the classes. You can then use Q-type addressconstants in other classes to calculate the addresses of items in the loaded classes.For example:MYPROG CSECT ,CLASS_A CATTR RMODE(31)BASR 12,0 Set base registerUSING *,12 Addressability for this element- - -* Address of CLASS_B segment assumed to be returned in register 8- - -A 8,BDATAOff Add offset of BDATA in CLASS_BUSING BDATA,8- - -BDATAOff DC Q(BDATA) Offset of BDATA- - -CLASS_B CATTR DEFLOAD,RMODE(ANY) Define deferred-load class- - -BDATA DS F Data in deferred-load class|||Parts must always be referenced from LOAD classes using Q-type addressconstants using the techniques shown in this example, whether or not they residein deferred load classes. This is because parts are subject to reordering duringbinding. As noted above, parts may reference other parts in the same class usingA-type and V-type address constants.End of z/VM and z/OSBase register instructionsThe USING and DROP assembler instructions enable you to use expressionsrepresenting implicit addresses as operands of machine instruction statements,leaving the assignment of base registers and the calculation of displacements to theassembler.64 <strong>HLASM</strong>: <strong>V1R6</strong> <strong>Language</strong> <strong>Ref</strong>In order to use symbols in implicit addresses in the operand field of machineinstruction statements, you must:v Code a USING instruction to assign one or more base registers to a base addressor sequence of base addressesv Code machine instructions to load each base register with the base addressHaving the assembler determine base registers and displacements relieves you ofthe need to separate each address into an explicit displacement value and anexplicit base register value. This feature of the assembler eliminates a likely sourceof programming errors, thus reducing the time required to write and testprograms. You use the USING and DROP instructions to take advantage of thisfeature. For information about how to use these instructions, see “USINGinstruction” on page 216 and “DROP instruction” on page 171.

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

Saved successfully!

Ooh no, something went wrong!