The machine code for the JMP instruction comprises of:
opcode - 11CCC010 (where CCC is the state of the flag bit used to set the condition) 8 bits
and
address
for the jump - let's say a 16 bit address.
First there is a fetch operation of the opcode so it needs 1 machine cycle. The state of the flag bit is checked. If condition satisfies then the address is read else it is not. Checking whether the condition satisfies should not take any significant clock cycles since it is determined from the state of the flag bits.
i - Now if condition satisfies: no. of machine cycles needed = 1 (for fetch) + 2 (for reading the address which is 16 bits) = 3
ii. if condition doesn't satisfy: there should be no read cycles (after the fetch cycle) and so the number of machine cycles needed must be 1 ie the fetch cycle only.
But the material I am refering to to learn microprocessors says it will need 2 machine cycles but doesn't tell why and hence my confusion. Should it be 1 machine cycle or 2 machine cycles?
In case there is some confusion over machine cycle and clock cycle, please feel free to answer in any.