Posts

Showing posts with the label 8051 Arithmetic Operations

8051 Arithmetic Operations Subtraction, Multiplication, Division, Decimal Arithmetic ,Example Programs, AND Summary

Image
  Subtraction Subtraction can be done by taking the 2's complement of the number to be subtracted, the subtrahend, and adding it to another number, the minuend. The 8051, however, has com­mands to perform direct subtraction of two signed or unsigned numbers. Register A is the destination address for subtraction. All four addressing modes may be used for source addresses. The commands treat the carry flag as a borrow and always subtract the carry flag as part of the operation. The following table lists the subtract mnemonics. Mnemonic Operation   SUBB A,#n Subtract immediate number n and the C flag from A; put the result in A SUBB A,add Subtract the contents of add and the C flag from A; put the result in A   SU...