Search code examples
assemblymicroprocessors8085

What does it mean by MOV D D?


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


Solution

  • 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.