The sub (subtraction) instruction of the i386 is much like the add instruction. However, it is important to note that in the AT&T notation, the difference is computed by subtracting the first operand from the second operand, and it is stored at the second operand.
This means that the following instruction subtracts 32 from eax, then the result is stored in eax. This essentially is decrementing eax by 32.
sub has to follow all the same rules as add and mov, namely it can only contain up to one memory operand.
The compare (cmp) instruction is like a sub instruction, except it does not store the difference. cmp affects all the flags the same way as sub, however.