0
\$\begingroup\$

I've got two questions here:

#1

The MOV A,B is said to be a one byte instruction, where B = 000 and A = 111, then MOV should be equal to 00, but, The binary representation of the BC Rp is 00. So, I'm getting confused as to how it is a one byte instruction.

#2 The MVI instruction involves only registers and yet it required a memory read operation:

enter image description here

but, MOV instruction ALSO involves only registers and yet it doesn't require a memory read, WHY?

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ Nitpick: it would help to state (in the question's title, or in the exposition) that you mean 8085 specifically. It's only in the tags currently. \$\endgroup\$ – anrieff Oct 17 '17 at 11:59
1
\$\begingroup\$

The MVI instruction involves only registers and yet it required a memory read

This is a two byte instruction, where the second byte is directly ternsferred into the destination register. Thus two reads required: Opcode and value.

The MOV A,B is said to be a one byte instruction

MOV does not accept register pairs, its opcode is two bits and the 2 operands are three bits each: One eight bit byte instruction.

MOV should be equal to 00

No, the encoding of MOV A,B is 0170 in octal or 0x78 in hex.

\$\endgroup\$
  • \$\begingroup\$ Considering how an opcode is formed: A=001 and B=111, opcode forming tells that these should be tacked up as: 001111 and there are two bits remaining so that leaves for 4 values all taken by register pairs: HL, BC and DE, how come the hex: 0X78 formed? \$\endgroup\$ – mathmaniage Oct 17 '17 at 12:52
  • \$\begingroup\$ Nope. Instruction format for MOV in binary is 01xxxyyy where x and y are the three operand bits each. \$\endgroup\$ – Turbo J Oct 17 '17 at 13:09
  • \$\begingroup\$ You mean that for one byte instructions these are unique instructions, not following some general rule? \$\endgroup\$ – mathmaniage Oct 17 '17 at 13:46
  • \$\begingroup\$ @BeshalJaenal The instruction is decoded in T4. If it turns out that this decoding determines that another byte (immediate value, for example) is required, then 3 more cycles (another state) are added to get that added byte. An STA will require T1-T4 for the first byte, then three more states (each with T1-T3) for the remaining two reads plus one write. I'm not sure what's confusing for you. \$\endgroup\$ – jonk Oct 17 '17 at 18:47
  • \$\begingroup\$ Ok, I need to know how the MOV A,B is formulated in binary. \$\endgroup\$ – mathmaniage Oct 18 '17 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.