How to find 1's and 2's complement without using CMA operation in 8085 microprocessor?

Status
Not open for further replies.

Atri Pal

Newbie
Joined
Apr 16, 2021
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
In this problem, the given number is located at 8000H location. After finding the 1’s
complement and 2’s complement the result locations are 9000H and 9001H respectively.

address - 8000
data - FD
 

Subtract FD from FF to get the 1's compliment ( 00000010 ), and add 1 to the 1's complement to get the 2's complement ( 00000011 ).
Uses the add and subtract instructions, but not compare accumulator instruction ( CMA).
 
Hi,

A simple internet search gives many results.
BTW: the problrm is not related to 8051 .. it's the same with all processors.

Hints: XOR, INV, COM, ADD, INC, SUB...even a lookup table is possible.

Klaus
 

Subtract FD from FF to get the 1's compliment ( 00000010 ), and add 1 to the 1's complement to get the 2's complement ( 00000011 ).
Uses the add and subtract instructions, but not compare accumulator instruction ( CMA).
Thanks!! It worked!!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…