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  ;

One thought on “Find 2’s complement of number

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s