Please explain how is this possible?

- 27
- 3
-
Requiring that at least one operand is a register is hardly an unusual imposition. – Damien_The_Unbeliever Jun 15 '21 at 07:46
2 Answers
Both MOV A,A
and MOV M,M
would be useless instructions as they do not perform any usefull computation. The internal architecture of 8085 is designed in such a way that at most one of the oparand can be M (a memory loaction). Thus MOV M,M
is invalid by design choice. Wheareas, instructions like MOV R,R
with R in {A,B,C,D,E,H,L} are allowed for simplicity of the design. In some cases such instructions might be useful to implement a busy wating loop.

- 165
- 1
- 1
- 13
The opcode for every instruction in the 8080 (and 8085) instruction set is exactly one byte long. It was probably designed this way to reduce the complexity of the instruction decoder hardware.
The bit pattern for a MOV
instruction is 01DDDSSS
where DDD
is the destination register and SSS
is the source register. Each register has its own unique 3-bit pattern. The code for an MOV M,M
instruction would be 01011011
, but that code has actually been assigned to the HLT
instruction.
The 8080/8085 instruction set does not actually use every possible bit pattern for the opcode, but there are very few free opcodes left. Perhaps by assigning HLT
to an opcode that would otherwise be a useless instruction it left one more opcode available for future expansion of the instruction set.

- 98,941
- 38
- 226
- 299