Department of Computer Scien
ce and Information Engineering
National Cheng Kung University, TAIWAN
HANEL
LOGIC AND COMPARE INSTRUCTIONSComplement Accumulator
CPL A ;complements the register AThis is called 1’s complementTo 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)