20 Custom Macro

20.13.2 Arithmetic Operations and Functions

Single-Operand Operations

Single-operand minus: #i = – #j The code of the operation is .

As a result of the operation, variable #i will have a value identical with variable #j in absolute value but opposite in sign.

Arithmetic negation: #i = NOT #j The code of the operation is NOT

As a result of the operation, variable #j is converted first into a 32-bit fixed-point number. Error message 3091 ERRONEOUS OPERATION WITH # is returned unless the converted number can be represented by 32 bits. Then the value of that fixed-point number will be negated bit by bit and the number produced this way will be re-converted into a floating-point one and will be put in variable #i.

Additive arithmetic operations

Addition: #i = #j + #k

The code of the operation is +.

As a result of the operation, variable #i will assume the sum of the values of variables #j and #k.

Subtraction: #i = #j – #k

The code of the operation is .

As a result of the operation, variable #i will assume the difference of the values of variables #j and #k.

Logical sum, or: #i = #j OR #k

The code of the operation is OR.

As a result of operation, the logic sum of variables #j and #k will be entered in variable #i at every bit of 32 bits. Wherever 0 is found at each of the identical bit values of the two numbers, 0 will be represented by that bit value in the result (otherwise 1).

Exclusive or: #i = #j XOR #k

The code of the operation is XOR.

As a result of operation, the variables #j and #k will be added together in every bit of 32 bits in variable #i in such a way that 0 will be the bit value in the result wherever identical numerical values are found in identical bit positions (and 1 will be wherever different numerical values are found), in each of the 32 bits.

Multiplicative arithmetic operations

Multiplication: #i = #j * #k

The code of the operation is *.

As a result of operation, variable #i will assume the product of the values of variables #j and #k.

185

Page 185
Image 185
NCT Group 99M, 2000M manual Arithmetic Operations and Functions, Single-operand minus #i = #j The code of the operation is