HLASM Language Reference
HLASM Language Reference HLASM Language Reference
SETB Instruction The two comparands in a character relation are compared, character by character, according to binary (EBCDIC) representation of the characters. If two comparands in a relation have character values of unequal length, the assembler always takes the shorter character value to be less. 3. The assembler carries out logical operations from left to right. However, a. It carries out logical NOTs before logical ANDs, ORs and XORs b. It carries out logical ANDs before logical ORs and XORs c. It carries out logical ORs before logical XORs 4. In parenthesized logical expressions, the assembler evaluates the innermost expressions first, and then considers them as logical terms in the next outer level of expressions. It continues this process until it evaluates the outermost expression. Using SETB Symbols: The logical value assigned to a SETB symbol is used for the SETB symbol appearing in the operand field of an AIF instruction or another SETB instruction. If a SETB symbol is used in the operand field of a SETA instruction, or in arithmetic relations in the operand fields of AIF and SETB instructions, the binary values 1 (true) and 0 (false) are converted to the arithmetic values 1 and 0, respectively. If a SETB symbol is used in the operand field of a SETC instruction, in character relations in the operand fields of AIF and SETB instructions, or in any other statement, the binary values 1 (true) and 0 (false), are converted to the character values '1' and '', respectively. The following example illustrates these rules. It assumes that (L'&TO EQ 4) is true, and (S'&TO EQ ) is false. MACRO &NAME MOVE &TO,&FROM LCLA &A1 LCLB &B1,&B2 LCLC &C1 &B1 SETB (L'&TO EQ 4) Statement 1 &B2 SETB (S'&TO EQ ) Statement 2 &A1 SETA &B1 Statement 3 &C1 SETC '&B2' Statement 4 ST 2,SAVEAREA L 2,&FROM&A1 ST 2,&TO&C1 L 2,SAVEAREA MEND ------------------------------------------------------------------- HERE MOVE FIELDA,FIELDB ------------------------------------------------------------------- +HERE ST 2,SAVEAREA + L 2,FIELDB1 + ST 2,FIELDA + L 2,SAVEAREA Because the operand field of statement 1 is true, &B1 is assigned the binary value 1. Therefore, the arithmetic value +1 is substituted for &B1 in statement 3. 368 HLASM V1R5 Language Reference
SETC Instruction Because the operand field of statement 2 is false, &B2 is assigned the binary value . Therefore, the character value is substituted for &B2 in statement 4. SETC Instruction The SETC instruction assigns a character value to a SETC symbol. You can assign whole character strings, or concatenate several smaller strings together. The assembler assigns the composite string to your SETC symbol. You can also assign parts of a character string to a SETC symbol by using the substring notation; see “Substring Notation” on page 371. You can change the character value assigned to a SETC symbol. This lets you use the same SETC symbol with different values for character comparisons in several places, or for substituting different values into the same model statement. ►►──variable_symbol──SETC──character_value─────────────────────────►◄ variable symbol is a variable symbol. A global variable symbol in the name field must have been previously declared as a SETC symbol in a GBLC instruction. Local SETC symbols need not be declared in a LCLC instruction. The assembler considers any undeclared variable symbol found in the name field of a SETC instruction as a local SET symbol. The variable symbol is assigned a type attribute value of U. character_value is a character value that may be specified by one of the following: An operation code attribute reference A type attribute reference A character expression The assembler assigns the character string value represented in the operand field to the SETC symbol in the name field. The string length must be in the range 0 | (null character string) through 1024 characters. When a SETA or SETB symbol is specified in a character expression, the unsigned decimal value of the symbol (with leading zeros removed) is the character value given to the symbol. A duplication factor can precede a character expression or substring notation. The duplication factor can be any non-negative arithmetic expression allowed in the operand of a SETA instruction. For example: &C1 SETC (3)'ABC' assigns the value 'ABCABCABC' to &C1. A zero duplication factor results in a null (zero-length) string. Chapter 9. How to Write Conditional Assembly Instructions 369
- Page 338 and 339: How to Write Conditional Assembly I
- Page 340 and 341: SET Symbols SET Symbol Specificatio
- Page 342 and 343: SET Symbols Figure 86 (Page 3 of 3)
- Page 344 and 345: Data Attributes this example indica
- Page 346 and 347: Data Attributes variable_symbol is
- Page 348 and 349: Data Attributes The value of an att
- Page 350 and 351: Data Attributes The following attri
- Page 352 and 353: Data Attributes Assembler gives a t
- 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 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 404 and 405: Concatenation of strings containing
- 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
SETB Instruction<br />
The two comparands in a character relation are compared, character by<br />
character, according to binary (EBCDIC) representation of the characters. If<br />
two comparands in a relation have character values of unequal length, the<br />
assembler always takes the shorter character value to be less.<br />
3. The assembler carries out logical operations from left to right. However,<br />
a. It carries out logical NOTs before logical ANDs, ORs and XORs<br />
b. It carries out logical ANDs before logical ORs and XORs<br />
c. It carries out logical ORs before logical XORs<br />
4. In parenthesized logical expressions, the assembler evaluates the innermost<br />
expressions first, and then considers them as logical terms in the next outer<br />
level of expressions. It continues this process until it evaluates the outermost<br />
expression.<br />
Using SETB Symbols: The logical value assigned to a SETB symbol is used for<br />
the SETB symbol appearing in the operand field of an AIF instruction or another<br />
SETB instruction.<br />
If a SETB symbol is used in the operand field of a SETA instruction, or in arithmetic<br />
relations in the operand fields of AIF and SETB instructions, the binary values 1<br />
(true) and 0 (false) are converted to the arithmetic values 1 and 0, respectively.<br />
If a SETB symbol is used in the operand field of a SETC instruction, in character<br />
relations in the operand fields of AIF and SETB instructions, or in any other<br />
statement, the binary values 1 (true) and 0 (false), are converted to the character<br />
values '1' and '', respectively.<br />
The following example illustrates these rules. It assumes that (L'&TO EQ 4) is true,<br />
and (S'&TO EQ ) is false.<br />
MACRO<br />
&NAME MOVE &TO,&FROM<br />
LCLA<br />
&A1<br />
LCLB<br />
&B1,&B2<br />
LCLC<br />
&C1<br />
&B1 SETB (L'&TO EQ 4) Statement 1<br />
&B2 SETB (S'&TO EQ ) Statement 2<br />
&A1 SETA &B1 Statement 3<br />
&C1 SETC '&B2' Statement 4<br />
ST<br />
2,SAVEAREA<br />
L<br />
2,&FROM&A1<br />
ST<br />
2,&TO&C1<br />
L<br />
2,SAVEAREA<br />
MEND<br />
-------------------------------------------------------------------<br />
HERE MOVE FIELDA,FIELDB<br />
-------------------------------------------------------------------<br />
+HERE ST<br />
2,SAVEAREA<br />
+ L 2,FIELDB1<br />
+ ST 2,FIELDA<br />
+ L 2,SAVEAREA<br />
Because the operand field of statement 1 is true, &B1 is assigned the binary value<br />
1. Therefore, the arithmetic value +1 is substituted for &B1 in statement 3.<br />
368 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>