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
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 ...
- 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.
Task- Transfer the program sequence to the memory location 2085H.
Mnemonic- JMP 2085H
Hex Code- C3