D
D
demsp2017-07-16 14:01:09
Processors
demsp, 2017-07-16 14:01:09

How does the program counter work in a processor?

From the book: "An instruction can take from 1 (opcode only) to 11 or more bytes if a 4-byte offset and a 4-byte operand are specified in immediate address mode, as well as 2 bytes of address mode and an opcode."
As I understand it, the processor needs to increase the program counter when moving on to the next operation. But if the instructions are of different sizes, how then does the processor find the start of the next instruction? And if the counter increases by 1, i.e. PC+1, how then are commands larger than one byte handled?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2017-07-16
@Rsa97

Calculates based on the current command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question