Multiply instruction

21
Aug
Instruction Multiply
Syntax Multiply Destination, Source1, Source2[, Overflow-Label]
Constraints Destination, Source1, and Source2 are all of the same type
Process Destination := Source1 * Source2
If Overflow Detected Then Go To Overflow-Label

The Multiply instruction is used to add two integer or decimal variables together.

The Multiply is in all other ways similar to the Add instruction.

Whenever possible, multiplication of integers is executed on registers twice wider than the sources in order to easily catch overflows. Floating points generally includes an overflow flag that can be used to detect problems.

Fixed point multiplications require a shift and if necessary raise an error on lost bits. The shift comes from the data type and equals the number of bits behind the decimal point.