11.07.2015 Views

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

HLASM: V1R6 Language Ref

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SETB instruction|||Subscripted SETB symbolsThe SETB symbol in the name field can be subscripted. If the same SETB symbolhas not been previously declared in a GBLB or LCLB instruction with an allowabledimension, then the symbol is implicitly declared as a local SETB array variable.The assembler assigns the binary value explicitly specified, or implicit in thelogical expression present in the operand field, to the position in the declared arraygiven by the value of the subscript. The subscript expression must not be 0 or havea negative value.Logical (SETB) expressionsYou can use a logical expression to assign a binary value to a SETB symbol. Youcan also use a logical expression to represent the condition test in an AIFinstruction. This use lets you code a logical expression whose value (0 or 1) variesaccording to the values substituted into the expression and thereby determinewhether or not a branch is to be taken.Figure 41 on page 360 defines a logical expression.It is important to note that logical expressions contain unquoted spaces that do notterminate the operand field. This is called “logical-expression format”, and suchexpressions are always enclosed in parentheses.A logical expression can consist of a logical expression and a logical term separatedby a logical operator delimited by spaces. The logical operators are:AND Format: Logical-expressionOperands: BinaryOutput: (bexpr1 AND bexpr2) has value 1, if each logical expressionevaluates to 1, otherwise the value is 0.ExampleAfter the following statements &VAR contains the arithmetic value 0.Name Operation Operand&OP1 SETB 1&OP2 SETB 0&VAR SETB (&OP1 AND &OP2)AND NOTFormat: Logical-expressionOperands: BinaryOutput: The value of the second logical term is inverted, and theexpression is evaluated as though the AND operator was specified.NOTExample(1 AND NOT 0) is equivalent to (1 AND 1).Format:Logical-expression, function-invocationOperands: BinaryOutput: NOT(bexp) inverts the value of the logical expression.Chapter 9. How to write conditional assembly instructions 361

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

Saved successfully!

Ooh no, something went wrong!