Installation manual

Publication 1747-RM001G-EN-P - November 2008
4-2 Math Instructions
About the Math Instructions
The majority of the instructions take two input values, perform the specified
arithmetic function, and output the result to an assigned memory location.
For example, both the ADD and SUB instructions take a pair of input values,
add or subtract them, and place the result in the specified destination. If the
result of the operation exceeds the allowable value, an overflow or underflow
bit is set.
To learn more about the math instructions, we suggest that you read the Math
Instructions Overview that follows.
Math Instructions Overview
The following general information applies to math instructions.
Entering Parameters
Source is the address(es) of the value(s) on which the mathematical,
logical, or move operation is to be performed. This can be word
addresses or program constants. An instruction that has two source
operands does not accept program constants in both operands.
Destination is the address of the result of the operation. Signed integers
are stored in two’s complement form and apply to both source and
destination parameters.
When using either an SLC 5/03 (OS301 and higher), SLC 5/04, or SLC 5/05
processor; floating point and string values (specified at the word level) are
supported.
Using Indexed Word Addresses
You have the option of using indexed word addresses for instruction
parameters specifying word addresses (except for fixed and SLC 5/01
processors).
Using Indirect Word Addresses
You have the option of using indirect word-level and bit-level addresses for
instructions specifying word addresses when using an SLC 5/03 (OS302), SLC
5/04 (OS401), or SLC 5/05 processors.