The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL

LOGIC AND COMPARE INSTRUCTIONSComplement Accumulator


CPL A ;complements the register A‰This is called 1’s complement‰To get the 2’s complement, all we have to do is to to add 1 to the 1’s complement


MOV A, #55HCPL A

;now A=AAH;0101 0101(55H) ;becomes 1010 1010(AAH)
Free download pdf