Search This Blog

Monday, April 4, 2011

Find 2's complement of number


; 32 = 0011 0010
; 32'S COMPLEMENT
; 1100 1101 = CD
; 2's COMPLEMENT IS 1100 1101 + 1 = 1100 1110 = CE
LDA 2000H ; LOAD THE NUMBER
CMA  ; COMPLEMENT THE NUMBER
ADI 01H   ;
STA 2001H ; STORE THE COMPLEMENT
HLT  ;

1 comment: