In 8085 Instruction set, logical type there is one complement instruction with the mnemonic CMA. It actually stands for “CoMplement the Accumulator”. It performs1's complement operation on the current contents of Accumulator, and the result is stored back in the Accumulator replacing its previous contents. It is to be noted that, there are no other instructions tocomplement any other register’s contents. Though it is a logicaltype of instruction, Flag bits are not affected by the execution of this instruction. It occupies only 1 Byte in memory.
Let us suppose that example, the initial content of Accumulator is AAH i.e. 1010 1010 CMA requires. So after execution of CMA instructionAccumulator will the Accumulatorsupdated contents will be 0101 0101 in binary i.e. 55H. I we an example CMA instruction twice then the content of the in binary become AAH i.e. 1010 1010 in the binary back again.
|2000||3E||MVI A, 55H||A ← 55H =0101 0101B|
|2001||55||55H as operand|
|2002||2F||CMA||A ← 1’sComplement of 0101 0101B = 1010 1010B = AAH|
|2003||2F||CMA||A ← 1’sComplement of 1010 1010B = 0101 0101B = 55H|
The timing diagram against this instruction CMA execution is as follows –
Summary − So this instruction CMA requires 1-Byte, 1-Machine Cycle (Opcode Fetch) and 4 T-States for execution as shown in the timing diagram.