HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

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

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

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

Saved successfully!

Ooh no, something went wrong!