8086 write an assembly language program to find one's complement and two's complement of an 8-bit number
Answers
Answered by
0
it is quite tough question
Answered by
0
The given 8086 assembly language program finds one's complement and two's complement of an 8-bit number.
Explanation:
Algorithm –
- Firstly, get the data loaded from memory 3000 towards A (accumulator)
- Now, make the content in the accumulator complemented
- Let the content of the accumulator get stored in memory 3001 to ensure the 1's complementation.
- To get the 2's complement to add 01 to the content in Accumulator.
- Get content of accumulator recorded in memory 3002 (2’s complement)
- Terminate
Program :
Memory Mnemonics Operands Comment
2000 LDA [3000] [A] <- [3000]
2003 CMA [A] <- [A^]
2004 STA [3001] 1’s complement
2007 ADI 01 [A] <- [A] + 01
2009 STA [3002] 2’s complement
200C HLT Stop
Hence, the given 8086 assembly language program finds the 1's and 2's complements of the numbers.
Similar questions