2

How exactly is JMP XXXXH; executed ? First the PC(Program counter) will contain the address where this instruction is present. In first machine cycle opcode will be fetched and PC will be incremented . Now in the second machine cycle we have to read the second byte of this instruction which is nothing but half of the address where we want to jump . So it should be loaded into half of PC. But then how do we know the address of the 3rd byte of this instruction. I'm confused

Urooj
  • 73
  • 1
  • 4

2 Answers2

3

There is an internal temporary register (not shown in the ISA documentation) that holds the second byte of the instruction while the third byte is being fetched. After that, the PC is updated with the full 16-bit value.

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
  • Don't we then need another t state to load the final address in PC .This would give us total T-states to be 11. Why are there 10 only ? – Urooj Apr 19 '20 at 11:58
  • The transfer of the two bytes to the PC occurs in parallel, during the final T state. – Dave Tweed Apr 19 '20 at 11:59
  • Is this what happens ...second byte is loaded into temporary register during second machine cycle . After that third byte is loaded into PC directly (as we can overwrite the address at this point) during third machine cycle and at same time contents of temporary register are loaded into other half of PC – Urooj Apr 19 '20 at 12:07
  • Yes, that's it. – Dave Tweed Apr 19 '20 at 12:08
  • Thankyou so much :) – Urooj Apr 19 '20 at 12:09
0

The 8085 instruction set is classified into 3 categories by considering the length of the instructions. In 8085, the length is measured in terms of “byte” rather then “word” because 8085 microprocessor has 8-bit data bus. Three types of instruction are: 1-byte instruction, 2-byte instruction, and 3-byte instruction. Source: Geeks for Geeks.

The article goes on to explain ...

  1. Three-byte instructions –

Three-byte instruction is the type of instruction in which the first 8 bits indicates the opcode and the next two bytes specify the 16-bit address. The low-order address is represented in second byte and the high-order address is represented in the third byte.

Note – These instructions would require three memory locations to store the binary codes. The mnemonic is always followed by 16-bit (or adr).

The three byte instruction won't execute until it has loaded the full address.

Example-2:
Task- Transfer the program sequence to the memory location 2085H.
Mnemonic- JMP 2085H
Opcode- JMP
Operand- 2085H
Hex Code- C3
85
20

Transistor
  • 168,990
  • 12
  • 186
  • 385