Some of the arithmetic instructions are as follows:
Instruction |
Structure |
Description |
add/sub |
add/sub dest, src |
dest = dest + src/dest = dest - src |
inc/dec |
inc/dec dest |
dest = dest + 1/dest = dest - 1 |
mul |
mul src |
(Unsigned multiply) rdx:rax = rax * src |
div |
div src |
rdx:rax/src (returns the result in rax and the remainder/modulus in rdx) |
Additionally, for logic and bits manipulation, they are like this:
Instruction |
Structure |
Description |
or/and/xor |
or/and/xor dest, src |
dest = dest & src/dest = dest | src/dest = dest ^ src |
not |
not dest |
dest = !dest (the bits are flipped) |
And, lastly, for shifts and rotations they are like this:
Instruction |
Structure |
Description |
shl/shr |
shl/shr dest, src (the dest register's maximum number of bits such as 32 or 64) |
dest = dest << src/dest = dest >> src |