HLASM Language Reference
HLASM Language Reference HLASM Language Reference
SETB Instruction Any expression that may be used in the operand field of a SETA instruction may be used to refer to an operand in an operand sublist. Sublists are described in “Sublists in Operands” on page 304. The following macro definition adds the last operand in an operand sublist to the first operand in an operand sublist and stores the result at the first operand. A sample macro instruction and generated statements follow the macro definition. MACRO ADDX &NUMBER,® Statement 1 LCLA &LAST &LAST SETA N'&NUMBER Statement 2 L ®,&NUMBER(1) A ®,&NUMBER(&LAST) Statement 3 ST ®,&NUMBER(1) MEND ------------------------------------------------------------------- ADDX (A,B,C,D,E),3 Statement 4 ------------------------------------------------------------------- + L 3,A + A 3,E + ST 3,A &NUMBER is the first symbolic parameter in the operand field of the prototype statement (statement 1). The corresponding characters (A,B,C,D,E) of the macro instruction (statement 4) are a sublist. Statement 2 assigns to &LAST the arithmetic value +5, which is equal to the number of operands in the sublist. Therefore, in statement 3, &NUMBER(&LAST) is replaced by the fifth operand of the sublist. SETB Instruction Use the SETB instruction to assign a bit value to a SETB symbol. You can assign the bit values, 0 or 1, to a SETB symbol directly and use it as a switch. If you specify a logical (Boolean) expression in the operand field, the assembler evaluates this expression to determine whether it is true or false, and then assigns the value 1 or 0, respectively, to the SETB symbol. You can use this computed value in condition tests or for substitution. ►►──variable_symbol──SETB──binary_value────────────────────────────►◄ variable_symbol is a variable symbol. A global variable symbol in the name field must have been previously declared as a SETB symbol in a GBLB instruction. Local SETB symbols need not be declared in a LCLB instruction. The assembler considers any undeclared variable symbol found in the name field of a SETB instruction as a local SET symbol. The variable symbol is assigned a type attribute value of N. binary_value is a binary bit value that may be specified as: A binary digit (0 or 1) 362 HLASM V1R5 Language Reference
SETB Instruction A binary value enclosed in parentheses An arithmetic value enclosed in parentheses is allowed. This value can be represented by: – An unsigned, self-defining term – A SETA symbol – A previously defined ordinary symbol with an absolute value – An attribute reference other than the type attribute reference. If the value is 0, the assembler assigns a value of 0 to the symbol in the name field. If the value is not 0, the assembler assigns a value of 1. A logical expression enclosed in parentheses A logical expression is evaluated to determine if it is true or false; the SETB symbol in the name field is then assigned the binary value 1 or 0, corresponding to true or false, respectively. The assembler assigns the explicitly specified binary value (0 or 1) or the computed logical value (0 or 1) to the SETB symbol in the name field. Rules for Coding Logical Expressions: The following is a summary of coding rules for logical expressions: A logical expression must not contain two logical terms in succession. A logical expression can contain two logical operators in succession; however, the only allowed combinations are OR NOT, XOR NOT and AND NOT. The two operators must be separated from each other by one or more spaces. Any logical term, relation, or inner logical expression can be optionally enclosed in parentheses. The relational and logical operators must be immediately preceded and followed by at least one space, except when written (NOT bexpr). A logical expression can begin with the logical unary operator NOT. A logical expression can contain up to 18 logical operators. The relational and other operators used by the arithmetic and character expressions in relations do not count toward this total. Up to 255 levels of nested parentheses are allowed. Absolute ordinary symbols specified in logical expressions must be defined before the logical expression is encountered. The assembler determines the type of a logical relation by the first comparand. If the first comparand is a character expression that begins with a single quotation mark, then the logical relation is a character relation, otherwise the assembler treats it as an arithmetic relation. Chapter 9. How to Write Conditional Assembly Instructions 363
- Page 332 and 333: Inner and Outer Macro Instructions
- Page 334 and 335: Levels of Macro Call Nesting When t
- Page 336 and 337: Levels of Macro Call Nesting System
- 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 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 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
SETB Instruction<br />
A binary value enclosed in parentheses<br />
An arithmetic value enclosed in parentheses is allowed. This value can be<br />
represented by:<br />
– An unsigned, self-defining term<br />
– A SETA symbol<br />
– A previously defined ordinary symbol with an absolute value<br />
– An attribute reference other than the type attribute reference.<br />
If the value is 0, the assembler assigns a value of 0 to the symbol in the<br />
name field. If the value is not 0, the assembler assigns a value of 1.<br />
A logical expression enclosed in parentheses<br />
A logical expression is evaluated to determine if it is true or false; the SETB<br />
symbol in the name field is then assigned the binary value 1 or 0,<br />
corresponding to true or false, respectively. The assembler assigns the<br />
explicitly specified binary value (0 or 1) or the computed logical value (0 or<br />
1) to the SETB symbol in the name field.<br />
Rules for Coding Logical Expressions: The following is a summary of coding<br />
rules for logical expressions:<br />
A logical expression must not contain two logical terms in succession.<br />
A logical expression can contain two logical operators in succession; however,<br />
the only allowed combinations are OR NOT, XOR NOT and AND NOT. The<br />
two operators must be separated from each other by one or more spaces.<br />
Any logical term, relation, or inner logical expression can be optionally enclosed<br />
in parentheses.<br />
The relational and logical operators must be immediately preceded and<br />
followed by at least one space, except when written (NOT bexpr).<br />
A logical expression can begin with the logical unary operator NOT.<br />
A logical expression can contain up to 18 logical operators. The relational and<br />
other operators used by the arithmetic and character expressions in relations<br />
do not count toward this total.<br />
Up to 255 levels of nested parentheses are allowed.<br />
Absolute ordinary symbols specified in logical expressions must be defined<br />
before the logical expression is encountered.<br />
The assembler determines the type of a logical relation by the first comparand.<br />
If the first comparand is a character expression that begins with a single<br />
quotation mark, then the logical relation is a character relation, otherwise the<br />
assembler treats it as an arithmetic relation.<br />
Chapter 9. How to Write Conditional Assembly Instructions 363