How does the CPU know how many bytes it should read for the next instruction, considering instructions have different lengths?
The simple way is to just read one byte, decode it and then determine if it’s a complete instruction. If not read another byte, decode it if necessary and then determine if a complete instruction has been read. If not continue reading/decoding bytes until the complete instruction is read. This means that if the instruction … Read more