0
votes

I'm studying MIPS 32 bit architecture and I don't understand a few things about jump instruction implementation. In particular, why for jump implementation we must insert into PC:

  1. the upper 4 bits of the current PC+4
  2. the 26-bit immediate field of the jump instruction
  3. adding 00 as the 2 low order bits
1

1 Answers

4
votes

Current PC+4 is because of pipelining: PC was already incremented before the Jump instruction starts to execute.

A Jump instruction has only room for 26 bits addressing. So 2 limitations that ensue are:

  1. The jump has to be within a 28 bits range from current instruction address, hence using upper 4 bits from PC).
  2. The jump has to be word-aligned, that is, the destination address has to be a multiple of 4, hence the lower 2 bits set to 00