HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Concatenation of strings containing double-byte data: If the assembler is invoked with the DBCS option, then the following additional considerations apply: When a variable symbol adjoins double-byte data, the SO delimiting the double-byte data is not a valid delimiter of the variable symbol. The variable symbol must be terminated by a period. The assembler checks for SI and SO at concatenation points. If the byte to the left of the join is SI and the byte to the right of the join is SO, then the SI/SO pair are considered redundant and are removed. To create redundant SI/SO pairs at concatenation points, use the substring notation and SETC expressions to create additional SI and SO characters. By controlling the order of concatenation, you can leave a redundant SI/SO pair at a concatenation point. Instead of substring notation, you can use the BYTE function to create additional SI and SO characters: &SO SETC (BYTE 14) &SI SETC (BYTE 15) Examples: &DBDA SETC '' &SO SETC BYTE(X'E') &SI SETC BYTE(X'F') &DBCS1A SETC '&DBDA.' &DBCS1E SETC '&DBDA' &DBCS2 SETC '&DBDA'.'' &DBCS2A SETC '&DBDA'.''.'&DBDA' &DBCS3 SETC '&DBDA'.'&SI'.'&SO'.'' &DBCS3P SETC '&DBDA'.'&SI' &DBCS3Q SETC '&SO'.'' &DBCS3R SETC '&DBCS3P'.'&DBCS3Q' These examples use the BYTE function to create variables &SO and &SI, which have the values of SO and SI, respectively. The variable &DBCS1A is assigned the value with the SI/SO pair at the join removed. The assignment to variable &DBCS1E fails with error ASMA35E Invalid delimiter, because the symbol &DBDA is terminated by SO and not by a period. The variable &DBCS2 is assigned the value . The variable &DBCS2A is assigned the value . As with &DBCS1A, redundant SI/SO pairs are removed at the joins. The variable &DBCS3 is assigned the value . Although SI and SO have been added at the join, the concatenation operation removes two SI and two SO characters, since redundant SI/SO pairs are found at the second and third concatenations. However, by using intermediate variables &DBCS3P and &DBCS3Q to change the order of concatenation, the string can be assigned to variable &DBCS3R. Note that substituting the variable symbol &DBCS3R in the nominal value of a G-type constant results in removal of the SI/SO pair at the join. Using SETC Symbols The character value assigned to a SETC symbol is substituted for the SETC symbol when it is used in the name, operation, or operand field of a statement. For example, consider the following macro definition, macro instruction, and generated statements: 384 HLASM V1R5 Language Reference
MACRO &NAME MOVE &TO,&FROM LCLC &PREFIX &PREFIX SETC 'FIELD' Statement 1 &NAME ST 2,SAVEAREA L 2,&PREFIX&FROM Statement 2 ST 2,&PREFIX&TO Statement 3 L 2,SAVEAREA MEND ------------------------------------------------------------------- HERE MOVE A,B ------------------------------------------------------------------- +HERE ST 2,SAVEAREA + L 2,FIELDB + ST 2,FIELDA + L 2,SAVEAREA Statement 1 assigns the character value FIELD to the SETC symbol &PREFIX. In statements 2 and 3, &PREFIX is replaced by FIELD. The following example shows how the value assigned to a SETC symbol may be changed in a macro definition. MACRO &NAME MOVE &TO,&FROM LCLC &PREFIX &PREFIX SETC 'FIELD' Statement 1 &NAME ST 2,SAVEAREA L 2,&PREFIX&FROM Statement 2 &PREFIX SETC 'AREA' Statement 3 ST 2,&PREFIX&TO Statement 4 L 2,SAVEAREA MEND ------------------------------------------------------------------- HERE MOVE A,B ------------------------------------------------------------------- +HERE ST 2,SAVEAREA + L 2,FIELDB + ST 2,AREAA + L 2,SAVEAREA Statement 1 assigns the character value FIELD to the SETC symbol &PREFIX. Therefore, &PREFIX is replaced by FIELD in statement 2. Statement 3 assigns the character value AREA to &PREFIX. Therefore, &PREFIX is replaced by AREA, instead of FIELD, in statement 4. The following example uses the substring notation in the operand field of a SETC instruction. Chapter 9. How to Write Conditional Assembly Instructions 385
- Page 354 and 355: Data Attributes The scale attribute
- Page 356 and 357: Data Attributes Number Attribute (N
- Page 358 and 359: Data Attributes The operation code
- Page 360 and 361: Lookahead MACRO &NAME MOVE &TO,&FRO
- Page 362 and 363: Open Code Sequence Symbols The cond
- Page 364 and 365: GBLA, GBLB, and GBLC Instructions G
- Page 366 and 367: LCLA, LCLB, and LCLC Instructions s
- Page 368 and 369: SETA Instruction expression is an a
- Page 370 and 371: SETA Instruction | The logical-exp
- Page 372 and 373: SETA Instruction | Figure 99 (Page
- Page 374 and 375: SETA Instruction | The result of C2
- Page 376 and 377: SETA Instruction NOT Format: Logica
- Page 378 and 379: SETA Instruction | X2A Name Operati
- Page 380 and 381: SETA Instruction In evaluating the
- Page 382 and 383: SETB Instruction Any expression tha
- Page 384 and 385: SETB Instruction ┌─────
- Page 386 and 387: SETB Instruction | ISDEC | Format:
- Page 388 and 389: SETB Instruction The two comparands
- Page 390 and 391: SETC Instruction Notes: 1. The asse
- Page 392 and 393: Figure 103. Substring Notation in C
- Page 394 and 395: Loc Object Code Addr1 Addr2 Stmt So
- Page 396 and 397: | B2C('111111') has value '3' | B2C
- Page 398 and 399: | Output: D2B('decstring') converts
- Page 400 and 401: SIGNED Format: Logical-expression,
- Page 402 and 403: | X2D('') has value '+' | X2D('91')
- Page 406 and 407: MACRO &NAME MOVE &TO,&FROM LCLC &PR
- Page 408 and 409: SETAF Instruction Alternative State
- Page 410 and 411: Branching Branching You can control
- Page 412 and 413: AGO Instruction The extended AIF in
- Page 414 and 415: ACTR Instruction AGOB—Synonym of
- Page 416 and 417: ANOP Instruction statement processe
- Page 418 and 419: MHELP Instruction MHELP B'10000000'
- Page 420 and 421: 400 HLASM V1R5 Language Reference
- Page 422 and 423: Assembler Instructions and Statemen
- Page 424 and 425: Assembler Instructions and Statemen
- Page 426 and 427: Assembler Instructions and Statemen
- Page 428 and 429: Summary of Constants Figure 113. Su
- Page 430 and 431: Macro and Conditional Assembly Lang
- Page 432 and 433: Macro and Conditional Assembly Lang
- Page 434 and 435: Macro and Conditional Assembly Lang
- Page 436 and 437: Macro and Conditional Assembly Lang
- Page 438 and 439: Macro and Conditional Assembly Lang
- Page 440 and 441: Macro and Conditional Assembly Lang
- Page 442 and 443: Standard Character Set Code Table H
- Page 444 and 445: Standard Character Set Code Table H
- Page 446 and 447: Trademarks AIX BookMaster CICS DFSM
- Page 448 and 449: Bibliography SMP/E Reference, SC28-
- Page 450 and 451: Index A2C (SETC built-in function)
- Page 452 and 453: Index B B-type binary constant 141
MACRO<br />
&NAME MOVE &TO,&FROM<br />
LCLC<br />
&PREFIX<br />
&PREFIX SETC 'FIELD' Statement 1<br />
&NAME ST 2,SAVEAREA<br />
L 2,&PREFIX&FROM Statement 2<br />
ST 2,&PREFIX&TO Statement 3<br />
L<br />
2,SAVEAREA<br />
MEND<br />
-------------------------------------------------------------------<br />
HERE MOVE A,B<br />
-------------------------------------------------------------------<br />
+HERE ST<br />
2,SAVEAREA<br />
+ L 2,FIELDB<br />
+ ST 2,FIELDA<br />
+ L 2,SAVEAREA<br />
Statement 1 assigns the character value FIELD to the SETC symbol &PREFIX. In<br />
statements 2 and 3, &PREFIX is replaced by FIELD.<br />
The following example shows how the value assigned to a SETC symbol may be<br />
changed in a macro definition.<br />
MACRO<br />
&NAME MOVE &TO,&FROM<br />
LCLC<br />
&PREFIX<br />
&PREFIX SETC 'FIELD' Statement 1<br />
&NAME ST 2,SAVEAREA<br />
L 2,&PREFIX&FROM Statement 2<br />
&PREFIX SETC 'AREA' Statement 3<br />
ST 2,&PREFIX&TO Statement 4<br />
L<br />
2,SAVEAREA<br />
MEND<br />
-------------------------------------------------------------------<br />
HERE MOVE A,B<br />
-------------------------------------------------------------------<br />
+HERE ST<br />
2,SAVEAREA<br />
+ L 2,FIELDB<br />
+ ST 2,AREAA<br />
+ L 2,SAVEAREA<br />
Statement 1 assigns the character value FIELD to the SETC symbol &PREFIX.<br />
Therefore, &PREFIX is replaced by FIELD in statement 2. Statement 3 assigns the<br />
character value AREA to &PREFIX. Therefore, &PREFIX is replaced by AREA, instead<br />
of FIELD, in statement 4.<br />
The following example uses the substring notation in the operand field of a SETC<br />
instruction.<br />
Chapter 9. How to Write Conditional Assembly Instructions 385