11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SETBSETB instructioninstructionUse the SETB instruction to assign a bit value to a SETB symbol. You can assignthe 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 assemblerevaluates this expression to determine whether it is true or false, and then assignsthe value 1 or 0, respectively, to the SETB symbol. You can use this computedvalue in condition tests or for substitution.►► variable_symbol SETB binary_value ►◄|variable_symbolis a variable symbol.A global variable symbol in the name field must have been previously declaredas a SETB symbol in a GBLB instruction. Local SETB symbols need not bedeclared in a LCLB instruction. The assembler considers any undeclaredvariable symbol found in the name field of a SETB instruction as a local SETsymbol. The variable symbol is assigned a type attribute value of N.binary_valueis a binary bit value that may be specified as:v A binary digit (0 or 1)v A binary value enclosed in parenthesesAn arithmetic value enclosed in parentheses is allowed. This value can berepresented 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 thename field. If the value is not 0, the assembler assigns a value of 1.v A logical expression enclosed in parenthesesA logical expression is evaluated to determine if it is true or false; the SETBsymbol in the name field is then assigned the binary value 1 or 0,corresponding to true or false, respectively. The assembler assigns theexplicitly specified binary value (0 or 1) or the computed logical value (0 or1) to the SETB symbol in the name field.Rules for Coding Logical Expressions: The following is a summary of coding rulesfor logical expressions:v A logical expression must not contain two logical terms in succession.v A logical expression can contain two logical operators in succession; however,the only allowed combinations are OR NOT, XOR NOT and AND NOT. The twooperators must be separated from each other by one or more spaces.v Any logical term, relation, or inner logical expression can be optionally enclosedin parentheses.v The relational and logical operators must be immediately preceded and followedby at least one space, except when written (NOT bexpr).v A logical expression can begin with the logical unary operator NOT.Chapter 9. How to write conditional assembly instructions 359

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

Saved successfully!

Ooh no, something went wrong!