4.2 LOGIC AND ARITHMETIC OPERATIONS 4.2 LOGIC AND ARITHMETIC OPERA...

3.4.2 Logic and arithmetic operations

The instructions of the logic operations are: and, not, or and xor. These

work on the bits of their operators.

To verify the result of the operations we turn to the cmp and test

instructions.

The instructions used for the algebraic operations are: to add, to

subtract sub, to multiply mul and to divide div.

Almost all the comparison instructions are based on the information

contained in the flag register. Normally the flags of this register which

can be directly handled by the programmer are the data direction flag DF,

used to define the operations about chains. Another one which can also be

handled is the IF flag by means of the sti and cli instructions, to activate

and deactivate the interruptions.