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.

Substring notationMACRO&NAME MOVE &TO,&FROMLCLC&PREFIX&PREFIX SETC ’FIELD’ Statement 1&NAME ST 2,SAVEAREAL 2,&PREFIX&FROM Statement 2ST 2,&PREFIX&TO Statement 3L2,SAVEAREAMEND-------------------------------------------------------------------HERE MOVE A,B-------------------------------------------------------------------+HERE ST 2,SAVEAREA+ L 2,FIELDB+ ST 2,FIELDA+ L 2,SAVEAREAStatement 1 assigns the character value FIELD to the SETC symbol &PREFIX. Instatements 2 and 3, &PREFIX is replaced by FIELD.The following example shows how the value assigned to a SETC symbol may bechanged in a macro definition.MACRO&NAME MOVE &TO,&FROMLCLC&PREFIX&PREFIX SETC ’FIELD’ Statement 1&NAME ST 2,SAVEAREAL 2,&PREFIX&FROM Statement 2&PREFIX SETC ’AREA’ Statement 3ST 2,&PREFIX&TO Statement 4L2,SAVEAREAMEND-------------------------------------------------------------------HERE MOVE A,B-------------------------------------------------------------------+HERE ST 2,SAVEAREA+ L 2,FIELDB+ ST 2,AREAA+ L 2,SAVEAREAStatement 1 assigns the character value FIELD to the SETC symbol &PREFIX.Therefore, &PREFIX is replaced by FIELD in statement 2. Statement 3 assigns thecharacter value AREA to &PREFIX. Therefore, &PREFIX is replaced by AREA, instead ofFIELD, in statement 4.The following example uses the substring notation in the operand field of a SETCinstruction.MACRO&NAME MOVE &TO,&FROMLCLC&PREFIX&PREFIX SETC ’&TO’(1,5) Statement 1&NAME ST 2,SAVEAREAL 2,&PREFIX&FROM Statement 2ST2,&TOL2,SAVEAREAMEND-------------------------------------------------------------------HERE MOVE FIELDA,B-------------------------------------------------------------------+HERE ST 2,SAVEAREA+ L 2,FIELDB+ ST 2,FIELDA+ L 2,SAVEAREAChapter 9. How to write conditional assembly instructions 379

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

Saved successfully!

Ooh no, something went wrong!