7. Logic operations

As well as the usual arithmetic operations, a CPU will also be undertaking logic operations. Logic operations include

Mnemonic Comment Code Operation
AND logical And AND dest, source Dest = dest AND source
OR logical Or OR dest, source Dest = dest OR source
NOT logical invert NOT Op dest = NOT dest
XOR exclusive OR XOR dest, source dest = dest XOR source
NEG two's complement operation NEG dest, source dest = 2 complement (dest)

These logical operations will also set or reset a number of flags in the Program Status Word (PSW) depending on the outcome. These flags can then be tested to cause a branch or a jump in the code to occur.


Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: boolean logic



Copyright © www.teach-ict.com