What does it mean by MOV D D?

haccks picture haccks · Jul 17, 2013 · Viewed 7.4k times · Source

In assembly language, instruction

MOV A B

means moving the content of B (source) to A (destination).
I suddenly came up with the instruction

MOV D D

What does it imply?

I have seen this in my lab manual. Screenshot:

enter image description here

Answer

Jim Mischel picture Jim Mischel · Jul 17, 2013

The 8085 register-to-register MOV instructions are orthogonal. That is, there are opcodes to move any of the 8-bit registers to any of the other 8-bit registers. So MOV D,D moves the contents of the D register to the D register. It doesn't do anything useful and doesn't affect any of the flags, but it's a valid instruction just as are MOV A,A, MOV B,B, etc.

Copying a register to itself is effectively a "no operation" or NOP instruction. The "official" 8085 NOP is opcode 00, but any of the register-move-to-itself instructions have the same effect.

It's really just an artifact of the way the processor was designed. There are some tricks you can do that make use of those instructions, but they're not generally useful.