Statement: Find the 2's complement of the number stored at memory location 2000H and store the complemented number at memory location 2001H.
Example:
(2000H) = 34H
(2001H) = CBH + 01H = CCH
Program:
LDA 2000H ; Obtain the number from location 2000H
CMA ; Complement the number
ADI 01H ; Add one to the complemented number
STA 2001H ; Store the result at location 2001H
HLT ; Terminate program execution
Comments
Post a Comment