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.

Terms, literals, and expressionsTable 6. Assignment of length attribute values to symbols in name fieldsSource ModuleMACHA MVC TO,FROMMACHB L 3,ADCONMACHC LR 3,4Length Attribute<strong>Ref</strong>erenceL’MACHAL’MACHBL’MACHCValue of SymbolLength Attribute AtAssembly Time6 ▌1▐4 ▌1▐2 ▌1▐TO DS CL80FROM DS CL240ADCON DC A(OTHER)CHAR DC C’YUKON’DUPL DC 3F’200’RELOC1 EQU TO ▌3▐RELOC2 EQU TO+80 ▌3▐RELOC3 EQU TO,44 ▌3▐ABSOL1 EQU FROM-TO ▌3▐ABSOL2 EQU ABSOL1 ▌3▐SDT1 EQU 102 ▌3▐SDT2 EQU X’FF’+A−B ▌3▐SDT3 EQU C’YUK’ASTERISK EQU *+10 ▌3▐LOCTREF EQU L’* ▌3▐LENGTH1 DC A(L’*)L’TOL’FROML’ADCONL’CHARL’DUPLL’RELOC1L’RELOC2L’RELOC3L’ABSOL1L’ABSOL2L’SDT1L’SDT2L’SDT3L’ASTERISKL’LOCTREFL’*L’LENGTH180 ▌2▐240 ▌2▐4 ▌2▐5 ▌2▐4 ▌2▐8080442402401 ▌4▐1 ▌4▐1 ▌4▐1 ▌5▐1 ▌6▐1 ▌6▐4LENGTH2 MVC TO(L’*),FROMLENGTH3 MVC TO(L’TO−20),FROML’*L’TO6 ▌7▐80Note: Instructions that contain length attribute references L’SDT1, L’SDT2, L’SDT3,L’ASTERISK, and L’LOCTREF as shown in this figure may generate ASMA019W.The following example shows how to use the length attribute to move a characterconstant into either the high-order or low-order end of a storage field.A1 DS CL8B2 DC CL2’AB’HIORD MVC A1(L’B2),B2LOORD MVC A1+L’A1-L’B2(L’B2),B2A1 names a storage field 8 bytes in length and is assigned a length attribute of 8. B2names a character constant 2 bytes in length and is assigned a length attribute of 2.The statement named HIORD moves the contents of B2 into the first 2 bytes of A1.The term L'B2 in parentheses provides the length specification required by theinstruction.The statement named LOORD moves the contents of B2 into the rightmost 2 bytes ofA1. The combination of terms A1+L'A1-L'B2 adds the length of A1 to the beginningaddress of A1, and subtracts the length of B2 from this value. The result is theaddress of the seventh byte in field A1. The constant represented by B2 is movedinto A1 starting at this address. L'B2 in parentheses provides the lengthspecification in both instructions.For ease in following the preceding example, the length attributes of A1 and B2 arespecified explicitly in the DS and DC statements that define them. However, keepin mind that the L'symbol term makes coding such as this possible in situationswhere lengths are unknown. For example:Chapter 2. Coding and structure 39

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

Saved successfully!

Ooh no, something went wrong!